vkd3d-shader: Hook up EMIT_THEN_CUT_STREAM

Still needs work to handle emitting a specific stream.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2020-10-20 07:15:44 +01:00
parent 991341094b
commit f0865163cb
4 changed files with 6 additions and 2 deletions

View File

@ -1163,6 +1163,7 @@ static const struct vkd3d_sm4_opcode_info opcode_table[] =
{VKD3D_SM5_OP_HS_JOIN_PHASE, VKD3DSIH_HS_JOIN_PHASE, "", ""},
{VKD3D_SM5_OP_EMIT_STREAM, VKD3DSIH_EMIT_STREAM, "", "f"},
{VKD3D_SM5_OP_CUT_STREAM, VKD3DSIH_CUT_STREAM, "", "f"},
{VKD3D_SM5_OP_EMIT_THEN_CUT_STREAM, VKD3DSIH_EMIT_THEN_CUT_STREAM, "", "f"},
{VKD3D_SM5_OP_FCALL, VKD3DSIH_FCALL, "", "O",
shader_sm5_read_fcall},
{VKD3D_SM5_OP_BUFINFO, VKD3DSIH_BUFINFO, "i", "U"},

View File

@ -9245,7 +9245,7 @@ static void vkd3d_dxbc_compiler_emit_emit_stream(struct vkd3d_dxbc_compiler *com
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
unsigned int stream_idx;
if (instruction->handler_idx == VKD3DSIH_EMIT_STREAM)
if (instruction->handler_idx == VKD3DSIH_EMIT_STREAM || instruction->handler_idx == VKD3DSIH_EMIT_THEN_CUT_STREAM)
stream_idx = instruction->src[0].reg.idx[0].offset;
else
stream_idx = 0;
@ -9266,7 +9266,7 @@ static void vkd3d_dxbc_compiler_emit_cut_stream(struct vkd3d_dxbc_compiler *comp
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
unsigned int stream_idx;
if (instruction->handler_idx == VKD3DSIH_CUT_STREAM)
if (instruction->handler_idx == VKD3DSIH_CUT_STREAM || instruction->handler_idx == VKD3DSIH_EMIT_THEN_CUT_STREAM)
stream_idx = instruction->src[0].reg.idx[0].offset;
else
stream_idx = 0;
@ -9650,6 +9650,7 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler,
vkd3d_dxbc_compiler_emit_emit_stream(compiler, instruction);
break;
case VKD3DSIH_EMIT_THEN_CUT:
case VKD3DSIH_EMIT_THEN_CUT_STREAM:
vkd3d_dxbc_compiler_emit_emit_stream(compiler, instruction);
vkd3d_dxbc_compiler_emit_cut_stream(compiler, instruction);
break;

View File

@ -119,6 +119,7 @@ static const char * const shader_opcode_names[] =
/* VKD3DSIH_EMIT */ "emit",
/* VKD3DSIH_EMIT_THEN_CUT */ "emit_then_cut",
/* VKD3DSIH_EMIT_STREAM */ "emit_stream",
/* VKD3DSIH_EMIT_THEN_CUT_STREAM */ "emit_then_cut_stream",
/* VKD3DSIH_ENDIF */ "endif",
/* VKD3DSIH_ENDLOOP */ "endloop",
/* VKD3DSIH_ENDSWITCH */ "endswitch",

View File

@ -142,6 +142,7 @@ enum VKD3D_SHADER_INSTRUCTION_HANDLER
VKD3DSIH_EMIT,
VKD3DSIH_EMIT_THEN_CUT,
VKD3DSIH_EMIT_STREAM,
VKD3DSIH_EMIT_THEN_CUT_STREAM,
VKD3DSIH_ENDIF,
VKD3DSIH_ENDLOOP,
VKD3DSIH_ENDSWITCH,