Commit Graph

3 Commits

Author SHA1 Message Date
Steven Perron
e935dac9ef
Make pointers to isomorphic type interchangeable with option. (#2570)
* Make pointers to logically matching types interchangeable with option.

DXC will be generating code where the function parameters will be a more
generic type that the actual parameter.  They should be logically
matching and the decorations of the actual parameter must be a superset
of the decorations of the formal parameter.

We want to accept this code with an options so that spirv-opt can then
inline and fix the type mismatch.  We will accept this under a new
options `--before-hlsl-legalization`.

The new option will also imply `relax-logical-pointer` so that HLSL
frontends will need to use just the one more generic option.

Moved the |LogicallyMatches| to the validation state to make it
available in more places.  Also added a parameter to have it check the
decorations.  I did not do a separate function for the decorations
because checking the decorations involves making sure the types
logically match anyway.

Fixes #2535
2019-05-13 13:48:17 -04:00
alan-baker
bdcb155163
Relax function call parameter check (#2448)
Fixes #2447

* Allow sub-objects for UniformConstant storage class
* Updated tests
2019-03-14 12:45:31 -04:00
alan-baker
117a1fd11f
Validate variable pointer related function call rules (#2270)
Fixes #2105

* Check storage class validity
* Check memory object declaration validity
2019-02-06 14:10:40 -05:00