From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- include/vkd3d_shader.h | 2 -- libs/vkd3d-shader/vkd3d_shader.map | 1 - libs/vkd3d-shader/vkd3d_shader_main.c | 41 ++++++++++++++------------- 3 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 57761af360f0..cfb026348d05 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -569,7 +569,6 @@ 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_versioned_root_signature_desc *root_signature); void vkd3d_shader_free_root_signature(struct vkd3d_versioned_root_signature_desc *root_signature); -void vkd3d_shader_free_root_signature_v_1_0(struct vkd3d_root_signature_desc *root_signature);
/* FIXME: Add support for returning error messages (ID3DBlob). */ int vkd3d_shader_serialize_root_signature(const struct vkd3d_versioned_root_signature_desc *root_signature, @@ -602,7 +601,6 @@ 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_versioned_root_signature_desc *root_signature); typedef void (*PFN_vkd3d_shader_free_root_signature)(struct vkd3d_versioned_root_signature_desc *root_signature); -typedef void (*PFN_vkd3d_shader_free_root_signature_v_1_0)(struct vkd3d_root_signature_desc *root_signature);
typedef int (*PFN_vkd3d_shader_serialize_root_signature)( const struct vkd3d_versioned_root_signature_desc *root_signature, struct vkd3d_shader_code *dxbc); diff --git a/libs/vkd3d-shader/vkd3d_shader.map b/libs/vkd3d-shader/vkd3d_shader.map index c2cfcbd8bd1f..74c38e1fddd4 100644 --- a/libs/vkd3d-shader/vkd3d_shader.map +++ b/libs/vkd3d-shader/vkd3d_shader.map @@ -5,7 +5,6 @@ global: vkd3d_shader_convert_root_signature; vkd3d_shader_find_signature_element; vkd3d_shader_free_root_signature; - vkd3d_shader_free_root_signature_v_1_0; vkd3d_shader_free_shader_code; vkd3d_shader_free_shader_signature; vkd3d_shader_parse_input_signature; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index ef491f7524c9..9848202a0c72 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -327,7 +327,7 @@ void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *shader_code) vkd3d_free((void *)shader_code->code); }
-void vkd3d_shader_free_root_signature_v_1_0(struct vkd3d_root_signature_desc *root_signature) +static void vkd3d_shader_free_root_signature_v_1_0(struct vkd3d_root_signature_desc *root_signature) { unsigned int i;
@@ -344,28 +344,10 @@ void vkd3d_shader_free_root_signature_v_1_0(struct vkd3d_root_signature_desc *ro memset(root_signature, 0, sizeof(*root_signature)); }
-void vkd3d_shader_free_root_signature(struct vkd3d_versioned_root_signature_desc *desc) +static void vkd3d_shader_free_root_signature_v_1_1(struct vkd3d_root_signature_desc1 *root_signature) { - struct vkd3d_root_signature_desc1 *root_signature; unsigned int i;
- if (!desc->version) - return; - - if (desc->version == VKD3D_ROOT_SIGNATURE_VERSION_1_0) - { - vkd3d_shader_free_root_signature_v_1_0(&desc->u.v_1_0); - return; - } - - if (desc->version != VKD3D_ROOT_SIGNATURE_VERSION_1_1) - { - FIXME("Unknown version %#x.\n", desc->version); - return; - } - - root_signature = &desc->u.v_1_1; - for (i = 0; i < root_signature->parameter_count; ++i) { const struct vkd3d_root_parameter1 *parameter = &root_signature->parameters[i]; @@ -379,6 +361,25 @@ void vkd3d_shader_free_root_signature(struct vkd3d_versioned_root_signature_desc memset(root_signature, 0, sizeof(*root_signature)); }
+void vkd3d_shader_free_root_signature(struct vkd3d_versioned_root_signature_desc *desc) +{ + if (desc->version == VKD3D_ROOT_SIGNATURE_VERSION_1_0) + { + vkd3d_shader_free_root_signature_v_1_0(&desc->u.v_1_0); + } + else if (desc->version == VKD3D_ROOT_SIGNATURE_VERSION_1_1) + { + vkd3d_shader_free_root_signature_v_1_1(&desc->u.v_1_1); + } + else if (desc->version) + { + FIXME("Unknown version %#x.\n", desc->version); + return; + } + + desc->version = 0; +} + int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_signature *signature) {