radeonsi: don't adjust depth and stencil PS output locations
authorMarek Olšák <marek.olsak@amd.com>
Fri, 10 Jan 2020 21:47:04 +0000 (16:47 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 14 Jan 2020 23:46:07 +0000 (18:46 -0500)
this was for compatibility with TGSI

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader_nir.c

index 392972256178eb978e313aa9e24772c877402204..07199a295d5ac2b3f7e16ba0d7aa341a7a24c097 100644 (file)
@@ -3060,11 +3060,11 @@ static void si_llvm_return_fs_outputs(struct ac_shader_abi *abi,
                        break;
                case TGSI_SEMANTIC_POSITION:
                        depth = LLVMBuildLoad(builder,
-                                             addrs[4 * i + 2], "");
+                                             addrs[4 * i + 0], "");
                        break;
                case TGSI_SEMANTIC_STENCIL:
                        stencil = LLVMBuildLoad(builder,
-                                               addrs[4 * i + 1], "");
+                                               addrs[4 * i + 0], "");
                        break;
                case TGSI_SEMANTIC_SAMPLEMASK:
                        samplemask = LLVMBuildLoad(builder,
index d050ff0bc095774041ddf32f323049c2bf149a72..03f819ec7729c5bc05618941fa772651dc968695 100644 (file)
@@ -955,16 +955,8 @@ void si_nir_adjust_driver_locations(struct nir_shader *nir)
                        variable->data.driver_location *= 4;
        }
 
-       nir_foreach_variable(variable, &nir->outputs) {
+       nir_foreach_variable(variable, &nir->outputs)
                variable->data.driver_location *= 4;
-
-               if (nir->info.stage == MESA_SHADER_FRAGMENT) {
-                       if (variable->data.location == FRAG_RESULT_DEPTH)
-                               variable->data.driver_location += 2;
-                       else if (variable->data.location == FRAG_RESULT_STENCIL)
-                               variable->data.driver_location += 1;
-               }
-       }
 }
 
 /**