aco: fix 1D textureGrad() on GFX9
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 14 Apr 2020 14:15:02 +0000 (15:15 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 15 Apr 2020 10:45:07 +0000 (10:45 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 6f718edcedd ('aco: simplify gathering of MIMG address components')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4550>

src/amd/compiler/aco_instruction_selection.cpp

index 61a2d994d84b4e9b50ea5c9b1aca3455c2b97b7c..2acb4e822a345ad8ca5d85ba1b515bda453de429 100644 (file)
@@ -8458,7 +8458,7 @@ void visit_tex(isel_context *ctx, nir_tex_instr *instr)
       if (instr->sampler_dim == GLSL_SAMPLER_DIM_1D && ctx->options->chip_class == GFX9) {
          assert(has_ddx && has_ddy && ddx.size() == 1 && ddy.size() == 1);
          Temp zero = bld.copy(bld.def(v1), Operand(0u));
-         derivs = {ddy, zero, ddy, zero};
+         derivs = {ddx, zero, ddy, zero};
       } else {
          for (unsigned i = 0; has_ddx && i < ddx.size(); i++)
             derivs.emplace_back(emit_extract_vector(ctx, ddx, i, v1));