Commit 127d07a3 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dcompiler: Add initial SHDR and SHEX parsing.

parent a2a7000e
......@@ -72,6 +72,7 @@ struct d3dcompiler_shader_reflection
char *creator;
UINT flags;
UINT version;
UINT bound_resource_count;
UINT constant_buffer_count;
......@@ -630,6 +631,8 @@ void SlDeleteShader(struct bwriter_shader *shader) DECLSPEC_HIDDEN;
#define TAG_PCSG MAKE_TAG('P', 'C', 'S', 'G')
#define TAG_RDEF MAKE_TAG('R', 'D', 'E', 'F')
#define TAG_SDBG MAKE_TAG('S', 'D', 'B', 'G')
#define TAG_SHDR MAKE_TAG('S', 'H', 'D', 'R')
#define TAG_SHEX MAKE_TAG('S', 'H', 'E', 'X')
#define TAG_STAT MAKE_TAG('S', 'T', 'A', 'T')
#define TAG_XNAP MAKE_TAG('X', 'N', 'A', 'P')
#define TAG_XNAS MAKE_TAG('X', 'N', 'A', 'S')
......
......@@ -556,6 +556,18 @@ HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, cons
return S_OK;
}
static HRESULT d3dcompiler_parse_shdr(struct d3dcompiler_shader_reflection *r, const char *data, DWORD data_size)
{
const char *ptr = data;
read_dword(&ptr, &r->version);
TRACE("Shader version: %u\n", r->version);
/* todo: Check if anything else is needed from the shdr or shex blob. */
return S_OK;
}
HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_reflection *reflection,
const void *data, SIZE_T data_size)
{
......@@ -588,6 +600,16 @@ HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_reflection
}
break;
case TAG_SHEX:
case TAG_SHDR:
hr = d3dcompiler_parse_shdr(reflection, section->data, section->data_size);
if (FAILED(hr))
{
WARN("Failed to parse SHDR section.\n");
goto err_out;
}
break;
case TAG_RDEF:
hr = d3dcompiler_parse_rdef(reflection, section->data, section->data_size);
if (FAILED(hr))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment