mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 05:43:12 +01:00
shaderc: Added in/out hash. Fixed shader binary backward compatibility.
This commit is contained in:
@@ -4338,22 +4338,21 @@ namespace bgfx { namespace d3d12
|
||||
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_CSH:
|
||||
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);
|
||||
@@ -4362,7 +4361,7 @@ namespace bgfx { namespace d3d12
|
||||
m_numUniforms = count;
|
||||
|
||||
BX_TRACE("%s Shader consts %d"
|
||||
, BGFX_CHUNK_MAGIC_FSH == magic ? "Fragment" : BGFX_CHUNK_MAGIC_VSH == magic ? "Vertex" : "Compute"
|
||||
, getShaderTypeName(magic)
|
||||
, count
|
||||
);
|
||||
|
||||
@@ -4468,7 +4467,8 @@ namespace bgfx { namespace d3d12
|
||||
|
||||
bx::HashMurmur2A murmur;
|
||||
murmur.begin();
|
||||
murmur.add(iohash);
|
||||
murmur.add(hashIn);
|
||||
murmur.add(hashOut);
|
||||
murmur.add(code, shaderSize);
|
||||
murmur.add(numAttrs);
|
||||
murmur.add(m_attrMask, numAttrs);
|
||||
|
||||
Reference in New Issue
Block a user