mirror of https://github.com/bkaradzic/bgfx
add error log detecting uint8_t overflow in hlsl shader compilation
This commit is contained in:
parent
a0057adaaa
commit
eb871bb618
|
@ -481,6 +481,17 @@ namespace bgfx { namespace hlsl
|
|||
if (UniformType::Count != uniformType
|
||||
&& 0 != (varDesc.uFlags & D3D_SVF_USED) )
|
||||
{
|
||||
if (constDesc.Elements > UINT8_MAX)
|
||||
{
|
||||
bx::write(_messageWriter
|
||||
, &messageErr
|
||||
, "Error: Uniform %s has %u elements. 255 is the limit for shaderc uniform serialization.\n"
|
||||
, varDesc.Name
|
||||
, constDesc.Elements
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
Uniform un;
|
||||
un.name = varDesc.Name;
|
||||
un.type = uniformType;
|
||||
|
|
Loading…
Reference in New Issue