diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 9be0e79c..6aa2ffad 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -333,7 +333,7 @@ enum vkd3d_sm4_register_type enum vkd3d_sm4_output_primitive_type { VKD3D_SM4_OUTPUT_PT_POINTLIST = 0x1, - VKD3D_SM4_OUTPUT_PT_LINELIST = 0x3, + VKD3D_SM4_OUTPUT_PT_LINESTRIP = 0x3, VKD3D_SM4_OUTPUT_PT_TRIANGLESTRIP = 0x5, }; @@ -462,7 +462,7 @@ static const enum vkd3d_primitive_type output_primitive_type_table[] = /* UNKNOWN */ VKD3D_PT_UNDEFINED, /* VKD3D_SM4_OUTPUT_PT_POINTLIST */ VKD3D_PT_POINTLIST, /* UNKNOWN */ VKD3D_PT_UNDEFINED, - /* VKD3D_SM4_OUTPUT_PT_LINELIST */ VKD3D_PT_LINELIST, + /* VKD3D_SM4_OUTPUT_PT_LINESTRIP */ VKD3D_PT_LINESTRIP, /* UNKNOWN */ VKD3D_PT_UNDEFINED, /* VKD3D_SM4_OUTPUT_PT_TRIANGLESTRIP */ VKD3D_PT_TRIANGLESTRIP, }; diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 6a56ede9..87121898 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3575,6 +3575,31 @@ static void vkd3d_dxbc_compiler_emit_dcl_vertices_out(struct vkd3d_dxbc_compiler SpvExecutionModeOutputVertices, instruction->declaration.count); } +static void vkd3d_dxbc_compiler_emit_dcl_output_topology(struct vkd3d_dxbc_compiler *compiler, + const struct vkd3d_shader_instruction *instruction) +{ + enum vkd3d_primitive_type primitive_type = instruction->declaration.primitive_type.type; + SpvExecutionMode mode; + + switch (primitive_type) + { + case VKD3D_PT_POINTLIST: + mode = SpvExecutionModeOutputPoints; + break; + case VKD3D_PT_LINESTRIP: + mode = SpvExecutionModeOutputLineStrip; + break; + case VKD3D_PT_TRIANGLESTRIP: + mode = SpvExecutionModeOutputTriangleStrip; + break; + default: + ERR("Unexpected primitive type %#x.\n", primitive_type); + return; + } + + vkd3d_dxbc_compiler_emit_execution_mode(compiler, mode, NULL, 0); +} + static void vkd3d_dxbc_compiler_emit_dcl_thread_group(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_instruction *instruction) { @@ -5487,6 +5512,9 @@ void vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler case VKD3DSIH_DCL_VERTICES_OUT: vkd3d_dxbc_compiler_emit_dcl_vertices_out(compiler, instruction); break; + case VKD3DSIH_DCL_OUTPUT_TOPOLOGY: + vkd3d_dxbc_compiler_emit_dcl_output_topology(compiler, instruction); + break; case VKD3DSIH_DCL_THREAD_GROUP: vkd3d_dxbc_compiler_emit_dcl_thread_group(compiler, instruction); break;