aco/ngg: Fix exports for NGG VS and TES.
authorTimur Kristóf <timur.kristof@gmail.com>
Wed, 1 Apr 2020 10:14:59 +0000 (12:14 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Apr 2020 11:29:35 +0000 (11:29 +0000)
The exports in NGG VS and TES work just like VS exports,
so the assembler needs to fix these too in the same manner.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3576>

src/amd/compiler/aco_assembler.cpp

index 8e89568a58b06d89960e9c7ff1f35597f669b933..aa6402c93b42f35fbae3938dc8dcc8e6f3241342 100644 (file)
@@ -659,7 +659,7 @@ void fix_exports(asm_context& ctx, std::vector<uint32_t>& out, Program* program)
       {
          if ((*it)->format == Format::EXP) {
             Export_instruction* exp = static_cast<Export_instruction*>((*it).get());
-            if (program->stage & hw_vs) {
+            if (program->stage & (hw_vs | hw_ngg_gs)) {
                if (exp->dest >= V_008DFC_SQ_EXP_POS && exp->dest <= (V_008DFC_SQ_EXP_POS + 3)) {
                   exp->done = true;
                   exported = true;
@@ -749,7 +749,7 @@ unsigned emit_program(Program* program,
 {
    asm_context ctx(program);
 
-   if (program->stage & (hw_vs | hw_fs))
+   if (program->stage & (hw_vs | hw_fs | hw_ngg_gs))
       fix_exports(ctx, code, program);
 
    for (Block& block : program->blocks) {