projects
/
platform
/
upstream
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6562bb
)
nir/spirv: Handle boolean uniforms correctly
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Wed, 6 May 2015 19:54:02 +0000
(12:54 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Mon, 31 Aug 2015 23:58:20 +0000
(16:58 -0700)
src/glsl/nir/spirv_to_nir.c
patch
|
blob
|
history
diff --git
a/src/glsl/nir/spirv_to_nir.c
b/src/glsl/nir/spirv_to_nir.c
index
4a12b29
..
d1205f5
100644
(file)
--- a/
src/glsl/nir/spirv_to_nir.c
+++ b/
src/glsl/nir/spirv_to_nir.c
@@
-573,7
+573,16
@@
vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
nir_builder_instr_insert(&b->nb, &load->instr);
val->type = src_type;
- val->ssa = &load->dest.ssa;
+
+ if (src->var->data.mode == nir_var_uniform &&
+ glsl_get_base_type(src_type) == GLSL_TYPE_BOOL) {
+ /* Uniform boolean loads need to be fixed up since they're defined
+ * to be zero/nonzero rather than NIR_FALSE/NIR_TRUE.
+ */
+ val->ssa = nir_ine(&b->nb, &load->dest.ssa, nir_imm_int(&b->nb, 0));
+ } else {
+ val->ssa = &load->dest.ssa;
+ }
break;
}