mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
vkd3d-shader/spirv: Pass a struct vsir_program to spirv_compile().
This commit is contained in:
parent
e21215f466
commit
f948520504
Notes:
Alexandre Julliard
2024-05-02 22:40:50 +02: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/844
@ -10368,17 +10368,16 @@ static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, struct
|
||||
return VKD3D_OK;
|
||||
}
|
||||
|
||||
int spirv_compile(struct vkd3d_shader_parser *parser,
|
||||
int spirv_compile(struct vsir_program *program, uint64_t config_flags,
|
||||
const struct vkd3d_shader_scan_descriptor_info1 *scan_descriptor_info,
|
||||
const struct vkd3d_shader_compile_info *compile_info,
|
||||
struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context)
|
||||
{
|
||||
struct vsir_program *program = &parser->program;
|
||||
struct spirv_compiler *spirv_compiler;
|
||||
int ret;
|
||||
|
||||
if (!(spirv_compiler = spirv_compiler_create(program, compile_info,
|
||||
scan_descriptor_info, message_context, parser->config_flags)))
|
||||
scan_descriptor_info, message_context, config_flags)))
|
||||
{
|
||||
ERR("Failed to create SPIR-V compiler.\n");
|
||||
return VKD3D_ERROR;
|
||||
|
@ -1563,6 +1563,7 @@ int vkd3d_shader_parser_compile(struct vkd3d_shader_parser *parser,
|
||||
{
|
||||
struct vkd3d_shader_scan_descriptor_info1 scan_descriptor_info;
|
||||
struct vsir_program *program = &parser->program;
|
||||
uint64_t config_flags = parser->config_flags;
|
||||
struct vkd3d_shader_compile_info scan_info;
|
||||
int ret;
|
||||
|
||||
@ -1577,7 +1578,7 @@ int vkd3d_shader_parser_compile(struct vkd3d_shader_parser *parser,
|
||||
case VKD3D_SHADER_TARGET_GLSL:
|
||||
if ((ret = scan_with_parser(&scan_info, message_context, &scan_descriptor_info, parser)) < 0)
|
||||
return ret;
|
||||
ret = glsl_compile(program, parser->config_flags, compile_info, out, message_context);
|
||||
ret = glsl_compile(program, config_flags, compile_info, out, message_context);
|
||||
vkd3d_shader_free_scan_descriptor_info1(&scan_descriptor_info);
|
||||
break;
|
||||
|
||||
@ -1585,7 +1586,8 @@ int vkd3d_shader_parser_compile(struct vkd3d_shader_parser *parser,
|
||||
case VKD3D_SHADER_TARGET_SPIRV_TEXT:
|
||||
if ((ret = scan_with_parser(&scan_info, message_context, &scan_descriptor_info, parser)) < 0)
|
||||
return ret;
|
||||
ret = spirv_compile(parser, &scan_descriptor_info, compile_info, out, message_context);
|
||||
ret = spirv_compile(program, config_flags, &scan_descriptor_info,
|
||||
compile_info, out, message_context);
|
||||
vkd3d_shader_free_scan_descriptor_info1(&scan_descriptor_info);
|
||||
break;
|
||||
|
||||
|
@ -1555,7 +1555,7 @@ int glsl_compile(struct vsir_program *program, uint64_t config_flags,
|
||||
|
||||
#define SPIRV_MAX_SRC_COUNT 6
|
||||
|
||||
int spirv_compile(struct vkd3d_shader_parser *parser,
|
||||
int spirv_compile(struct vsir_program *program, uint64_t config_flags,
|
||||
const struct vkd3d_shader_scan_descriptor_info1 *scan_descriptor_info,
|
||||
const struct vkd3d_shader_compile_info *compile_info,
|
||||
struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context);
|
||||
|
Loading…
Reference in New Issue
Block a user