bnoazx005 / TDEngine2

TDEngine2 is a cross-platform game engine
Apache License 2.0
18 stars 4 forks source link

[Bug] Invalid parsing of uniform buffers which contain arrays #64

Closed bnoazx005 closed 3 years ago

bnoazx005 commented 3 years ago

Bug report

When the engine tries to compile shader with arrays as uniforms the metadata extractor fails its work

Environment

Win 10 (x64) / Visual Studio 2017 / TDEngine2-v0.4 / NVidia GTX 860M in d3d11 mode

Steps to reproduce the issue

  1. Try to compile a shader with the following constant buffer

CBUFFER_SECTION(SkinningData) float4x4 mJoints[MAX_JOINTS_COUNT]; uint mUsedJointsCount; CBUFFER_ENDSECTION



#### What's the expected result?

1. mJoints should be parsed correctly as "mJoints" but not "mJoints[MAX_JOINTS_COUNT]"
2. The size of the buffer should be extracted correctly, including padding

#### What's the actual result?

mJoints[256] uniform is provided instead of mJoints one. The buffer also has incorrect size.