mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
libs/vkd3d-shader: Translate dcl_output_topology instructions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fb67ccd159
commit
31ec7b9160
@ -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,
|
||||
};
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user