From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- include/vkd3d_shader.h | 10 ++-------- libs/vkd3d-shader/dxbc.c | 26 -------------------------- libs/vkd3d-shader/vkd3d_shader.map | 1 - tests/vkd3d_shader_api.c | 14 +++++++------- 4 files changed, 9 insertions(+), 42 deletions(-)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 7bf3bd5e4514..ae315e66d4db 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -566,13 +566,10 @@ int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_code *dxbc, const struct vkd3d_shader_compile_arguments *compile_args); void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code);
-int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, - struct vkd3d_root_signature_desc *root_signature); -void vkd3d_shader_free_root_signature(struct vkd3d_root_signature_desc *root_signature); - int vkd3d_shader_parse_versioned_root_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_versioned_root_signature_desc *root_signature); void vkd3d_shader_free_versioned_root_signature(struct vkd3d_versioned_root_signature_desc *root_signature); +void vkd3d_shader_free_root_signature(struct vkd3d_root_signature_desc *root_signature);
/* FIXME: Add support for returning error messages (ID3DBlob). */ int vkd3d_shader_serialize_root_signature(const struct vkd3d_root_signature_desc *root_signature, @@ -602,13 +599,10 @@ typedef int (*PFN_vkd3d_shader_compile_dxbc)(const struct vkd3d_shader_code *dxb const struct vkd3d_shader_compile_arguments *compile_args); typedef void (*PFN_vkd3d_shader_free_shader_code)(struct vkd3d_shader_code *code);
-typedef int (*PFN_vkd3d_shader_parse_root_signature)(const struct vkd3d_shader_code *dxbc, - struct vkd3d_root_signature_desc *root_signature); -typedef void (*PFN_vkd3d_shader_free_root_signature)(struct vkd3d_root_signature_desc *root_signature); - typedef int (*PFN_vkd3d_shader_parse_versioned_root_signature)(const struct vkd3d_shader_code *dxbc, struct vkd3d_versioned_root_signature_desc *root_signature); typedef void (*PFN_vkd3d_shader_free_versioned_root_signature)(struct vkd3d_versioned_root_signature_desc *root_signature); +typedef void (*PFN_vkd3d_shader_free_root_signature)(struct vkd3d_root_signature_desc *root_signature);
typedef int (*PFN_vkd3d_shader_serialize_root_signature)(const struct vkd3d_root_signature_desc *root_signature, enum vkd3d_root_signature_version version, struct vkd3d_shader_code *dxbc); diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 082e01d47ced..5903ed8ae155 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -2503,32 +2503,6 @@ static int rts0_handler(const char *data, DWORD data_size, DWORD tag, void *cont return shader_parse_root_signature(data, data_size, desc); }
-int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, - struct vkd3d_root_signature_desc *root_signature) -{ - struct vkd3d_versioned_root_signature_desc desc = {0}; - int ret; - - TRACE("dxbc {%p, %zu}, root_signature %p.\n", dxbc->code, dxbc->size, root_signature); - - memset(root_signature, 0, sizeof(*root_signature)); - if ((ret = parse_dxbc(dxbc->code, dxbc->size, rts0_handler, &desc)) < 0) - { - vkd3d_shader_free_versioned_root_signature(&desc); - return ret; - } - - if (desc.version != VKD3D_ROOT_SIGNATURE_VERSION_1_0) - { - vkd3d_shader_free_versioned_root_signature(&desc); - return VKD3D_ERROR_NOT_IMPLEMENTED; - } - - *root_signature = desc.u.v_1_0; - - return VKD3D_OK; -} - int vkd3d_shader_parse_versioned_root_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_versioned_root_signature_desc *root_signature) { diff --git a/libs/vkd3d-shader/vkd3d_shader.map b/libs/vkd3d-shader/vkd3d_shader.map index e1f1f1c179a2..2959c5756223 100644 --- a/libs/vkd3d-shader/vkd3d_shader.map +++ b/libs/vkd3d-shader/vkd3d_shader.map @@ -9,7 +9,6 @@ global: vkd3d_shader_free_shader_signature; vkd3d_shader_free_versioned_root_signature; vkd3d_shader_parse_input_signature; - vkd3d_shader_parse_root_signature; vkd3d_shader_parse_versioned_root_signature; vkd3d_shader_scan_dxbc; vkd3d_shader_serialize_root_signature; diff --git a/tests/vkd3d_shader_api.c b/tests/vkd3d_shader_api.c index 65099f22f9a7..4e6080dbd901 100644 --- a/tests/vkd3d_shader_api.c +++ b/tests/vkd3d_shader_api.c @@ -54,17 +54,17 @@ static void test_invalid_shaders(void)
static void test_vkd3d_shader_pfns(void) { + PFN_vkd3d_shader_parse_versioned_root_signature pfn_vkd3d_shader_parse_versioned_root_signature; + PFN_vkd3d_shader_free_versioned_root_signature pfn_vkd3d_shader_free_versioned_root_signature; PFN_vkd3d_shader_serialize_root_signature pfn_vkd3d_shader_serialize_root_signature; PFN_vkd3d_shader_find_signature_element pfn_vkd3d_shader_find_signature_element; PFN_vkd3d_shader_free_shader_signature pfn_vkd3d_shader_free_shader_signature; PFN_vkd3d_shader_parse_input_signature pfn_vkd3d_shader_parse_input_signature; - PFN_vkd3d_shader_parse_root_signature pfn_vkd3d_shader_parse_root_signature; - PFN_vkd3d_shader_free_root_signature pfn_vkd3d_shader_free_root_signature; PFN_vkd3d_shader_free_shader_code pfn_vkd3d_shader_free_shader_code; PFN_vkd3d_shader_compile_dxbc pfn_vkd3d_shader_compile_dxbc; PFN_vkd3d_shader_scan_dxbc pfn_vkd3d_shader_scan_dxbc;
- struct vkd3d_root_signature_desc root_signature_desc; + struct vkd3d_versioned_root_signature_desc root_signature_desc; struct vkd3d_shader_signature_element *element; struct vkd3d_shader_scan_info scan_info; struct vkd3d_shader_signature signature; @@ -90,21 +90,21 @@ static void test_vkd3d_shader_pfns(void) }; static const struct vkd3d_shader_code vs = {vs_code, sizeof(vs_code)};
+ pfn_vkd3d_shader_parse_versioned_root_signature = vkd3d_shader_parse_versioned_root_signature; + pfn_vkd3d_shader_free_versioned_root_signature = vkd3d_shader_free_versioned_root_signature; pfn_vkd3d_shader_serialize_root_signature = vkd3d_shader_serialize_root_signature; pfn_vkd3d_shader_find_signature_element = vkd3d_shader_find_signature_element; pfn_vkd3d_shader_free_shader_signature = vkd3d_shader_free_shader_signature; pfn_vkd3d_shader_parse_input_signature = vkd3d_shader_parse_input_signature; - pfn_vkd3d_shader_parse_root_signature = vkd3d_shader_parse_root_signature; - pfn_vkd3d_shader_free_root_signature = vkd3d_shader_free_root_signature; pfn_vkd3d_shader_free_shader_code = vkd3d_shader_free_shader_code; pfn_vkd3d_shader_compile_dxbc = vkd3d_shader_compile_dxbc; pfn_vkd3d_shader_scan_dxbc = vkd3d_shader_scan_dxbc;
rc = pfn_vkd3d_shader_serialize_root_signature(&empty_rs_desc, VKD3D_ROOT_SIGNATURE_VERSION_1_0, &dxbc); ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc); - rc = pfn_vkd3d_shader_parse_root_signature(&dxbc, &root_signature_desc); + rc = pfn_vkd3d_shader_parse_versioned_root_signature(&dxbc, &root_signature_desc); ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc); - pfn_vkd3d_shader_free_root_signature(&root_signature_desc); + pfn_vkd3d_shader_free_versioned_root_signature(&root_signature_desc); pfn_vkd3d_shader_free_shader_code(&dxbc);
rc = pfn_vkd3d_shader_parse_input_signature(&vs, &signature);