Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- include/vkd3d_shader.h | 3 +-- libs/vkd3d-shader/spirv.c | 5 +++-- libs/vkd3d-shader/vkd3d_shader_main.c | 13 +++---------- libs/vkd3d-shader/vkd3d_shader_private.h | 2 +- libs/vkd3d/state.c | 4 ++-- programs/vkd3d-compiler/main.c | 2 +- tests/vkd3d_shader_api.c | 4 ++-- 7 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index ec449bb..5dd5d93 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -179,6 +179,7 @@ struct vkd3d_shader_push_constant_buffer unsigned int size; /* in bytes */ };
+/* Extends vkd3d_shader_compile_info. */ struct vkd3d_shader_interface_info { enum vkd3d_shader_structure_type type; @@ -644,7 +645,6 @@ struct vkd3d_shader_signature
int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *spirv, unsigned int compiler_options, - const struct vkd3d_shader_interface_info *shader_interface_info, const struct vkd3d_shader_spirv_target_info *target_info); void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code);
@@ -676,7 +676,6 @@ void vkd3d_shader_free_shader_signature(struct vkd3d_shader_signature *signature */ typedef int (*PFN_vkd3d_shader_compile_dxbc)(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *spirv, unsigned int compiler_options, - const struct vkd3d_shader_interface_info *shader_interface_info, const struct vkd3d_shader_spirv_target_info *target_info); typedef void (*PFN_vkd3d_shader_free_shader_code)(struct vkd3d_shader_code *code);
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 3f6d526..76ec221 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2124,12 +2124,13 @@ static void vkd3d_dxbc_compiler_emit_initial_declarations(struct vkd3d_dxbc_comp
struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader_version *shader_version, const struct vkd3d_shader_desc *shader_desc, uint32_t compiler_options, - const struct vkd3d_shader_interface_info *shader_interface, + const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_spirv_target_info *target_info, const struct vkd3d_shader_scan_info *scan_info) { const struct vkd3d_shader_signature *patch_constant_signature = &shader_desc->patch_constant_signature; const struct vkd3d_shader_signature *output_signature = &shader_desc->output_signature; + const struct vkd3d_shader_interface_info *shader_interface; struct vkd3d_dxbc_compiler *compiler; unsigned int max_element_count; unsigned int i; @@ -2157,7 +2158,7 @@ struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader compiler->output_signature = &shader_desc->output_signature; compiler->patch_constant_signature = &shader_desc->patch_constant_signature;
- if (shader_interface) + if ((shader_interface = vkd3d_find_struct(compile_info->next, INTERFACE_INFO))) { compiler->xfb_info = vkd3d_find_struct(shader_interface->next, TRANSFORM_FEEDBACK_INFO);
diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 3d8829e..f11b3fc 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -129,7 +129,6 @@ static int vkd3d_shader_validate_spirv_target_info(const struct vkd3d_shader_spi
int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *spirv, unsigned int compiler_options, - const struct vkd3d_shader_interface_info *shader_interface_info, const struct vkd3d_shader_spirv_target_info *info) { struct vkd3d_shader_instruction instruction; @@ -138,8 +137,8 @@ int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_compile_info *compile_in struct vkd3d_shader_parser parser; int ret;
- TRACE("compile_info %p, spirv %p, compiler_options %#x, shader_interface_info %p, info %p.\n", - compile_info, spirv, compiler_options, shader_interface_info, info); + TRACE("compile_info %p, spirv %p, compiler_options %#x, info %p.\n", + compile_info, spirv, compiler_options, info);
if (compile_info->type != VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO) { @@ -147,12 +146,6 @@ int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_compile_info *compile_in return VKD3D_ERROR_INVALID_ARGUMENT; }
- if (shader_interface_info && shader_interface_info->type != VKD3D_SHADER_STRUCTURE_TYPE_INTERFACE_INFO) - { - WARN("Invalid structure type %#x.\n", shader_interface_info->type); - return VKD3D_ERROR_INVALID_ARGUMENT; - } - if ((ret = vkd3d_shader_validate_spirv_target_info(info)) < 0) return ret;
@@ -170,7 +163,7 @@ int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_compile_info *compile_in vkd3d_shader_trace(parser.data);
if (!(spirv_compiler = vkd3d_dxbc_compiler_create(&parser.shader_version, - &parser.shader_desc, compiler_options, shader_interface_info, info, &scan_info))) + &parser.shader_desc, compiler_options, compile_info, info, &scan_info))) { ERR("Failed to create DXBC compiler.\n"); vkd3d_shader_parser_destroy(&parser); diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index a98eda6..8dd76fa 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -821,7 +821,7 @@ struct vkd3d_dxbc_compiler;
struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader_version *shader_version, const struct vkd3d_shader_desc *shader_desc, uint32_t compiler_options, - const struct vkd3d_shader_interface_info *shader_interface_info, + const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_spirv_target_info *target_info, const struct vkd3d_shader_scan_info *scan_info) DECLSPEC_HIDDEN; int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index fe44097..1f60941 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1348,11 +1348,11 @@ static HRESULT create_shader_stage(struct d3d12_device *device, shader_desc.flags = 0;
compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO; - compile_info.next = NULL; + compile_info.next = shader_interface; compile_info.source.code = code->pShaderBytecode; compile_info.source.size = code->BytecodeLength;
- if ((ret = vkd3d_shader_compile_dxbc(&compile_info, &spirv, 0, shader_interface, target_info)) < 0) + if ((ret = vkd3d_shader_compile_dxbc(&compile_info, &spirv, 0, target_info)) < 0) { WARN("Failed to compile shader, vkd3d result %d.\n", ret); return hresult_from_vkd3d_result(ret); diff --git a/programs/vkd3d-compiler/main.c b/programs/vkd3d-compiler/main.c index 7e73ab0..0cab836 100644 --- a/programs/vkd3d-compiler/main.c +++ b/programs/vkd3d-compiler/main.c @@ -168,7 +168,7 @@ int main(int argc, char **argv) return 1; }
- ret = vkd3d_shader_compile_dxbc(&info, &spirv, options.compiler_options, NULL, NULL); + ret = vkd3d_shader_compile_dxbc(&info, &spirv, options.compiler_options, NULL); vkd3d_shader_free_shader_code(&info.source); if (ret < 0) { diff --git a/tests/vkd3d_shader_api.c b/tests/vkd3d_shader_api.c index 8c9732c..4d5e7c1 100644 --- a/tests/vkd3d_shader_api.c +++ b/tests/vkd3d_shader_api.c @@ -55,7 +55,7 @@ static void test_invalid_shaders(void) info.source.code = ps_break_code; info.source.size = sizeof(ps_break_code);
- rc = vkd3d_shader_compile_dxbc(&info, &spirv, VKD3D_SHADER_STRIP_DEBUG, NULL, NULL); + rc = vkd3d_shader_compile_dxbc(&info, &spirv, VKD3D_SHADER_STRIP_DEBUG, NULL); ok(rc == VKD3D_ERROR_INVALID_SHADER, "Got unexpected error code %d.\n", rc); }
@@ -128,7 +128,7 @@ static void test_vkd3d_shader_pfns(void) compile_info.next = NULL; compile_info.source = vs;
- rc = pfn_vkd3d_shader_compile_dxbc(&compile_info, &spirv, 0, NULL, NULL); + rc = pfn_vkd3d_shader_compile_dxbc(&compile_info, &spirv, 0, NULL); ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc); pfn_vkd3d_shader_free_shader_code(&spirv);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=73758
Your paranoid android.
=== debiant (build log) ===
Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply