vkd3d-shader/ir: Store control point counts in struct vsir_program.

This commit is contained in:
Henri Verbeet 2024-01-17 21:35:22 +01:00 committed by Alexandre Julliard
parent e4cc4a336e
commit 98c6e85b33
Notes: Alexandre Julliard 2024-01-23 23:05:46 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/594
3 changed files with 7 additions and 8 deletions

View File

@ -9806,8 +9806,8 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
compiler->block_names = parser->shader_desc.block_names;
compiler->block_name_count = parser->shader_desc.block_name_count;
compiler->input_control_point_count = shader_desc->input_control_point_count;
compiler->output_control_point_count = shader_desc->output_control_point_count;
compiler->input_control_point_count = program->input_control_point_count;
compiler->output_control_point_count = program->output_control_point_count;
if (compiler->shader_type != VKD3D_SHADER_TYPE_HULL)
spirv_compiler_emit_shader_signature_outputs(compiler);

View File

@ -1051,7 +1051,7 @@ static void shader_sm4_read_dcl_input_primitive(struct vkd3d_shader_instruction
{
ins->declaration.primitive_type.type = VKD3D_PT_PATCH;
ins->declaration.primitive_type.patch_vertex_count = primitive_type - VKD3D_SM5_INPUT_PT_PATCH1 + 1;
priv->p.shader_desc.input_control_point_count = ins->declaration.primitive_type.patch_vertex_count;
priv->p.program.input_control_point_count = ins->declaration.primitive_type.patch_vertex_count;
}
else if (primitive_type >= ARRAY_SIZE(input_primitive_type_table))
{
@ -1060,7 +1060,7 @@ static void shader_sm4_read_dcl_input_primitive(struct vkd3d_shader_instruction
else
{
ins->declaration.primitive_type.type = input_primitive_type_table[primitive_type].vkd3d_type;
priv->p.shader_desc.input_control_point_count = input_primitive_type_table[primitive_type].control_point_count;
priv->p.program.input_control_point_count = input_primitive_type_table[primitive_type].control_point_count;
}
if (ins->declaration.primitive_type.type == VKD3D_PT_UNDEFINED)
@ -1174,9 +1174,9 @@ static void shader_sm5_read_control_point_count(struct vkd3d_shader_instruction
>> VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT;
if (opcode == VKD3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT)
priv->p.shader_desc.input_control_point_count = ins->declaration.count;
priv->p.program.input_control_point_count = ins->declaration.count;
else
priv->p.shader_desc.output_control_point_count = ins->declaration.count;
priv->p.program.output_control_point_count = ins->declaration.count;
}
static void shader_sm5_read_dcl_tessellator_domain(struct vkd3d_shader_instruction *ins, uint32_t opcode,

View File

@ -1020,8 +1020,6 @@ struct vkd3d_shader_desc
struct shader_signature output_signature;
struct shader_signature patch_constant_signature;
unsigned int input_control_point_count, output_control_point_count;
unsigned int block_count;
struct
@ -1271,6 +1269,7 @@ struct vsir_program
struct vkd3d_shader_version shader_version;
struct vkd3d_shader_instruction_array instructions;
unsigned int input_control_point_count, output_control_point_count;
unsigned int temp_count;
unsigned int ssa_count;
bool use_vocp;