d3dcompiler: Add initial SHDR and SHEX parsing.

This commit is contained in:
Rico Schüller 2010-12-28 11:50:13 +01:00 committed by Alexandre Julliard
parent a2a7000eeb
commit 127d07a3cc
2 changed files with 25 additions and 0 deletions

View File

@ -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')

View File

@ -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))