mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07: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)
|
static enum vkd3d_result shader_normalise_io_registers(struct vkd3d_shader_parser *parser)
|
||||||
{
|
{
|
||||||
struct io_normaliser normaliser = {parser->program.instructions};
|
struct io_normaliser normaliser = {parser->program.instructions};
|
||||||
|
struct vsir_program *program = &parser->program;
|
||||||
struct vkd3d_shader_instruction *ins;
|
struct vkd3d_shader_instruction *ins;
|
||||||
bool has_control_point_phase;
|
bool has_control_point_phase;
|
||||||
unsigned int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
normaliser.phase = VKD3DSIH_INVALID;
|
normaliser.phase = VKD3DSIH_INVALID;
|
||||||
normaliser.shader_type = parser->program.shader_version.type;
|
normaliser.shader_type = program->shader_version.type;
|
||||||
normaliser.major = parser->program.shader_version.major;
|
normaliser.major = program->shader_version.major;
|
||||||
normaliser.input_signature = &parser->shader_desc.input_signature;
|
normaliser.input_signature = &parser->shader_desc.input_signature;
|
||||||
normaliser.output_signature = &parser->shader_desc.output_signature;
|
normaliser.output_signature = &parser->shader_desc.output_signature;
|
||||||
normaliser.patch_constant_signature = &parser->shader_desc.patch_constant_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)
|
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.output_signature, normaliser.output_range_map, false)
|
||||||
|| !shader_signature_merge(&parser->shader_desc.patch_constant_signature, normaliser.pc_range_map, true))
|
|| !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;
|
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)
|
for (i = 0; i < normaliser.instructions.count; ++i)
|
||||||
shader_instruction_normalise_io_params(&normaliser.instructions.elements[i], &normaliser);
|
shader_instruction_normalise_io_params(&normaliser.instructions.elements[i], &normaliser);
|
||||||
|
|
||||||
parser->program.instructions = normaliser.instructions;
|
program->instructions = normaliser.instructions;
|
||||||
parser->shader_desc.use_vocp = normaliser.use_vocp;
|
program->use_vocp = normaliser.use_vocp;
|
||||||
return VKD3D_OK;
|
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_spirv_builder *builder = &compiler->spirv_builder;
|
||||||
struct vkd3d_shader_desc *shader_desc = &parser->shader_desc;
|
struct vkd3d_shader_desc *shader_desc = &parser->shader_desc;
|
||||||
struct vkd3d_shader_instruction_array instructions;
|
struct vkd3d_shader_instruction_array instructions;
|
||||||
|
struct vsir_program *program = &parser->program;
|
||||||
enum vkd3d_result result = VKD3D_OK;
|
enum vkd3d_result result = VKD3D_OK;
|
||||||
unsigned int i;
|
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))
|
if (parser->shader_desc.block_count && !spirv_compiler_init_blocks(compiler, parser->shader_desc.block_count))
|
||||||
return VKD3D_ERROR_OUT_OF_MEMORY;
|
return VKD3D_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
instructions = parser->program.instructions;
|
instructions = program->instructions;
|
||||||
memset(&parser->program.instructions, 0, sizeof(parser->program.instructions));
|
memset(&program->instructions, 0, sizeof(program->instructions));
|
||||||
|
|
||||||
compiler->input_signature = shader_desc->input_signature;
|
compiler->input_signature = shader_desc->input_signature;
|
||||||
compiler->output_signature = shader_desc->output_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->input_signature, 0, sizeof(shader_desc->input_signature));
|
||||||
memset(&shader_desc->output_signature, 0, sizeof(shader_desc->output_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));
|
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_names = parser->shader_desc.block_names;
|
||||||
compiler->block_name_count = parser->shader_desc.block_name_count;
|
compiler->block_name_count = parser->shader_desc.block_name_count;
|
||||||
|
|
||||||
|
@ -1031,8 +1031,6 @@ struct vkd3d_shader_desc
|
|||||||
uint32_t used, external;
|
uint32_t used, external;
|
||||||
} flat_constant_count[3];
|
} flat_constant_count[3];
|
||||||
|
|
||||||
bool use_vocp;
|
|
||||||
|
|
||||||
const char **block_names;
|
const char **block_names;
|
||||||
size_t block_name_count;
|
size_t block_name_count;
|
||||||
};
|
};
|
||||||
@ -1274,6 +1272,8 @@ struct vsir_program
|
|||||||
{
|
{
|
||||||
struct vkd3d_shader_version shader_version;
|
struct vkd3d_shader_version shader_version;
|
||||||
struct vkd3d_shader_instruction_array instructions;
|
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);
|
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