Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/vkd3d-proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ashton <joshua@froggi.es>2020-10-20 09:15:44 +0300
committerJoshua Ashton <joshua@froggi.es>2020-10-21 09:16:40 +0300
commit51c8d8bdbad93120641617d87f7e4bcdd6c3cdc7 (patch)
treece251e63abf696855b74d53e9b800489d7838f13
parent9a878c0194d83a2a54a8e2a3f27aaa7e44910eb5 (diff)
vkd3d-shader: Hook up EMIT_THEN_CUT_STREAMimplement-missing-ops
Still needs work to handle emitting a specific stream. Signed-off-by: Joshua Ashton <joshua@froggi.es>
-rw-r--r--libs/vkd3d-shader/dxbc.c1
-rw-r--r--libs/vkd3d-shader/spirv.c5
-rw-r--r--libs/vkd3d-shader/trace.c1
-rw-r--r--libs/vkd3d-shader/vkd3d_shader_private.h1
4 files changed, 6 insertions, 2 deletions
diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c
index d1f0c925..ad0230dd 100644
--- a/libs/vkd3d-shader/dxbc.c
+++ b/libs/vkd3d-shader/dxbc.c
@@ -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"},
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index c91faca6..320c157b 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -9233,7 +9233,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;
@@ -9254,7 +9254,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;
@@ -9638,6 +9638,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;
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index 0b417e50..5e598ea9 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -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",
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 1fb9b7c6..a24d5314 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -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,