Mesa (master): spirv: Consider the sampled_image case in wa_glslang_179 workaround
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Nov 13 21:34:32 UTC 2019
Module: Mesa
Branch: master
Commit: 7ae506e5b8073ec8791272cb84b83c79adf9d4e7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7ae506e5b8073ec8791272cb84b83c79adf9d4e7
Author: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Date: Wed Nov 13 11:04:39 2019 -0800
spirv: Consider the sampled_image case in wa_glslang_179 workaround
Fixes: 9e440b8d0b9 ("spirv: Sort out the mess that is sampled image")
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/compiler/spirv/vtn_variables.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 4a9e031a9f8..960bc01ef68 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -2609,8 +2609,13 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
vtn_warn("OpStore of a sampler detected. Doing on-the-fly copy "
"propagation to workaround the problem.");
vtn_assert(dest->var->copy_prop_sampler == NULL);
- dest->var->copy_prop_sampler =
- vtn_value(b, w[2], vtn_value_type_pointer)->pointer;
+ struct vtn_value *v = vtn_untyped_value(b, w[2]);
+ if (v->value_type == vtn_value_type_sampled_image) {
+ dest->var->copy_prop_sampler = v->sampled_image->sampler;
+ } else {
+ vtn_assert(v->value_type == vtn_value_type_pointer);
+ dest->var->copy_prop_sampler = v->pointer;
+ }
} else {
vtn_fail("Vulkan does not allow OpStore of a sampler or image.");
}
More information about the mesa-commit
mailing list