shaderc: Added in/out hash. Fixed shader binary backward compatibility.

This commit is contained in:
Branimir Karadžić
2018-10-12 16:41:26 -07:00
parent 1ba107d156
commit 623fd3cf0b
10 changed files with 220 additions and 115 deletions

View File

@@ -2394,21 +2394,21 @@ namespace bgfx { namespace d3d9
uint32_t magic;
bx::read(&reader, magic);
switch (magic)
const bool fragment = isShaderType(magic, 'F');
uint32_t hashIn;
bx::read(&reader, hashIn);
uint32_t hashOut;
if (isShaderVerLess(magic, 6) )
{
case BGFX_CHUNK_MAGIC_FSH:
case BGFX_CHUNK_MAGIC_VSH:
break;
default:
BGFX_FATAL(false, Fatal::InvalidShader, "Unknown shader format %x.", magic);
break;
hashOut = hashIn;
}
else
{
bx::read(&reader, hashOut);
}
bool fragment = BGFX_CHUNK_MAGIC_FSH == magic;
uint32_t iohash;
bx::read(&reader, iohash);
uint16_t count;
bx::read(&reader, count);