From 374bcd276e914f126c3c4fbd73596bbcc7e2fb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 24 Apr 2019 16:05:46 +0200 Subject: [PATCH] vkd3d-shader: Remove versioned_ prefix from root signature functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- include/vkd3d_shader.h | 16 ++++++++-------- libs/vkd3d-shader/dxbc.c | 6 +++--- libs/vkd3d-shader/vkd3d_shader.map | 6 +++--- libs/vkd3d-shader/vkd3d_shader_main.c | 6 +++--- libs/vkd3d/state.c | 4 ++-- libs/vkd3d/vkd3d_main.c | 16 ++++++++-------- tests/vkd3d_shader_api.c | 18 +++++++++--------- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 91b4b756..57761af3 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -566,13 +566,13 @@ 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_versioned_root_signature(const struct vkd3d_shader_code *dxbc, +int vkd3d_shader_parse_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); +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_versioned_root_signature(const struct vkd3d_versioned_root_signature_desc *root_signature, +int vkd3d_shader_serialize_root_signature(const struct vkd3d_versioned_root_signature_desc *root_signature, struct vkd3d_shader_code *dxbc); int vkd3d_shader_convert_root_signature(struct vkd3d_versioned_root_signature_desc *dst, @@ -599,12 +599,12 @@ 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_versioned_root_signature)(const struct vkd3d_shader_code *dxbc, +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_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 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_versioned_root_signature)( +typedef int (*PFN_vkd3d_shader_serialize_root_signature)( const struct vkd3d_versioned_root_signature_desc *root_signature, struct vkd3d_shader_code *dxbc); typedef int (*PFN_vkd3d_shader_convert_root_signature)(struct vkd3d_versioned_root_signature_desc *dst, diff --git a/libs/vkd3d-shader/dxbc.c b/libs/vkd3d-shader/dxbc.c index 3fe728e2..045e8682 100644 --- a/libs/vkd3d-shader/dxbc.c +++ b/libs/vkd3d-shader/dxbc.c @@ -2530,7 +2530,7 @@ 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_versioned_root_signature(const struct vkd3d_shader_code *dxbc, +int vkd3d_shader_parse_root_signature(const struct vkd3d_shader_code *dxbc, struct vkd3d_versioned_root_signature_desc *root_signature) { int ret; @@ -2540,7 +2540,7 @@ int vkd3d_shader_parse_versioned_root_signature(const struct vkd3d_shader_code * memset(root_signature, 0, sizeof(*root_signature)); if ((ret = parse_dxbc(dxbc->code, dxbc->size, rts0_handler, root_signature)) < 0) { - vkd3d_shader_free_versioned_root_signature(root_signature); + vkd3d_shader_free_root_signature(root_signature); return ret; } @@ -2913,7 +2913,7 @@ static int shader_write_root_signature(struct root_signature_writer_context *con return shader_write_static_samplers(context, desc); } -int vkd3d_shader_serialize_versioned_root_signature(const struct vkd3d_versioned_root_signature_desc *root_signature, +int vkd3d_shader_serialize_root_signature(const struct vkd3d_versioned_root_signature_desc *root_signature, struct vkd3d_shader_code *dxbc) { struct root_signature_writer_context context; diff --git a/libs/vkd3d-shader/vkd3d_shader.map b/libs/vkd3d-shader/vkd3d_shader.map index 45e9c6a8..c2cfcbd8 100644 --- a/libs/vkd3d-shader/vkd3d_shader.map +++ b/libs/vkd3d-shader/vkd3d_shader.map @@ -5,13 +5,13 @@ 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_free_versioned_root_signature; vkd3d_shader_parse_input_signature; - vkd3d_shader_parse_versioned_root_signature; + vkd3d_shader_parse_root_signature; vkd3d_shader_scan_dxbc; - vkd3d_shader_serialize_versioned_root_signature; + vkd3d_shader_serialize_root_signature; local: *; }; diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index d5679410..ef491f75 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(struct vkd3d_root_signature_desc *root_signature) +void vkd3d_shader_free_root_signature_v_1_0(struct vkd3d_root_signature_desc *root_signature) { unsigned int i; @@ -344,7 +344,7 @@ void vkd3d_shader_free_root_signature(struct vkd3d_root_signature_desc *root_sig memset(root_signature, 0, sizeof(*root_signature)); } -void vkd3d_shader_free_versioned_root_signature(struct vkd3d_versioned_root_signature_desc *desc) +void vkd3d_shader_free_root_signature(struct vkd3d_versioned_root_signature_desc *desc) { struct vkd3d_root_signature_desc1 *root_signature; unsigned int i; @@ -354,7 +354,7 @@ void vkd3d_shader_free_versioned_root_signature(struct vkd3d_versioned_root_sign if (desc->version == VKD3D_ROOT_SIGNATURE_VERSION_1_0) { - vkd3d_shader_free_root_signature(&desc->u.v_1_0); + vkd3d_shader_free_root_signature_v_1_0(&desc->u.v_1_0); return; } diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 75346556..df96ae44 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -1014,12 +1014,12 @@ HRESULT d3d12_root_signature_create(struct d3d12_device *device, if (!(object = vkd3d_malloc(sizeof(*object)))) { - vkd3d_shader_free_root_signature(&root_signature_desc.vkd3d); + vkd3d_shader_free_root_signature_v_1_0(&root_signature_desc.vkd3d); return E_OUTOFMEMORY; } hr = d3d12_root_signature_init(object, device, &root_signature_desc.d3d12); - vkd3d_shader_free_root_signature(&root_signature_desc.vkd3d); + vkd3d_shader_free_root_signature_v_1_0(&root_signature_desc.vkd3d); if (FAILED(hr)) { vkd3d_free(object); diff --git a/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/vkd3d_main.c index c96732c8..e095fdf4 100644 --- a/libs/vkd3d/vkd3d_main.c +++ b/libs/vkd3d/vkd3d_main.c @@ -140,7 +140,7 @@ static ULONG STDMETHODCALLTYPE d3d12_root_signature_deserializer_Release(ID3D12R if (!refcount) { - vkd3d_shader_free_root_signature(&deserializer->desc.vkd3d); + vkd3d_shader_free_root_signature_v_1_0(&deserializer->desc.vkd3d); vkd3d_free(deserializer); } @@ -173,7 +173,7 @@ int vkd3d_parse_root_signature_v_1_0(const struct vkd3d_shader_code *dxbc, struct vkd3d_versioned_root_signature_desc desc, converted_desc; int ret; - if ((ret = vkd3d_shader_parse_versioned_root_signature(dxbc, &desc)) < 0) + if ((ret = vkd3d_shader_parse_root_signature(dxbc, &desc)) < 0) { WARN("Failed to parse root signature, vkd3d result %d.\n", ret); return ret; @@ -188,7 +188,7 @@ int vkd3d_parse_root_signature_v_1_0(const struct vkd3d_shader_code *dxbc, enum vkd3d_root_signature_version version = desc.version; ret = vkd3d_shader_convert_root_signature(&converted_desc, VKD3D_ROOT_SIGNATURE_VERSION_1_0, &desc); - vkd3d_shader_free_versioned_root_signature(&desc); + vkd3d_shader_free_root_signature(&desc); if (ret < 0) { WARN("Failed to convert from version %#x, vkd3d result %d.\n", version, ret); @@ -300,8 +300,8 @@ static ULONG STDMETHODCALLTYPE d3d12_versioned_root_signature_deserializer_Relea if (!refcount) { - vkd3d_shader_free_versioned_root_signature(&deserializer->desc.vkd3d); - vkd3d_shader_free_versioned_root_signature(&deserializer->other_desc.vkd3d); + vkd3d_shader_free_root_signature(&deserializer->desc.vkd3d); + vkd3d_shader_free_root_signature(&deserializer->other_desc.vkd3d); vkd3d_free(deserializer); } @@ -387,7 +387,7 @@ static HRESULT d3d12_versioned_root_signature_deserializer_init(struct d3d12_ver deserializer->ID3D12VersionedRootSignatureDeserializer_iface.lpVtbl = &d3d12_versioned_root_signature_deserializer_vtbl; deserializer->refcount = 1; - if ((ret = vkd3d_shader_parse_versioned_root_signature(dxbc, &deserializer->desc.vkd3d)) < 0) + if ((ret = vkd3d_shader_parse_root_signature(dxbc, &deserializer->desc.vkd3d)) < 0) { WARN("Failed to parse root signature, vkd3d result %d.\n", ret); return hresult_from_vkd3d_result(ret); @@ -563,7 +563,7 @@ HRESULT vkd3d_serialize_root_signature(const D3D12_ROOT_SIGNATURE_DESC *desc, vkd3d_desc.version = VKD3D_ROOT_SIGNATURE_VERSION_1_0; vkd3d_desc.u.v_1_0 = *(const struct vkd3d_root_signature_desc *)desc; - if ((ret = vkd3d_shader_serialize_versioned_root_signature(&vkd3d_desc, &dxbc)) < 0) + if ((ret = vkd3d_shader_serialize_root_signature(&vkd3d_desc, &dxbc)) < 0) { WARN("Failed to serialize root signature, vkd3d result %d.\n", ret); if (error_blob) @@ -604,7 +604,7 @@ HRESULT vkd3d_serialize_versioned_root_signature(const D3D12_VERSIONED_ROOT_SIGN *error_blob = NULL; vkd3d_desc = (const struct vkd3d_versioned_root_signature_desc *)desc; - if ((ret = vkd3d_shader_serialize_versioned_root_signature(vkd3d_desc, &dxbc)) < 0) + if ((ret = vkd3d_shader_serialize_root_signature(vkd3d_desc, &dxbc)) < 0) { WARN("Failed to serialize root signature, vkd3d result %d.\n", ret); if (error_blob) diff --git a/tests/vkd3d_shader_api.c b/tests/vkd3d_shader_api.c index 260257b1..41067c06 100644 --- a/tests/vkd3d_shader_api.c +++ b/tests/vkd3d_shader_api.c @@ -54,12 +54,12 @@ static void test_invalid_shaders(void) static void test_vkd3d_shader_pfns(void) { - PFN_vkd3d_shader_serialize_versioned_root_signature pfn_vkd3d_shader_serialize_versioned_root_signature; - 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; @@ -93,21 +93,21 @@ static void test_vkd3d_shader_pfns(void) }; static const struct vkd3d_shader_code vs = {vs_code, sizeof(vs_code)}; - pfn_vkd3d_shader_serialize_versioned_root_signature = vkd3d_shader_serialize_versioned_root_signature; - 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_versioned_root_signature(&empty_rs_desc, &dxbc); + rc = pfn_vkd3d_shader_serialize_root_signature(&empty_rs_desc, &dxbc); ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc); - rc = pfn_vkd3d_shader_parse_versioned_root_signature(&dxbc, &root_signature_desc); + rc = pfn_vkd3d_shader_parse_root_signature(&dxbc, &root_signature_desc); ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc); - pfn_vkd3d_shader_free_versioned_root_signature(&root_signature_desc); + pfn_vkd3d_shader_free_root_signature(&root_signature_desc); pfn_vkd3d_shader_free_shader_code(&dxbc); rc = pfn_vkd3d_shader_parse_input_signature(&vs, &signature);