summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-04-26 18:34:27 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-04-26 18:34:27 +0200
commit6c858227fd0b11fa53e13c2df6a27dc4f727bf9e (patch)
treee878d0a9cb3065dcbeb6a9041bb64a993b4a3197
parent7fe97747eeff082774ca33914df8ef8679c82b85 (diff)
glsl: skip tree grafting for sampler and image typesarb_bindless_texture
-rw-r--r--src/compiler/glsl/opt_tree_grafting.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/glsl/opt_tree_grafting.cpp b/src/compiler/glsl/opt_tree_grafting.cpp
index 28b6e1856e..3c8ab82088 100644
--- a/src/compiler/glsl/opt_tree_grafting.cpp
+++ b/src/compiler/glsl/opt_tree_grafting.cpp
@@ -371,6 +371,19 @@ tree_grafting_basic_block(ir_instruction *bb_first,
if (lhs_var->data.precise)
continue;
+ /* Do not graft sampler and image variables. This is a workaround to
+ * st/glsl_to_tgsi being unable to handle expression parameters to image
+ * intrinsics.
+ *
+ * Note that if this is ever fixed, we still need to skip grafting when
+ * any image layout qualifiers (including the image format) are set,
+ * since we must not lose those.
+ */
+ glsl_base_type base_type = lhs_var->type->base_type;
+
+ if (base_type == GLSL_TYPE_SAMPLER || base_type == GLSL_TYPE_IMAGE)
+ continue;
+
ir_variable_refcount_entry *entry = info->refs->get_variable_entry(lhs_var);
if (!entry->declaration ||