mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
vkd3d-shader: Report error messages from vkd3d_shader_parse_input_signature().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
11f82d985c
commit
d135b4687b
@ -767,7 +767,7 @@ int vkd3d_shader_scan(const struct vkd3d_shader_compile_info *compile_info, char
|
||||
void vkd3d_shader_free_scan_descriptor_info(struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info);
|
||||
|
||||
int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc,
|
||||
struct vkd3d_shader_signature *signature);
|
||||
struct vkd3d_shader_signature *signature, char **messages);
|
||||
struct vkd3d_shader_signature_element *vkd3d_shader_find_signature_element(
|
||||
const struct vkd3d_shader_signature *signature, const char *semantic_name,
|
||||
unsigned int semantic_index, unsigned int stream_index);
|
||||
@ -798,7 +798,7 @@ typedef void (*PFN_vkd3d_shader_free_scan_descriptor_info)(
|
||||
struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info);
|
||||
|
||||
typedef int (*PFN_vkd3d_shader_parse_input_signature)(const struct vkd3d_shader_code *dxbc,
|
||||
struct vkd3d_shader_signature *signature);
|
||||
struct vkd3d_shader_signature *signature, char **messages);
|
||||
typedef struct vkd3d_shader_signature_element * (*PFN_vkd3d_shader_find_signature_element)(
|
||||
const struct vkd3d_shader_signature *signature, const char *semantic_name,
|
||||
unsigned int semantic_index, unsigned int stream_index);
|
||||
|
@ -2132,17 +2132,13 @@ static int isgn_handler(const char *data, DWORD data_size, DWORD tag, void *ctx)
|
||||
}
|
||||
|
||||
int shader_parse_input_signature(const void *dxbc, size_t dxbc_length,
|
||||
struct vkd3d_shader_signature *signature)
|
||||
struct vkd3d_shader_message_context *message_context, struct vkd3d_shader_signature *signature)
|
||||
{
|
||||
struct vkd3d_shader_message_context message_context;
|
||||
int ret;
|
||||
|
||||
memset(signature, 0, sizeof(*signature));
|
||||
if (!vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_NONE, NULL))
|
||||
return VKD3D_ERROR;
|
||||
if ((ret = parse_dxbc(dxbc, dxbc_length, &message_context, isgn_handler, signature)) < 0)
|
||||
if ((ret = parse_dxbc(dxbc, dxbc_length, message_context, isgn_handler, signature)) < 0)
|
||||
ERR("Failed to parse input signature.\n");
|
||||
vkd3d_shader_message_context_cleanup(&message_context);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -971,11 +971,26 @@ void vkd3d_shader_free_root_signature(struct vkd3d_shader_versioned_root_signatu
|
||||
}
|
||||
|
||||
int vkd3d_shader_parse_input_signature(const struct vkd3d_shader_code *dxbc,
|
||||
struct vkd3d_shader_signature *signature)
|
||||
struct vkd3d_shader_signature *signature, char **messages)
|
||||
{
|
||||
TRACE("dxbc {%p, %zu}, signature %p.\n", dxbc->code, dxbc->size, signature);
|
||||
struct vkd3d_shader_message_context message_context;
|
||||
int ret;
|
||||
|
||||
return shader_parse_input_signature(dxbc->code, dxbc->size, signature);
|
||||
TRACE("dxbc {%p, %zu}, signature %p, messages %p.\n", dxbc->code, dxbc->size, signature, messages);
|
||||
|
||||
if (messages)
|
||||
*messages = NULL;
|
||||
if (!vkd3d_shader_message_context_init(&message_context, VKD3D_SHADER_LOG_INFO, NULL))
|
||||
return VKD3D_ERROR;
|
||||
|
||||
ret = shader_parse_input_signature(dxbc->code, dxbc->size, &message_context, signature);
|
||||
vkd3d_shader_message_context_trace_messages(&message_context);
|
||||
if (messages && !(*messages = vkd3d_shader_message_context_copy_messages(&message_context)))
|
||||
ret = VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
vkd3d_shader_message_context_cleanup(&message_context);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct vkd3d_shader_signature_element *vkd3d_shader_find_signature_element(
|
||||
|
@ -840,7 +840,7 @@ int shader_extract_from_dxbc(const void *dxbc, size_t dxbc_length,
|
||||
void free_shader_desc(struct vkd3d_shader_desc *desc) DECLSPEC_HIDDEN;
|
||||
|
||||
int shader_parse_input_signature(const void *dxbc, size_t dxbc_length,
|
||||
struct vkd3d_shader_signature *signature) DECLSPEC_HIDDEN;
|
||||
struct vkd3d_shader_message_context *message_context, struct vkd3d_shader_signature *signature) DECLSPEC_HIDDEN;
|
||||
|
||||
struct vkd3d_dxbc_compiler;
|
||||
|
||||
|
@ -2316,7 +2316,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
|
||||
switch (shader_stages[i].stage)
|
||||
{
|
||||
case VK_SHADER_STAGE_VERTEX_BIT:
|
||||
if ((ret = vkd3d_shader_parse_input_signature(&dxbc, &input_signature)) < 0)
|
||||
if ((ret = vkd3d_shader_parse_input_signature(&dxbc, &input_signature, NULL)) < 0)
|
||||
{
|
||||
hr = hresult_from_vkd3d_result(ret);
|
||||
goto fail;
|
||||
|
@ -134,7 +134,7 @@ static void test_vkd3d_shader_pfns(void)
|
||||
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);
|
||||
rc = pfn_vkd3d_shader_parse_input_signature(&vs, &signature, NULL);
|
||||
ok(rc == VKD3D_OK, "Got unexpected error code %d.\n", rc);
|
||||
element = pfn_vkd3d_shader_find_signature_element(&signature, "position", 0, 0);
|
||||
ok(element, "Could not find shader signature element.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user