vkd3d-shader: Introduce struct vkd3d_shader_compile_info.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet
2020-06-19 16:13:32 +04:30
committed by Alexandre Julliard
parent 13c2fbdc8d
commit 8ff9610fed
5 changed files with 51 additions and 17 deletions

View File

@@ -23,6 +23,7 @@
static void test_invalid_shaders(void)
{
struct vkd3d_shader_compile_info info;
struct vkd3d_shader_code spirv;
int rc;
@@ -48,9 +49,13 @@ static void test_invalid_shaders(void)
0x3f800000, 0x3f800000, 0x3f800000, 0x01000002, 0x01000015, 0x08000036, 0x001020f2, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e,
};
static const struct vkd3d_shader_code ps_break = {ps_break_code, sizeof(ps_break_code)};
rc = vkd3d_shader_compile_dxbc(&ps_break, &spirv, VKD3D_SHADER_STRIP_DEBUG, NULL, NULL);
info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
info.next = NULL;
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);
ok(rc == VKD3D_ERROR_INVALID_SHADER, "Got unexpected error code %d.\n", rc);
}
@@ -68,6 +73,7 @@ static void test_vkd3d_shader_pfns(void)
struct vkd3d_versioned_root_signature_desc root_signature_desc;
struct vkd3d_shader_signature_element *element;
struct vkd3d_shader_compile_info compile_info;
struct vkd3d_shader_scan_info scan_info;
struct vkd3d_shader_signature signature;
struct vkd3d_shader_code dxbc, spirv;
@@ -118,7 +124,11 @@ static void test_vkd3d_shader_pfns(void)
ok(element, "Could not find shader signature element.\n");
pfn_vkd3d_shader_free_shader_signature(&signature);
rc = pfn_vkd3d_shader_compile_dxbc(&vs, &spirv, 0, NULL, NULL);
compile_info.type = VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO;
compile_info.next = NULL;
compile_info.source = vs;
rc = pfn_vkd3d_shader_compile_dxbc(&compile_info, &spirv, 0, NULL, NULL);
ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc);
pfn_vkd3d_shader_free_shader_code(&spirv);