diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2022-04-22 09:05:26 -0400 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2022-04-24 21:04:55 -0700 |
commit | d71e9fcb157bf174161a27f2de67ef4f482e33bd (patch) | |
tree | 9dee9818c9be3e2bc5f47b459e16191725b0a586 | |
parent | 5d8a4ce3c458dc7faa30cd7c988f5c2ce5e95f83 (diff) |
glsl/nir: set new_style_shadow for sparse tex ops as necessary
this needs the sparse result type, which is not the ir type
Fixes: f4a972b7483 ("glsl/nir: convert sparse ir_texture to nir")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16097>
(cherry picked from commit a6a4bf0f1eae36cb68d5c67653ac013fe0fbde8a)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index 5052759b4bb..8fed3470ea4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,7 @@ "description": "glsl/nir: set new_style_shadow for sparse tex ops as necessary", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f4a972b74837a9f7992b93a808115541bf20589b" }, diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index bbc0aa93ad6..47e9b0d3756 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -2478,12 +2478,12 @@ nir_visitor::visit(ir_texture *ir) (glsl_sampler_dim) ir->sampler->type->sampler_dimensionality; instr->is_array = ir->sampler->type->sampler_array; instr->is_shadow = ir->sampler->type->sampler_shadow; - if (instr->is_shadow) - instr->is_new_style_shadow = (ir->type->vector_elements == 1); const glsl_type *dest_type = ir->is_sparse ? ir->type->field_type("texel") : ir->type; assert(dest_type != glsl_type::error_type); + if (instr->is_shadow) + instr->is_new_style_shadow = (dest_type->vector_elements == 1); instr->dest_type = nir_get_nir_type_for_glsl_type(dest_type); instr->is_sparse = ir->is_sparse; |