shaderc: Add before hlsl validation option to spirv (#1892)

Fixes opaque type in struct error by disabling check.
```
Error: In Vulkan, OpTypeStruct must not contain an opaque type.
  %BgfxSampler2D = OpTypeStruct %6 %8
```
This commit is contained in:
Sandy 2019-09-26 21:00:44 +02:00 committed by Бранимир Караџић
parent 94cd22b440
commit 78614c9b55
1 changed files with 4 additions and 1 deletions

View File

@ -980,7 +980,10 @@ namespace bgfx { namespace spirv
opt.RegisterLegalizationPasses();
if (!opt.Run(spirv.data(), spirv.size(), &spirv) )
spvtools::ValidatorOptions validatorOptions;
validatorOptions.SetBeforeHlslLegalization(true);
if (!opt.Run(spirv.data(), spirv.size(), &spirv, validatorOptions, false) )
{
compiled = false;
}