vkd3d-shader/ir: Pass a struct vsir_program to vkd3d_shader_normalise().

This commit is contained in:
Henri Verbeet 2024-03-13 14:52:34 +01:00 committed by Alexandre Julliard
parent 0715734dfb
commit 5de5f241a6
Notes: Alexandre Julliard 2024-03-19 23:18:03 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/731
3 changed files with 7 additions and 9 deletions

View File

@ -4393,11 +4393,9 @@ fail:
return ret;
}
enum vkd3d_result vkd3d_shader_normalise(struct vkd3d_shader_parser *parser,
const struct vkd3d_shader_compile_info *compile_info)
enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t config_flags,
const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context)
{
struct vkd3d_shader_message_context *message_context = parser->message_context;
struct vsir_program *program = &parser->program;
enum vkd3d_result result = VKD3D_OK;
remove_dcl_temps(program);
@ -4488,7 +4486,7 @@ enum vkd3d_result vkd3d_shader_normalise(struct vkd3d_shader_parser *parser,
if (TRACE_ON())
vkd3d_shader_trace(program);
if ((result = vsir_program_validate(program, parser->config_flags,
if ((result = vsir_program_validate(program, config_flags,
compile_info->source_name, message_context)) < 0)
return result;

View File

@ -10133,7 +10133,8 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler,
enum vkd3d_result result = VKD3D_OK;
unsigned int i;
if ((result = vkd3d_shader_normalise(parser, compile_info)) < 0)
if ((result = vsir_program_normalise(program, compiler->config_flags,
compile_info, compiler->message_context)) < 0)
return result;
if (program->temp_count)

View File

@ -1321,6 +1321,8 @@ struct vsir_program
bool vsir_program_init(struct vsir_program *program, const struct vkd3d_shader_version *version, unsigned int reserve);
void vsir_program_cleanup(struct vsir_program *program);
enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t config_flags,
const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context);
enum vkd3d_result vsir_program_validate(struct vsir_program *program, uint64_t config_flags,
const char *source_name, struct vkd3d_shader_message_context *message_context);
@ -1784,7 +1786,4 @@ void dxbc_writer_add_section(struct dxbc_writer *dxbc, uint32_t tag, const void
void dxbc_writer_init(struct dxbc_writer *dxbc);
int dxbc_writer_write(struct dxbc_writer *dxbc, struct vkd3d_shader_code *code);
enum vkd3d_result vkd3d_shader_normalise(struct vkd3d_shader_parser *parser,
const struct vkd3d_shader_compile_info *compile_info);
#endif /* __VKD3D_SHADER_PRIVATE_H */