summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-05-17 11:32:10 -0500
committerJason Ekstrand <[email protected]>2019-06-04 17:30:51 +0000
commit517680547163e423732ce0d8be69ac7b2000c484 (patch)
treeaa61dd019ea72fc061e4ec95ebca052e9dfc5b4c /src/compiler
parentb5aa76b1dfa9a56be04f50522fa574af66f00164 (diff)
spirv: Implement SPV_EXT_fragment_shader_interlock
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/shader_info.h2
-rw-r--r--src/compiler/spirv/spirv_to_nir.c36
2 files changed, 38 insertions, 0 deletions
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index 166ff8dec4e..32d87b234ec 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -42,6 +42,8 @@ struct spirv_supported_capabilities {
bool device_group;
bool draw_parameters;
bool float64;
+ bool fragment_shader_sample_interlock;
+ bool fragment_shader_pixel_interlock;
bool geometry_streams;
bool gcn_shader;
bool image_ms_array;
diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index 613a4e876a8..fdcc9fdb96b 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -3744,6 +3744,14 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
spv_check_supported(float16, cap);
break;
+ case SpvCapabilityFragmentShaderSampleInterlockEXT:
+ spv_check_supported(fragment_shader_sample_interlock, cap);
+ break;
+
+ case SpvCapabilityFragmentShaderPixelInterlockEXT:
+ spv_check_supported(fragment_shader_pixel_interlock, cap);
+ break;
+
default:
vtn_fail("Unhandled capability: %s (%u)",
spirv_capability_to_string(cap), cap);
@@ -4000,6 +4008,26 @@ vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point,
b->shader->info.cs.derivative_group = DERIVATIVE_GROUP_LINEAR;
break;
+ case SpvExecutionModePixelInterlockOrderedEXT:
+ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT);
+ b->shader->info.fs.pixel_interlock_ordered = true;
+ break;
+
+ case SpvExecutionModePixelInterlockUnorderedEXT:
+ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT);
+ b->shader->info.fs.pixel_interlock_unordered = true;
+ break;
+
+ case SpvExecutionModeSampleInterlockOrderedEXT:
+ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT);
+ b->shader->info.fs.sample_interlock_ordered = true;
+ break;
+
+ case SpvExecutionModeSampleInterlockUnorderedEXT:
+ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT);
+ b->shader->info.fs.sample_interlock_unordered = true;
+ break;
+
default:
vtn_fail("Unhandled execution mode: %s (%u)",
spirv_executionmode_to_string(mode->exec_mode),
@@ -4505,6 +4533,14 @@ vtn_handle_body_instruction(struct vtn_builder *b, SpvOp opcode,
vtn_handle_ptr(b, opcode, w, count);
break;
+ case SpvOpBeginInvocationInterlockEXT:
+ vtn_emit_barrier(b, nir_intrinsic_begin_invocation_interlock);
+ break;
+
+ case SpvOpEndInvocationInterlockEXT:
+ vtn_emit_barrier(b, nir_intrinsic_end_invocation_interlock);
+ break;
+
default:
vtn_fail_with_opcode("Unhandled opcode", opcode);
}