mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/ir: Store the "use_vocp" field in struct vsir_program.
This commit is contained in:
parent
23dcd4f22b
commit
7b85cd6a31
Notes:
Alexandre Julliard
2024-01-22 22:53:09 +01:00
Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/585
@ -1241,20 +1241,21 @@ static void shader_instruction_normalise_io_params(struct vkd3d_shader_instructi
|
||||
static enum vkd3d_result shader_normalise_io_registers(struct vkd3d_shader_parser *parser)
|
||||
{
|
||||
struct io_normaliser normaliser = {parser->program.instructions};
|
||||
struct vsir_program *program = &parser->program;
|
||||
struct vkd3d_shader_instruction *ins;
|
||||
bool has_control_point_phase;
|
||||
unsigned int i, j;
|
||||
|
||||
normaliser.phase = VKD3DSIH_INVALID;
|
||||
normaliser.shader_type = parser->program.shader_version.type;
|
||||
normaliser.major = parser->program.shader_version.major;
|
||||
normaliser.shader_type = program->shader_version.type;
|
||||
normaliser.major = program->shader_version.major;
|
||||
normaliser.input_signature = &parser->shader_desc.input_signature;
|
||||
normaliser.output_signature = &parser->shader_desc.output_signature;
|
||||
normaliser.patch_constant_signature = &parser->shader_desc.patch_constant_signature;
|
||||
|
||||
for (i = 0, has_control_point_phase = false; i < parser->program.instructions.count; ++i)
|
||||
for (i = 0, has_control_point_phase = false; i < program->instructions.count; ++i)
|
||||
{
|
||||
ins = &parser->program.instructions.elements[i];
|
||||
ins = &program->instructions.elements[i];
|
||||
|
||||
switch (ins->handler_idx)
|
||||
{
|
||||
@ -1297,7 +1298,7 @@ static enum vkd3d_result shader_normalise_io_registers(struct vkd3d_shader_parse
|
||||
|| !shader_signature_merge(&parser->shader_desc.output_signature, normaliser.output_range_map, false)
|
||||
|| !shader_signature_merge(&parser->shader_desc.patch_constant_signature, normaliser.pc_range_map, true))
|
||||
{
|
||||
parser->program.instructions = normaliser.instructions;
|
||||
program->instructions = normaliser.instructions;
|
||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
@ -1305,8 +1306,8 @@ static enum vkd3d_result shader_normalise_io_registers(struct vkd3d_shader_parse
|
||||
for (i = 0; i < normaliser.instructions.count; ++i)
|
||||
shader_instruction_normalise_io_params(&normaliser.instructions.elements[i], &normaliser);
|
||||
|
||||
parser->program.instructions = normaliser.instructions;
|
||||
parser->shader_desc.use_vocp = normaliser.use_vocp;
|
||||
program->instructions = normaliser.instructions;
|
||||
program->use_vocp = normaliser.use_vocp;
|
||||
return VKD3D_OK;
|
||||
}
|
||||
|
||||
|
@ -9680,6 +9680,7 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
|
||||
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
|
||||
struct vkd3d_shader_desc *shader_desc = &parser->shader_desc;
|
||||
struct vkd3d_shader_instruction_array instructions;
|
||||
struct vsir_program *program = &parser->program;
|
||||
enum vkd3d_result result = VKD3D_OK;
|
||||
unsigned int i;
|
||||
|
||||
@ -9699,8 +9700,8 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
|
||||
if (parser->shader_desc.block_count && !spirv_compiler_init_blocks(compiler, parser->shader_desc.block_count))
|
||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
instructions = parser->program.instructions;
|
||||
memset(&parser->program.instructions, 0, sizeof(parser->program.instructions));
|
||||
instructions = program->instructions;
|
||||
memset(&program->instructions, 0, sizeof(program->instructions));
|
||||
|
||||
compiler->input_signature = shader_desc->input_signature;
|
||||
compiler->output_signature = shader_desc->output_signature;
|
||||
@ -9708,7 +9709,7 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
|
||||
memset(&shader_desc->input_signature, 0, sizeof(shader_desc->input_signature));
|
||||
memset(&shader_desc->output_signature, 0, sizeof(shader_desc->output_signature));
|
||||
memset(&shader_desc->patch_constant_signature, 0, sizeof(shader_desc->patch_constant_signature));
|
||||
compiler->use_vocp = parser->shader_desc.use_vocp;
|
||||
compiler->use_vocp = program->use_vocp;
|
||||
compiler->block_names = parser->shader_desc.block_names;
|
||||
compiler->block_name_count = parser->shader_desc.block_name_count;
|
||||
|
||||
|
@ -1031,8 +1031,6 @@ struct vkd3d_shader_desc
|
||||
uint32_t used, external;
|
||||
} flat_constant_count[3];
|
||||
|
||||
bool use_vocp;
|
||||
|
||||
const char **block_names;
|
||||
size_t block_name_count;
|
||||
};
|
||||
@ -1274,6 +1272,8 @@ struct vsir_program
|
||||
{
|
||||
struct vkd3d_shader_version shader_version;
|
||||
struct vkd3d_shader_instruction_array instructions;
|
||||
|
||||
bool use_vocp;
|
||||
};
|
||||
|
||||
bool vsir_program_init(struct vsir_program *program, const struct vkd3d_shader_version *version, unsigned int reserve);
|
||||
|
Loading…
x
Reference in New Issue
Block a user