From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d-shader/spirv.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index ca0beb8b95ae..ac638e9ca191 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1400,6 +1400,11 @@ static void vkd3d_spirv_build_op_emit_vertex(struct vkd3d_spirv_builder *builder return vkd3d_spirv_build_op(&builder->function_stream, SpvOpEmitVertex); }
+static void vkd3d_spirv_build_op_end_primitive(struct vkd3d_spirv_builder *builder) +{ + return vkd3d_spirv_build_op(&builder->function_stream, SpvOpEndPrimitive); +} + static void vkd3d_spirv_build_op_control_barrier(struct vkd3d_spirv_builder *builder, uint32_t execution_id, uint32_t memory_id, uint32_t memory_semantics_id) { @@ -5458,6 +5463,26 @@ static void vkd3d_dxbc_compiler_emit_emit_stream(struct vkd3d_dxbc_compiler *com vkd3d_spirv_build_op_emit_vertex(builder); }
+static void vkd3d_dxbc_compiler_emit_cut_stream(struct vkd3d_dxbc_compiler *compiler, + const struct vkd3d_shader_instruction *instruction) +{ + struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + unsigned int stream_idx; + + if (instruction->handler_idx == VKD3DSIH_CUT_STREAM) + stream_idx = instruction->src[0].reg.idx[0].offset; + else + stream_idx = 0; + + if (stream_idx) + { + FIXME("Multiple streams are not supported yet.\n"); + return; + } + + vkd3d_spirv_build_op_end_primitive(builder); +} + /* This function is called after declarations are processed. */ static void vkd3d_dxbc_compiler_emit_main_prolog(struct vkd3d_dxbc_compiler *compiler) { @@ -5720,6 +5745,10 @@ void vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler case VKD3DSIH_EMIT_STREAM: vkd3d_dxbc_compiler_emit_emit_stream(compiler, instruction); break; + case VKD3DSIH_CUT: + case VKD3DSIH_CUT_STREAM: + vkd3d_dxbc_compiler_emit_cut_stream(compiler, instruction); + break; case VKD3DSIH_NOP: break; default: