diff options
author | Iago Toral Quiroga <[email protected]> | 2017-01-24 11:49:40 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2017-01-25 08:08:16 +0100 |
commit | 56495080ed910c8fb7cd02aa5e3b14e0fb823c6d (patch) | |
tree | c2727977dfe61e61ca7c8a1c0d36430479ab1237 /src | |
parent | 9467d78d380695b38f48949497f7de12c1054e81 (diff) |
spirv: handle gl_SampleMask
SPIR-V maps both gl_SampleMask and gl_SampleMaskIn to the same
builtin (SampleMask). The only way to tell which one we are dealing with
is to check if it is an input or an output.
Fixes:
dEQP-VK.pipeline.multisample_shader_builtin.sample_mask.write.*
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index d55f81e5d34..4d1ec789cc3 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -975,8 +975,12 @@ vtn_get_builtin_location(struct vtn_builder *b, set_mode_system_value(mode); break; case SpvBuiltInSampleMask: - *location = SYSTEM_VALUE_SAMPLE_MASK_IN; /* XXX out? */ - set_mode_system_value(mode); + if (*mode == nir_var_shader_out) { + *location = FRAG_RESULT_SAMPLE_MASK; + } else { + *location = SYSTEM_VALUE_SAMPLE_MASK_IN; + set_mode_system_value(mode); + } break; case SpvBuiltInFragDepth: *location = FRAG_RESULT_DEPTH; |