Module: Mesa
Branch: staging/21.1
Commit: 8cf9f401e936a0eeeaf7bad8033035a1390f4507
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8cf9f401e936a0eeeaf7bad8033035a1390f4507

Author: Alyssa Rosenzweig <[email protected]>
Date:   Thu Apr 22 11:23:39 2021 -0400

nir/lower_fragcolor: Fix driver_location assignment

Fixes crash in
dEQP-GLES31.functional.shaders.framebuffer_fetch.basic.last_frag_data
when using this pass.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Reviewed-by: Erik Faye-Lund <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10411>
(cherry picked from commit 73eb497b86a319d7d2aff9178cb07dd6b9d65df7)

---

 .pick_status.json                      | 2 +-
 src/compiler/nir/nir_lower_fragcolor.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index a4d012e4f4c..4b95202c5ab 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -9094,7 +9094,7 @@
         "description": "nir/lower_fragcolor: Fix driver_location assignment",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/compiler/nir/nir_lower_fragcolor.c 
b/src/compiler/nir/nir_lower_fragcolor.c
index 95eaf3dff2e..965b1cf24a8 100644
--- a/src/compiler/nir/nir_lower_fragcolor.c
+++ b/src/compiler/nir/nir_lower_fragcolor.c
@@ -80,7 +80,7 @@ lower_fragcolor_instr(nir_intrinsic_instr *instr, nir_builder 
*b, unsigned max_d
                                                    glsl_vec4_type(),
                                                    name);
       out_color->data.location = FRAG_RESULT_DATA0 + i;
-      out_color->data.driver_location = i;
+      out_color->data.driver_location = b->shader->num_outputs++;
       out_color->data.index = out->data.index;
       nir_store_var(b, out_color, frag_color, writemask);
    }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to