WIP: HLSL: Fix ordering defect if global SB decl after fn param
authorsteve-lunarg <steve_gh@khasekhemwy.net>
Mon, 6 Mar 2017 19:01:44 +0000 (12:01 -0700)
committersteve-lunarg <steve_gh@khasekhemwy.net>
Mon, 6 Mar 2017 19:08:41 +0000 (12:08 -0700)
commit40efe5cee86b161c04429af98c66053089f471e5
treef639a49eced30b7175a20e6dfc531fb0d4f30133
parent33f85b6e5908c23d6836f776cb42b0a237b90289
WIP: HLSL: Fix ordering defect if global SB decl after fn param

This change propagates the storage qualifier from the buffer object to its contained
array type so that isStructBufferType() realizes it is one.  That propagation was
happening before only for global variable declarations, so compilation defects would
result if the use of a function parameter happened before a global declaration.

This fixes that case, whether or not there ever is a global declaration, and
regardless of the relative order.

This changes the hlsl.structbuffer.fn.frag test to exercise the alternate order.

There are no differences to generated SPIR-V for the cases which successfully compiled before.
Test/baseResults/hlsl.structbuffer.fn.frag.out
Test/hlsl.structbuffer.fn.frag
hlsl/hlslGrammar.cpp
hlsl/hlslParseHelper.cpp