Updated glslang.

This commit is contained in:
Бранимир Караџић
2019-02-01 20:56:56 -08:00
parent 5de5fa91bf
commit 6bc0c3fb0a
32 changed files with 4302 additions and 3668 deletions

View File

@@ -141,6 +141,7 @@ source_set("glslang_sources") {
if (is_clang) {
cflags_cc = [
"-Wno-extra-semi",
"-Wno-ignored-qualifiers",
"-Wno-implicit-fallthrough",
"-Wno-inconsistent-missing-override",

View File

@@ -222,7 +222,7 @@ void Builder::postProcess(Instruction& inst)
Instruction *idx = module.getInstruction(accessChain->getIdOperand(i));
if (type->getOpCode() == OpTypeStruct) {
assert(idx->getOpCode() == OpConstant);
int c = idx->getImmediateOperand(0);
unsigned int c = idx->getImmediateOperand(0);
const auto function = [&](const std::unique_ptr<Instruction>& decoration) {
if (decoration.get()->getOpCode() == OpMemberDecorate &&

View File

@@ -0,0 +1,38 @@
#version 300 es
#extension GL_EXT_YUV_target : enable
uniform __samplerExternal2DY2YEXT sExt;
precision mediump __samplerExternal2DY2YEXT;
uniform __samplerExternal2DY2YEXT mediumExt;
uniform highp __samplerExternal2DY2YEXT highExt;
void main()
{
texture2D(sExt, vec2(0.2)); // ERROR
texture2D(mediumExt, vec2(0.2)); // ERROR
texture2D(highExt, vec2(0.2)); // ERROR
texture2DProj(sExt, vec3(0.3)); // ERROR
texture2DProj(sExt, vec4(0.3)); // ERROR
int lod = 0;
highp float bias = 0.01;
textureSize(sExt, lod);
texture(sExt, vec2(0.2));
texture(sExt, vec2(0.2), bias);
textureProj(sExt, vec3(0.2));
textureProj(sExt, vec3(0.2), bias);
textureProj(sExt, vec4(0.2));
textureProj(sExt, vec4(0.2), bias);
texelFetch(sExt, ivec2(4), lod);
texture3D(sExt, vec3(0.3)); // ERROR
texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR
texture(sExt, vec3(0.3)); // ERROR
textureProjLod(sExt, vec3(0.3), 0.3); // ERROR
}
#extension GL_EXT_YUV_target : disable
uniform __samplerExternal2DY2YEXT badExt; // ERROR

View File

@@ -0,0 +1,192 @@
300samplerExternalYUV.frag
ERROR: 0:12: 'texture2D' : no matching overloaded function found
ERROR: 0:13: 'texture2D' : no matching overloaded function found
ERROR: 0:14: 'texture2D' : no matching overloaded function found
ERROR: 0:15: 'texture2DProj' : no matching overloaded function found
ERROR: 0:16: 'texture2DProj' : no matching overloaded function found
ERROR: 0:29: 'texture3D' : no matching overloaded function found
ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found
ERROR: 0:31: 'texture' : no matching overloaded function found
ERROR: 0:32: 'textureProjLod' : no matching overloaded function found
ERROR: 0:37: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 10 compilation errors. No code generated.
Shader version: 300
Requested GL_EXT_YUV_target
ERROR: node is still EOpNull!
0:10 Function Definition: main( ( global void)
0:10 Function Parameters:
0:12 Sequence
0:12 Constant:
0:12 0.000000
0:13 Constant:
0:13 0.000000
0:14 Constant:
0:14 0.000000
0:15 Constant:
0:15 0.000000
0:16 Constant:
0:16 0.000000
0:18 Sequence
0:18 move second child to first child ( temp mediump int)
0:18 'lod' ( temp mediump int)
0:18 Constant:
0:18 0 (const int)
0:19 Sequence
0:19 move second child to first child ( temp highp float)
0:19 'bias' ( temp highp float)
0:19 Constant:
0:19 0.010000
0:20 textureSize ( global highp 2-component vector of int, operation at mediump)
0:20 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:20 'lod' ( temp mediump int)
0:21 texture ( global lowp 4-component vector of float)
0:21 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:21 Constant:
0:21 0.200000
0:21 0.200000
0:22 texture ( global lowp 4-component vector of float, operation at highp)
0:22 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:22 Constant:
0:22 0.200000
0:22 0.200000
0:22 'bias' ( temp highp float)
0:23 textureProj ( global lowp 4-component vector of float)
0:23 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:23 Constant:
0:23 0.200000
0:23 0.200000
0:23 0.200000
0:24 textureProj ( global lowp 4-component vector of float, operation at highp)
0:24 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:24 Constant:
0:24 0.200000
0:24 0.200000
0:24 0.200000
0:24 'bias' ( temp highp float)
0:25 textureProj ( global lowp 4-component vector of float)
0:25 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:25 Constant:
0:25 0.200000
0:25 0.200000
0:25 0.200000
0:25 0.200000
0:26 textureProj ( global lowp 4-component vector of float, operation at highp)
0:26 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:26 Constant:
0:26 0.200000
0:26 0.200000
0:26 0.200000
0:26 0.200000
0:26 'bias' ( temp highp float)
0:27 textureFetch ( global lowp 4-component vector of float, operation at mediump)
0:27 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:27 Constant:
0:27 4 (const int)
0:27 4 (const int)
0:27 'lod' ( temp mediump int)
0:29 Constant:
0:29 0.000000
0:30 Constant:
0:30 0.000000
0:31 Constant:
0:31 0.000000
0:32 Constant:
0:32 0.000000
0:? Linker Objects
0:? 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:? 'mediumExt' ( uniform mediump __samplerExternal2DY2YEXT)
0:? 'highExt' ( uniform highp __samplerExternal2DY2YEXT)
Linked fragment stage:
Shader version: 300
Requested GL_EXT_YUV_target
ERROR: node is still EOpNull!
0:10 Function Definition: main( ( global void)
0:10 Function Parameters:
0:12 Sequence
0:12 Constant:
0:12 0.000000
0:13 Constant:
0:13 0.000000
0:14 Constant:
0:14 0.000000
0:15 Constant:
0:15 0.000000
0:16 Constant:
0:16 0.000000
0:18 Sequence
0:18 move second child to first child ( temp mediump int)
0:18 'lod' ( temp mediump int)
0:18 Constant:
0:18 0 (const int)
0:19 Sequence
0:19 move second child to first child ( temp highp float)
0:19 'bias' ( temp highp float)
0:19 Constant:
0:19 0.010000
0:20 textureSize ( global highp 2-component vector of int, operation at mediump)
0:20 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:20 'lod' ( temp mediump int)
0:21 texture ( global lowp 4-component vector of float)
0:21 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:21 Constant:
0:21 0.200000
0:21 0.200000
0:22 texture ( global lowp 4-component vector of float, operation at highp)
0:22 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:22 Constant:
0:22 0.200000
0:22 0.200000
0:22 'bias' ( temp highp float)
0:23 textureProj ( global lowp 4-component vector of float)
0:23 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:23 Constant:
0:23 0.200000
0:23 0.200000
0:23 0.200000
0:24 textureProj ( global lowp 4-component vector of float, operation at highp)
0:24 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:24 Constant:
0:24 0.200000
0:24 0.200000
0:24 0.200000
0:24 'bias' ( temp highp float)
0:25 textureProj ( global lowp 4-component vector of float)
0:25 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:25 Constant:
0:25 0.200000
0:25 0.200000
0:25 0.200000
0:25 0.200000
0:26 textureProj ( global lowp 4-component vector of float, operation at highp)
0:26 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:26 Constant:
0:26 0.200000
0:26 0.200000
0:26 0.200000
0:26 0.200000
0:26 'bias' ( temp highp float)
0:27 textureFetch ( global lowp 4-component vector of float, operation at mediump)
0:27 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:27 Constant:
0:27 4 (const int)
0:27 4 (const int)
0:27 'lod' ( temp mediump int)
0:29 Constant:
0:29 0.000000
0:30 Constant:
0:30 0.000000
0:31 Constant:
0:31 0.000000
0:32 Constant:
0:32 0.000000
0:? Linker Objects
0:? 'sExt' ( uniform lowp __samplerExternal2DY2YEXT)
0:? 'mediumExt' ( uniform mediump __samplerExternal2DY2YEXT)
0:? 'highExt' ( uniform highp __samplerExternal2DY2YEXT)

View File

@@ -0,0 +1,189 @@
hlsl.earlydepthstencil.frag
Shader version: 500
gl_FragCoord origin is upper left
using early_fragment_tests
0:? Sequence
0:8 Function Definition: @main(struct-InputStruct-vf41; ( temp uint)
0:8 Function Parameters:
0:8 'input' ( in structure{ temp 4-component vector of float Position})
0:? Sequence
0:10 move second child to first child ( temp uint)
0:10 'oldVal' ( temp uint)
0:10 imageAtomicExchange ( temp uint)
0:10 'Values' (layout( r32ui) uniform uimage2D)
0:? Construct uvec2 ( temp 2-component vector of uint)
0:10 Convert float to uint ( temp uint)
0:10 direct index ( temp float)
0:10 Position: direct index for structure ( temp 4-component vector of float)
0:10 'input' ( in structure{ temp 4-component vector of float Position})
0:10 Constant:
0:10 0 (const int)
0:10 Constant:
0:10 0 (const int)
0:10 Convert float to uint ( temp uint)
0:10 direct index ( temp float)
0:10 Position: direct index for structure ( temp 4-component vector of float)
0:10 'input' ( in structure{ temp 4-component vector of float Position})
0:10 Constant:
0:10 0 (const int)
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 1 (const uint)
0:11 Branch: Return with expression
0:11 'oldVal' ( temp uint)
0:8 Function Definition: main( ( temp void)
0:8 Function Parameters:
0:? Sequence
0:8 Sequence
0:8 move second child to first child ( temp 4-component vector of float)
0:8 Position: direct index for structure ( temp 4-component vector of float)
0:? 'input' ( temp structure{ temp 4-component vector of float Position})
0:8 Constant:
0:8 0 (const int)
0:? 'input.Position' ( in 4-component vector of float FragCoord)
0:8 move second child to first child ( temp uint)
0:? '@entryPointOutput' (layout( location=0) out uint)
0:8 Function Call: @main(struct-InputStruct-vf41; ( temp uint)
0:? 'input' ( temp structure{ temp 4-component vector of float Position})
0:? Linker Objects
0:? 'Values' (layout( r32ui) uniform uimage2D)
0:? '@entryPointOutput' (layout( location=0) out uint)
0:? 'input.Position' ( in 4-component vector of float FragCoord)
Linked fragment stage:
Shader version: 500
gl_FragCoord origin is upper left
using early_fragment_tests
0:? Sequence
0:8 Function Definition: @main(struct-InputStruct-vf41; ( temp uint)
0:8 Function Parameters:
0:8 'input' ( in structure{ temp 4-component vector of float Position})
0:? Sequence
0:10 move second child to first child ( temp uint)
0:10 'oldVal' ( temp uint)
0:10 imageAtomicExchange ( temp uint)
0:10 'Values' (layout( r32ui) uniform uimage2D)
0:? Construct uvec2 ( temp 2-component vector of uint)
0:10 Convert float to uint ( temp uint)
0:10 direct index ( temp float)
0:10 Position: direct index for structure ( temp 4-component vector of float)
0:10 'input' ( in structure{ temp 4-component vector of float Position})
0:10 Constant:
0:10 0 (const int)
0:10 Constant:
0:10 0 (const int)
0:10 Convert float to uint ( temp uint)
0:10 direct index ( temp float)
0:10 Position: direct index for structure ( temp 4-component vector of float)
0:10 'input' ( in structure{ temp 4-component vector of float Position})
0:10 Constant:
0:10 0 (const int)
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 1 (const uint)
0:11 Branch: Return with expression
0:11 'oldVal' ( temp uint)
0:8 Function Definition: main( ( temp void)
0:8 Function Parameters:
0:? Sequence
0:8 Sequence
0:8 move second child to first child ( temp 4-component vector of float)
0:8 Position: direct index for structure ( temp 4-component vector of float)
0:? 'input' ( temp structure{ temp 4-component vector of float Position})
0:8 Constant:
0:8 0 (const int)
0:? 'input.Position' ( in 4-component vector of float FragCoord)
0:8 move second child to first child ( temp uint)
0:? '@entryPointOutput' (layout( location=0) out uint)
0:8 Function Call: @main(struct-InputStruct-vf41; ( temp uint)
0:? 'input' ( temp structure{ temp 4-component vector of float Position})
0:? Linker Objects
0:? 'Values' (layout( r32ui) uniform uimage2D)
0:? '@entryPointOutput' (layout( location=0) out uint)
0:? 'input.Position' ( in 4-component vector of float FragCoord)
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 50
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 41 46
ExecutionMode 4 OriginUpperLeft
ExecutionMode 4 EarlyFragmentTests
Source HLSL 500
Name 4 "main"
Name 8 "InputStruct"
MemberName 8(InputStruct) 0 "Position"
Name 13 "@main(struct-InputStruct-vf41;"
Name 12 "input"
Name 16 "oldVal"
Name 19 "Values"
Name 39 "input"
Name 41 "input.Position"
Name 46 "@entryPointOutput"
Name 47 "param"
Decorate 19(Values) DescriptorSet 0
Decorate 19(Values) Binding 0
Decorate 41(input.Position) BuiltIn FragCoord
Decorate 46(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8(InputStruct): TypeStruct 7(fvec4)
9: TypePointer Function 8(InputStruct)
10: TypeInt 32 0
11: TypeFunction 10(int) 9(ptr)
15: TypePointer Function 10(int)
17: TypeImage 10(int) 2D nonsampled format:R32ui
18: TypePointer UniformConstant 17
19(Values): 18(ptr) Variable UniformConstant
20: TypeInt 32 1
21: 20(int) Constant 0
22: 10(int) Constant 0
23: TypePointer Function 6(float)
27: 10(int) Constant 1
31: TypeVector 10(int) 2
33: TypePointer Image 10(int)
40: TypePointer Input 7(fvec4)
41(input.Position): 40(ptr) Variable Input
43: TypePointer Function 7(fvec4)
45: TypePointer Output 10(int)
46(@entryPointOutput): 45(ptr) Variable Output
4(main): 2 Function None 3
5: Label
39(input): 9(ptr) Variable Function
47(param): 9(ptr) Variable Function
42: 7(fvec4) Load 41(input.Position)
44: 43(ptr) AccessChain 39(input) 21
Store 44 42
48:8(InputStruct) Load 39(input)
Store 47(param) 48
49: 10(int) FunctionCall 13(@main(struct-InputStruct-vf41;) 47(param)
Store 46(@entryPointOutput) 49
Return
FunctionEnd
13(@main(struct-InputStruct-vf41;): 10(int) Function None 11
12(input): 9(ptr) FunctionParameter
14: Label
16(oldVal): 15(ptr) Variable Function
24: 23(ptr) AccessChain 12(input) 21 22
25: 6(float) Load 24
26: 10(int) ConvertFToU 25
28: 23(ptr) AccessChain 12(input) 21 27
29: 6(float) Load 28
30: 10(int) ConvertFToU 29
32: 31(ivec2) CompositeConstruct 26 30
34: 33(ptr) ImageTexelPointer 19(Values) 32 22
35: 10(int) AtomicExchange 34 27 22 27
Store 16(oldVal) 35
36: 10(int) Load 16(oldVal)
ReturnValue 36
FunctionEnd

View File

@@ -15,45 +15,45 @@ foo.n1.a: offset 0, type 1406, size 1, index 3, binding -1, stages 1
foo.n2.b: offset 16, type 1406, size 1, index 3, binding -1, stages 1
foo.n2.c: offset 20, type 1406, size 1, index 3, binding -1, stages 1
foo.n2.d: offset 24, type 1406, size 1, index 3, binding -1, stages 1
deepA.d2.d1[2].va: offset 376, type 8b50, size 2, index 1, binding -1, stages 1
deepA.d2.d1[2].va: offset 440, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1.va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[0].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[1].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[2].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[3].va: offset 984, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[1].va: offset 1016, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[2].va: offset 1048, type 8b50, size 2, index 1, binding -1, stages 1
deepB.d2.d1[3].va: offset 1080, type 8b50, size 2, index 1, binding -1, stages 1
deepC.iv4: offset 1568, type 8b52, size 1, index 1, binding -1, stages 1
deepC.d2.i: offset 1568, type 1404, size 1, index 1, binding -1, stages 1
deepC.d2.d1[0].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[0].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1
deepC.d2.d1[1].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[1].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1
deepC.d2.d1[2].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[2].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1
deepC.d2.d1[3].va: offset 1568, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[3].b: offset 1568, type 8b56, size 1, index 1, binding -1, stages 1
deepC.v3: offset 1568, type 8b54, size 1, index 1, binding -1, stages 1
deepC.d2.i: offset 1584, type 1404, size 1, index 1, binding -1, stages 1
deepC.d2.d1[0].va: offset 1592, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[0].b: offset 1616, type 8b56, size 1, index 1, binding -1, stages 1
deepC.d2.d1[1].va: offset 1624, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[1].b: offset 1648, type 8b56, size 1, index 1, binding -1, stages 1
deepC.d2.d1[2].va: offset 1656, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[2].b: offset 1680, type 8b56, size 1, index 1, binding -1, stages 1
deepC.d2.d1[3].va: offset 1688, type 8b50, size 3, index 1, binding -1, stages 1
deepC.d2.d1[3].b: offset 1712, type 8b56, size 1, index 1, binding -1, stages 1
deepC.v3: offset 1728, type 8b54, size 1, index 1, binding -1, stages 1
deepD[0].iv4: offset 2480, type 8b52, size 1, index 1, binding -1, stages 1
deepD[0].d2.i: offset 2480, type 1404, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[0].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[0].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[1].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[1].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[2].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[2].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].v3: offset 2480, type 8b54, size 1, index 1, binding -1, stages 1
deepD[1].iv4: offset 2480, type 8b52, size 1, index 1, binding -1, stages 1
deepD[1].d2.i: offset 2480, type 1404, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[0].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[0].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[1].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[1].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[2].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[2].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[3].va: offset 2480, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[3].b: offset 2480, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].v3: offset 2480, type 8b54, size 1, index 1, binding -1, stages 1
deepD[0].d2.i: offset 2496, type 1404, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[0].va: offset 2504, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[0].b: offset 2528, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[1].va: offset 2536, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[1].b: offset 2560, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[2].va: offset 2568, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[2].b: offset 2592, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].d2.d1[3].va: offset 2600, type 8b50, size 3, index 1, binding -1, stages 1
deepD[0].d2.d1[3].b: offset 2624, type 8b56, size 1, index 1, binding -1, stages 1
deepD[0].v3: offset 2640, type 8b54, size 1, index 1, binding -1, stages 1
deepD[1].iv4: offset 2784, type 8b52, size 1, index 1, binding -1, stages 1
deepD[1].d2.i: offset 2800, type 1404, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[0].va: offset 2808, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[0].b: offset 2832, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[1].va: offset 2840, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[1].b: offset 2864, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[2].va: offset 2872, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[2].b: offset 2896, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].d2.d1[3].va: offset 2904, type 8b50, size 3, index 1, binding -1, stages 1
deepD[1].d2.d1[3].b: offset 2928, type 8b56, size 1, index 1, binding -1, stages 1
deepD[1].v3: offset 2944, type 8b54, size 1, index 1, binding -1, stages 1
foo1: offset 0, type 1406, size 1, index 4, binding -1, stages 1
foo2: offset 0, type 1406, size 1, index 5, binding -1, stages 1
anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1

View File

@@ -74,6 +74,16 @@ buf1.runtimeArray: offset 4, type 1406, size 4, index 12, binding -1, stages 1
buf2.runtimeArray.c: offset 8, type 1406, size 1, index 13, binding -1, stages 1
buf3.runtimeArray: offset 4, type 1406, size 0, index 14, binding -1, stages 1
buf4.runtimeArray.c: offset 8, type 1406, size 1, index 15, binding -1, stages 1
nested2.a.n1.a: offset 16, type 1406, size 1, index 16, binding -1, stages 1
nested2.a.n2.b: offset 32, type 1406, size 1, index 16, binding -1, stages 1
nested2.a.n2.c: offset 36, type 1406, size 1, index 16, binding -1, stages 1
nested2.a.n2.d: offset 40, type 1406, size 1, index 16, binding -1, stages 1
nested2.b[0].a: offset 48, type 1406, size 1, index 16, binding -1, stages 1
nested2.b[1].a: offset 64, type 1406, size 1, index 16, binding -1, stages 1
nested2.b[2].a: offset 80, type 1406, size 1, index 16, binding -1, stages 1
nested2.b[3].a: offset 96, type 1406, size 1, index 16, binding -1, stages 1
nested2.c.a: offset 112, type 1406, size 1, index 16, binding -1, stages 1
nested2.d.a: offset 144, type 1406, size 1, index 16, binding -1, stages 1
anonMember1: offset 0, type 8b51, size 1, index 0, binding -1, stages 1
uf1: offset -1, type 1406, size 1, index -1, binding -1, stages 1
uf2: offset -1, type 1406, size 1, index -1, binding -1, stages 1
@@ -96,6 +106,7 @@ buf1: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
buf2: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
buf3: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
buf4: offset -1, type ffffffff, size 4, index -1, binding -1, stages 0
nested2: offset -1, type ffffffff, size 208, index -1, binding -1, stages 0
Vertex attribute reflection:
attributeFloat: offset 0, type 1406, size 0, index 0, binding -1, stages 0

View File

@@ -83,6 +83,7 @@ void main()
ModuleProcessed "resource-set-binding 3"
ModuleProcessed "auto-map-locations"
ModuleProcessed "client opengl100"
ModuleProcessed "target-env spirv1.3"
ModuleProcessed "target-env opengl"
ModuleProcessed "relaxed-errors"
ModuleProcessed "suppress-warnings"

View File

@@ -0,0 +1,12 @@
RWTexture2D<uint> Values;
struct InputStruct {
float4 Position : SV_POSITION;
};
[earlydepthstencil]
uint main(InputStruct input) : SV_Target {
uint oldVal;
InterlockedExchange(Values[uint2(input.Position.x, input.Position.y)], 1.0, oldVal);
return oldVal;
}

View File

@@ -60,6 +60,14 @@ layout(std140) uniform nested {
N3 foo;
} nest;
layout(std140) uniform nested2 {
vec4 padding; // offset 0, size 16
N3 a; // offset 16, size 32
N1 b[4]; // offset 48, size 64
N1 c[2]; // offset 112, size 32
N1 d[4]; // offset 144, size 64
} nest2;
struct TS {
int a;
int dead;
@@ -203,4 +211,9 @@ void main()
f += buf2i.runtimeArray[3].c;
f += buf3i.runtimeArray[gl_InstanceID];
f += buf4i.runtimeArray[gl_InstanceID].c;
N3 n = nest2.a;
N1 b[4] = nest2.b;
f += nest2.c[1].a;
f += nest2.d[gl_InstanceID].a;
}

View File

@@ -81,6 +81,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler
bool sampler : 1; // true means a pure sampler, other fields should be clear()
bool external : 1; // GL_OES_EGL_image_external
bool yuv : 1; // GL_EXT_YUV_target
unsigned int vectorSize : 3; // vector return type size.
// Some languages support structures as sample results. Storing the whole structure in the
@@ -116,6 +117,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
combined = false;
sampler = false;
external = false;
yuv = false;
structReturnIndex = noReturnStruct;
// by default, returns a single vec4;
@@ -186,6 +188,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
combined == right.combined &&
sampler == right.sampler &&
external == right.external &&
yuv == right.yuv &&
vectorSize == right.vectorSize &&
structReturnIndex == right.structReturnIndex;
}
@@ -233,6 +236,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
s.append("ExternalOES");
return s;
}
if (yuv) {
return "__" + s + "External2DY2YEXT";
}
switch (dim) {
case Esd1D: s.append("1D"); break;
case Esd2D: s.append("2D"); break;

View File

@@ -1603,6 +1603,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3
"\n");
}
commonBuiltins.append(
"highp ivec2 textureSize(__samplerExternal2DY2YEXT, int lod);" // GL_EXT_YUV_target
"vec4 texture(__samplerExternal2DY2YEXT, vec2);" // GL_EXT_YUV_target
"vec4 texture(__samplerExternal2DY2YEXT, vec2, float bias);" // GL_EXT_YUV_target
"vec4 textureProj(__samplerExternal2DY2YEXT, vec3);" // GL_EXT_YUV_target
"vec4 textureProj(__samplerExternal2DY2YEXT, vec3, float bias);" // GL_EXT_YUV_target
"vec4 textureProj(__samplerExternal2DY2YEXT, vec4);" // GL_EXT_YUV_target
"vec4 textureProj(__samplerExternal2DY2YEXT, vec4, float bias);" // GL_EXT_YUV_target
"vec4 texelFetch(__samplerExternal2DY2YEXT sampler, ivec2, int lod);" // GL_EXT_YUV_target
"\n");
commonBuiltins.append(
"vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod
"vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod

View File

@@ -3006,6 +3006,9 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const
requireExtensions(loc, 1, &E_GL_OES_EGL_image_external_essl3, "samplerExternalOES");
}
}
if (type.getSampler().yuv) {
requireExtensions(loc, 1, &E_GL_EXT_YUV_target, "__samplerExternal2DY2YEXT");
}
if (type.getQualifier().storage == EvqUniform)
return;

View File

@@ -592,6 +592,8 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external
(*KeywordMap)["__samplerExternal2DY2YEXT"] = SAMPLEREXTERNAL2DY2YEXT; // GL_EXT_YUV_target
(*KeywordMap)["sampler"] = SAMPLER;
(*KeywordMap)["samplerShadow"] = SAMPLERSHADOW;
@@ -1410,6 +1412,13 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
case SAMPLEREXTERNAL2DY2YEXT:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
parseContext.extensionTurnedOn(E_GL_EXT_YUV_target))
return keyword;
return identifierOrType();
case TEXTURE2D:
case TEXTURECUBE:
case TEXTURECUBEARRAY:

View File

@@ -99,6 +99,8 @@ void TType::buildMangledName(TString& mangledName) const
mangledName += "S";
if (sampler.external)
mangledName += "E";
if (sampler.yuv)
mangledName += "Y";
switch (sampler.dim) {
case Esd1D: mangledName += "1"; break;
case Esd2D: mangledName += "2"; break;
@@ -295,7 +297,7 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf)
if (copyOf.getNumExtensions() > 0)
setExtensions(copyOf.getNumExtensions(), copyOf.getExtensions());
if (copyOf.hasMemberExtensions()) {
for (int m = 0; m < copyOf.type.getStruct()->size(); ++m) {
for (int m = 0; m < (int)copyOf.type.getStruct()->size(); ++m) {
if (copyOf.getNumMemberExtensions(m) > 0)
setMemberExtensions(m, copyOf.getNumMemberExtensions(m), copyOf.getMemberExtensions(m));
}

View File

@@ -345,20 +345,20 @@ protected:
class TAnonMember : public TSymbol {
public:
TAnonMember(const TString* n, unsigned int m, TVariable& a, int an) : TSymbol(n), anonContainer(a), memberNumber(m), anonId(an) { }
virtual TAnonMember* clone() const;
virtual TAnonMember* clone() const override;
virtual ~TAnonMember() { }
virtual const TAnonMember* getAsAnonMember() const { return this; }
virtual const TAnonMember* getAsAnonMember() const override { return this; }
virtual const TVariable& getAnonContainer() const { return anonContainer; }
virtual unsigned int getMemberNumber() const { return memberNumber; }
virtual const TType& getType() const
virtual const TType& getType() const override
{
const TTypeList& types = *anonContainer.getType().getStruct();
return *types[memberNumber].type;
}
virtual TType& getWritableType()
virtual TType& getWritableType() override
{
assert(writable);
const TTypeList& types = *anonContainer.getType().getStruct();
@@ -373,7 +373,7 @@ public:
virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
virtual int getAnonId() const { return anonId; }
virtual void dump(TInfoSink &infoSink) const;
virtual void dump(TInfoSink &infoSink) const override;
protected:
explicit TAnonMember(const TAnonMember&);

View File

@@ -157,6 +157,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_frag_depth] = EBhDisable;
extensionBehavior[E_GL_OES_EGL_image_external] = EBhDisable;
extensionBehavior[E_GL_OES_EGL_image_external_essl3] = EBhDisable;
extensionBehavior[E_GL_EXT_YUV_target] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_texture_lod] = EBhDisable;
extensionBehavior[E_GL_EXT_shadow_samplers] = EBhDisable;
extensionBehavior[E_GL_ARB_texture_rectangle] = EBhDisable;
@@ -307,6 +308,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_frag_depth 1\n"
"#define GL_OES_EGL_image_external 1\n"
"#define GL_OES_EGL_image_external_essl3 1\n"
"#define GL_EXT_YUV_target 1\n"
"#define GL_EXT_shader_texture_lod 1\n"
"#define GL_EXT_shadow_samplers 1\n"

View File

@@ -74,7 +74,7 @@ inline const char* ProfileName(EProfile profile)
}
//
// What source rules, validation rules, target language, etc. are needed
// What source rules, validation rules, target language, etc. are needed or
// desired for SPIR-V?
//
// 0 means a target or rule set is not enabled (ignore rules from that entity).
@@ -110,6 +110,7 @@ const char* const E_GL_OES_standard_derivatives = "GL_OES_standard_deriv
const char* const E_GL_EXT_frag_depth = "GL_EXT_frag_depth";
const char* const E_GL_OES_EGL_image_external = "GL_OES_EGL_image_external";
const char* const E_GL_OES_EGL_image_external_essl3 = "GL_OES_EGL_image_external_essl3";
const char* const E_GL_EXT_YUV_target = "GL_EXT_YUV_target";
const char* const E_GL_EXT_shader_texture_lod = "GL_EXT_shader_texture_lod";
const char* const E_GL_EXT_shadow_samplers = "GL_EXT_shadow_samplers";

View File

@@ -180,6 +180,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
%token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY
%token <lex> SAMPLEREXTERNALOES
%token <lex> SAMPLEREXTERNAL2DY2YEXT
%token <lex> F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE
%token <lex> F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY
@@ -3111,6 +3112,12 @@ type_specifier_nonarray
$$.sampler.set(EbtFloat, Esd2D);
$$.sampler.external = true;
}
| SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, Esd2D);
$$.sampler.yuv = true;
}
| SUBPASSINPUT {
parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());

File diff suppressed because it is too large Load Diff

View File

@@ -261,193 +261,194 @@ extern int yydebug;
ISAMPLER2DMSARRAY = 471,
USAMPLER2DMSARRAY = 472,
SAMPLEREXTERNALOES = 473,
F16SAMPLER1D = 474,
F16SAMPLER2D = 475,
F16SAMPLER3D = 476,
F16SAMPLER2DRECT = 477,
F16SAMPLERCUBE = 478,
F16SAMPLER1DARRAY = 479,
F16SAMPLER2DARRAY = 480,
F16SAMPLERCUBEARRAY = 481,
F16SAMPLERBUFFER = 482,
F16SAMPLER2DMS = 483,
F16SAMPLER2DMSARRAY = 484,
F16SAMPLER1DSHADOW = 485,
F16SAMPLER2DSHADOW = 486,
F16SAMPLER1DARRAYSHADOW = 487,
F16SAMPLER2DARRAYSHADOW = 488,
F16SAMPLER2DRECTSHADOW = 489,
F16SAMPLERCUBESHADOW = 490,
F16SAMPLERCUBEARRAYSHADOW = 491,
SAMPLER = 492,
SAMPLERSHADOW = 493,
TEXTURE1D = 494,
TEXTURE2D = 495,
TEXTURE3D = 496,
TEXTURECUBE = 497,
TEXTURE1DARRAY = 498,
TEXTURE2DARRAY = 499,
ITEXTURE1D = 500,
ITEXTURE2D = 501,
ITEXTURE3D = 502,
ITEXTURECUBE = 503,
ITEXTURE1DARRAY = 504,
ITEXTURE2DARRAY = 505,
UTEXTURE1D = 506,
UTEXTURE2D = 507,
UTEXTURE3D = 508,
UTEXTURECUBE = 509,
UTEXTURE1DARRAY = 510,
UTEXTURE2DARRAY = 511,
TEXTURE2DRECT = 512,
ITEXTURE2DRECT = 513,
UTEXTURE2DRECT = 514,
TEXTUREBUFFER = 515,
ITEXTUREBUFFER = 516,
UTEXTUREBUFFER = 517,
TEXTURECUBEARRAY = 518,
ITEXTURECUBEARRAY = 519,
UTEXTURECUBEARRAY = 520,
TEXTURE2DMS = 521,
ITEXTURE2DMS = 522,
UTEXTURE2DMS = 523,
TEXTURE2DMSARRAY = 524,
ITEXTURE2DMSARRAY = 525,
UTEXTURE2DMSARRAY = 526,
F16TEXTURE1D = 527,
F16TEXTURE2D = 528,
F16TEXTURE3D = 529,
F16TEXTURE2DRECT = 530,
F16TEXTURECUBE = 531,
F16TEXTURE1DARRAY = 532,
F16TEXTURE2DARRAY = 533,
F16TEXTURECUBEARRAY = 534,
F16TEXTUREBUFFER = 535,
F16TEXTURE2DMS = 536,
F16TEXTURE2DMSARRAY = 537,
SUBPASSINPUT = 538,
SUBPASSINPUTMS = 539,
ISUBPASSINPUT = 540,
ISUBPASSINPUTMS = 541,
USUBPASSINPUT = 542,
USUBPASSINPUTMS = 543,
F16SUBPASSINPUT = 544,
F16SUBPASSINPUTMS = 545,
IMAGE1D = 546,
IIMAGE1D = 547,
UIMAGE1D = 548,
IMAGE2D = 549,
IIMAGE2D = 550,
UIMAGE2D = 551,
IMAGE3D = 552,
IIMAGE3D = 553,
UIMAGE3D = 554,
IMAGE2DRECT = 555,
IIMAGE2DRECT = 556,
UIMAGE2DRECT = 557,
IMAGECUBE = 558,
IIMAGECUBE = 559,
UIMAGECUBE = 560,
IMAGEBUFFER = 561,
IIMAGEBUFFER = 562,
UIMAGEBUFFER = 563,
IMAGE1DARRAY = 564,
IIMAGE1DARRAY = 565,
UIMAGE1DARRAY = 566,
IMAGE2DARRAY = 567,
IIMAGE2DARRAY = 568,
UIMAGE2DARRAY = 569,
IMAGECUBEARRAY = 570,
IIMAGECUBEARRAY = 571,
UIMAGECUBEARRAY = 572,
IMAGE2DMS = 573,
IIMAGE2DMS = 574,
UIMAGE2DMS = 575,
IMAGE2DMSARRAY = 576,
IIMAGE2DMSARRAY = 577,
UIMAGE2DMSARRAY = 578,
F16IMAGE1D = 579,
F16IMAGE2D = 580,
F16IMAGE3D = 581,
F16IMAGE2DRECT = 582,
F16IMAGECUBE = 583,
F16IMAGE1DARRAY = 584,
F16IMAGE2DARRAY = 585,
F16IMAGECUBEARRAY = 586,
F16IMAGEBUFFER = 587,
F16IMAGE2DMS = 588,
F16IMAGE2DMSARRAY = 589,
STRUCT = 590,
VOID = 591,
WHILE = 592,
IDENTIFIER = 593,
TYPE_NAME = 594,
FLOATCONSTANT = 595,
DOUBLECONSTANT = 596,
INT16CONSTANT = 597,
UINT16CONSTANT = 598,
INT32CONSTANT = 599,
UINT32CONSTANT = 600,
INTCONSTANT = 601,
UINTCONSTANT = 602,
INT64CONSTANT = 603,
UINT64CONSTANT = 604,
BOOLCONSTANT = 605,
FLOAT16CONSTANT = 606,
LEFT_OP = 607,
RIGHT_OP = 608,
INC_OP = 609,
DEC_OP = 610,
LE_OP = 611,
GE_OP = 612,
EQ_OP = 613,
NE_OP = 614,
AND_OP = 615,
OR_OP = 616,
XOR_OP = 617,
MUL_ASSIGN = 618,
DIV_ASSIGN = 619,
ADD_ASSIGN = 620,
MOD_ASSIGN = 621,
LEFT_ASSIGN = 622,
RIGHT_ASSIGN = 623,
AND_ASSIGN = 624,
XOR_ASSIGN = 625,
OR_ASSIGN = 626,
SUB_ASSIGN = 627,
LEFT_PAREN = 628,
RIGHT_PAREN = 629,
LEFT_BRACKET = 630,
RIGHT_BRACKET = 631,
LEFT_BRACE = 632,
RIGHT_BRACE = 633,
DOT = 634,
COMMA = 635,
COLON = 636,
EQUAL = 637,
SEMICOLON = 638,
BANG = 639,
DASH = 640,
TILDE = 641,
PLUS = 642,
STAR = 643,
SLASH = 644,
PERCENT = 645,
LEFT_ANGLE = 646,
RIGHT_ANGLE = 647,
VERTICAL_BAR = 648,
CARET = 649,
AMPERSAND = 650,
QUESTION = 651,
INVARIANT = 652,
PRECISE = 653,
HIGH_PRECISION = 654,
MEDIUM_PRECISION = 655,
LOW_PRECISION = 656,
PRECISION = 657,
PACKED = 658,
RESOURCE = 659,
SUPERP = 660
SAMPLEREXTERNAL2DY2YEXT = 474,
F16SAMPLER1D = 475,
F16SAMPLER2D = 476,
F16SAMPLER3D = 477,
F16SAMPLER2DRECT = 478,
F16SAMPLERCUBE = 479,
F16SAMPLER1DARRAY = 480,
F16SAMPLER2DARRAY = 481,
F16SAMPLERCUBEARRAY = 482,
F16SAMPLERBUFFER = 483,
F16SAMPLER2DMS = 484,
F16SAMPLER2DMSARRAY = 485,
F16SAMPLER1DSHADOW = 486,
F16SAMPLER2DSHADOW = 487,
F16SAMPLER1DARRAYSHADOW = 488,
F16SAMPLER2DARRAYSHADOW = 489,
F16SAMPLER2DRECTSHADOW = 490,
F16SAMPLERCUBESHADOW = 491,
F16SAMPLERCUBEARRAYSHADOW = 492,
SAMPLER = 493,
SAMPLERSHADOW = 494,
TEXTURE1D = 495,
TEXTURE2D = 496,
TEXTURE3D = 497,
TEXTURECUBE = 498,
TEXTURE1DARRAY = 499,
TEXTURE2DARRAY = 500,
ITEXTURE1D = 501,
ITEXTURE2D = 502,
ITEXTURE3D = 503,
ITEXTURECUBE = 504,
ITEXTURE1DARRAY = 505,
ITEXTURE2DARRAY = 506,
UTEXTURE1D = 507,
UTEXTURE2D = 508,
UTEXTURE3D = 509,
UTEXTURECUBE = 510,
UTEXTURE1DARRAY = 511,
UTEXTURE2DARRAY = 512,
TEXTURE2DRECT = 513,
ITEXTURE2DRECT = 514,
UTEXTURE2DRECT = 515,
TEXTUREBUFFER = 516,
ITEXTUREBUFFER = 517,
UTEXTUREBUFFER = 518,
TEXTURECUBEARRAY = 519,
ITEXTURECUBEARRAY = 520,
UTEXTURECUBEARRAY = 521,
TEXTURE2DMS = 522,
ITEXTURE2DMS = 523,
UTEXTURE2DMS = 524,
TEXTURE2DMSARRAY = 525,
ITEXTURE2DMSARRAY = 526,
UTEXTURE2DMSARRAY = 527,
F16TEXTURE1D = 528,
F16TEXTURE2D = 529,
F16TEXTURE3D = 530,
F16TEXTURE2DRECT = 531,
F16TEXTURECUBE = 532,
F16TEXTURE1DARRAY = 533,
F16TEXTURE2DARRAY = 534,
F16TEXTURECUBEARRAY = 535,
F16TEXTUREBUFFER = 536,
F16TEXTURE2DMS = 537,
F16TEXTURE2DMSARRAY = 538,
SUBPASSINPUT = 539,
SUBPASSINPUTMS = 540,
ISUBPASSINPUT = 541,
ISUBPASSINPUTMS = 542,
USUBPASSINPUT = 543,
USUBPASSINPUTMS = 544,
F16SUBPASSINPUT = 545,
F16SUBPASSINPUTMS = 546,
IMAGE1D = 547,
IIMAGE1D = 548,
UIMAGE1D = 549,
IMAGE2D = 550,
IIMAGE2D = 551,
UIMAGE2D = 552,
IMAGE3D = 553,
IIMAGE3D = 554,
UIMAGE3D = 555,
IMAGE2DRECT = 556,
IIMAGE2DRECT = 557,
UIMAGE2DRECT = 558,
IMAGECUBE = 559,
IIMAGECUBE = 560,
UIMAGECUBE = 561,
IMAGEBUFFER = 562,
IIMAGEBUFFER = 563,
UIMAGEBUFFER = 564,
IMAGE1DARRAY = 565,
IIMAGE1DARRAY = 566,
UIMAGE1DARRAY = 567,
IMAGE2DARRAY = 568,
IIMAGE2DARRAY = 569,
UIMAGE2DARRAY = 570,
IMAGECUBEARRAY = 571,
IIMAGECUBEARRAY = 572,
UIMAGECUBEARRAY = 573,
IMAGE2DMS = 574,
IIMAGE2DMS = 575,
UIMAGE2DMS = 576,
IMAGE2DMSARRAY = 577,
IIMAGE2DMSARRAY = 578,
UIMAGE2DMSARRAY = 579,
F16IMAGE1D = 580,
F16IMAGE2D = 581,
F16IMAGE3D = 582,
F16IMAGE2DRECT = 583,
F16IMAGECUBE = 584,
F16IMAGE1DARRAY = 585,
F16IMAGE2DARRAY = 586,
F16IMAGECUBEARRAY = 587,
F16IMAGEBUFFER = 588,
F16IMAGE2DMS = 589,
F16IMAGE2DMSARRAY = 590,
STRUCT = 591,
VOID = 592,
WHILE = 593,
IDENTIFIER = 594,
TYPE_NAME = 595,
FLOATCONSTANT = 596,
DOUBLECONSTANT = 597,
INT16CONSTANT = 598,
UINT16CONSTANT = 599,
INT32CONSTANT = 600,
UINT32CONSTANT = 601,
INTCONSTANT = 602,
UINTCONSTANT = 603,
INT64CONSTANT = 604,
UINT64CONSTANT = 605,
BOOLCONSTANT = 606,
FLOAT16CONSTANT = 607,
LEFT_OP = 608,
RIGHT_OP = 609,
INC_OP = 610,
DEC_OP = 611,
LE_OP = 612,
GE_OP = 613,
EQ_OP = 614,
NE_OP = 615,
AND_OP = 616,
OR_OP = 617,
XOR_OP = 618,
MUL_ASSIGN = 619,
DIV_ASSIGN = 620,
ADD_ASSIGN = 621,
MOD_ASSIGN = 622,
LEFT_ASSIGN = 623,
RIGHT_ASSIGN = 624,
AND_ASSIGN = 625,
XOR_ASSIGN = 626,
OR_ASSIGN = 627,
SUB_ASSIGN = 628,
LEFT_PAREN = 629,
RIGHT_PAREN = 630,
LEFT_BRACKET = 631,
RIGHT_BRACKET = 632,
LEFT_BRACE = 633,
RIGHT_BRACE = 634,
DOT = 635,
COMMA = 636,
COLON = 637,
EQUAL = 638,
SEMICOLON = 639,
BANG = 640,
DASH = 641,
TILDE = 642,
PLUS = 643,
STAR = 644,
SLASH = 645,
PERCENT = 646,
LEFT_ANGLE = 647,
RIGHT_ANGLE = 648,
VERTICAL_BAR = 649,
CARET = 650,
AMPERSAND = 651,
QUESTION = 652,
INVARIANT = 653,
PRECISE = 654,
HIGH_PRECISION = 655,
MEDIUM_PRECISION = 656,
LOW_PRECISION = 657,
PRECISION = 658,
PACKED = 659,
RESOURCE = 660,
SUPERP = 661
};
#endif
@@ -456,7 +457,7 @@ extern int yydebug;
union YYSTYPE
{
#line 70 "MachineIndependent/glslang.y" /* yacc.c:1909 */
#line 71 "MachineIndependent/glslang.y" /* yacc.c:1909 */
struct {
glslang::TSourceLoc loc;
@@ -491,7 +492,7 @@ union YYSTYPE
};
} interm;
#line 495 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
#line 496 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;

View File

@@ -420,11 +420,40 @@ public:
if (spvVersion.openGl > 0)
processes.addProcess("client opengl100");
// target SPV
switch (spvVersion.spv) {
case 0:
break;
case EShTargetSpv_1_0:
break;
case EShTargetSpv_1_1:
processes.addProcess("target-env spirv1.1");
break;
case EShTargetSpv_1_2:
processes.addProcess("target-env spirv1.2");
break;
case EShTargetSpv_1_3:
processes.addProcess("target-env spirv1.3");
break;
default:
processes.addProcess("target-env spirvUnknown");
break;
}
// target-environment processes
if (spvVersion.vulkan > 0)
switch (spvVersion.vulkan) {
case 0:
break;
case EShTargetVulkan_1_0:
processes.addProcess("target-env vulkan1.0");
else if (spvVersion.vulkan > 0)
break;
case EShTargetVulkan_1_1:
processes.addProcess("target-env vulkan1.1");
break;
default:
processes.addProcess("target-env vulkanUnknown");
break;
}
if (spvVersion.openGl > 0)
processes.addProcess("target-env opengl");
}

View File

@@ -105,14 +105,29 @@ public:
const TString &name = base.getName();
const TType &type = base.getType();
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name);
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str());
if (it == reflection.nameToIndex.end()) {
reflection.nameToIndex[name] = (int)reflection.indexToAttribute.size();
reflection.indexToAttribute.push_back(TObjectReflection(name, type, 0, mapToGlType(type), 0, 0));
reflection.nameToIndex[name.c_str()] = (int)reflection.indexToAttribute.size();
reflection.indexToAttribute.push_back(TObjectReflection(name.c_str(), type, 0, mapToGlType(type), 0, 0));
}
}
}
// shared calculation by getOffset and getOffsets
void updateOffset(const TType& parentType, const TType& memberType, int& offset, int& memberSize)
{
int dummyStride;
// modify just the children's view of matrix layout, if there is one for this member
TLayoutMatrix subMatrixLayout = memberType.getQualifier().layoutMatrix;
int memberAlignment = intermediate.getMemberAlignment(memberType, memberSize, dummyStride,
parentType.getQualifier().layoutPacking,
subMatrixLayout != ElmNone
? subMatrixLayout == ElmRowMajor
: parentType.getQualifier().layoutMatrix == ElmRowMajor);
RoundToPow2(offset, memberAlignment);
}
// Lookup or calculate the offset of a block member, using the recursively
// defined block offset rules.
int getOffset(const TType& type, int index)
@@ -125,18 +140,11 @@ public:
if (memberList[index].type->getQualifier().hasOffset())
return memberList[index].type->getQualifier().layoutOffset;
int memberSize;
int dummyStride;
int memberSize = 0;
int offset = 0;
for (int m = 0; m <= index; ++m) {
// modify just the children's view of matrix layout, if there is one for this member
TLayoutMatrix subMatrixLayout = memberList[m].type->getQualifier().layoutMatrix;
int memberAlignment = intermediate.getMemberAlignment(*memberList[m].type, memberSize, dummyStride,
type.getQualifier().layoutPacking,
subMatrixLayout != ElmNone
? subMatrixLayout == ElmRowMajor
: type.getQualifier().layoutMatrix == ElmRowMajor);
RoundToPow2(offset, memberAlignment);
updateOffset(type, *memberList[m].type, offset, memberSize);
if (m < index)
offset += memberSize;
}
@@ -144,6 +152,50 @@ public:
return offset;
}
// Lookup or calculate the offset of all block members at once, using the recursively
// defined block offset rules.
void getOffsets(const TType& type, TVector<int>& offsets)
{
const TTypeList& memberList = *type.getStruct();
int memberSize = 0;
int offset = 0;
for (size_t m = 0; m < offsets.size(); ++m) {
// if the user supplied an offset, snap to it now
if (memberList[m].type->getQualifier().hasOffset())
offset = memberList[m].type->getQualifier().layoutOffset;
// calculate the offset of the next member and align the current offset to this member
updateOffset(type, *memberList[m].type, offset, memberSize);
// save the offset of this member
offsets[m] = offset;
// update for the next member
offset += memberSize;
}
}
// Calculate the stride of an array type
int getArrayStride(const TType& baseType, const TType& type)
{
int dummySize;
int stride;
// consider blocks to have 0 stride, so that all offsets are relative to the start of their block
if (type.getBasicType() == EbtBlock)
return 0;
TLayoutMatrix subMatrixLayout = type.getQualifier().layoutMatrix;
intermediate.getMemberAlignment(type, dummySize, stride,
baseType.getQualifier().layoutPacking,
subMatrixLayout != ElmNone
? subMatrixLayout == ElmRowMajor
: baseType.getQualifier().layoutMatrix == ElmRowMajor);
return stride;
}
// Calculate the block data size.
// Block arrayness is not taken into account, each element is backed by a separate buffer.
int getBlockSize(const TType& blockType)
@@ -179,7 +231,9 @@ public:
terminalType = &visitNode->getType();
int index;
switch (visitNode->getOp()) {
case EOpIndexIndirect:
case EOpIndexIndirect: {
int stride = getArrayStride(baseType, visitNode->getLeft()->getType());
// Visit all the indices of this array, and for each one add on the remaining dereferencing
for (int i = 0; i < std::max(visitNode->getLeft()->getType().getOuterArraySize(), 1); ++i) {
TString newBaseName = name;
@@ -189,14 +243,22 @@ public:
++nextDeref;
TType derefType(*terminalType, 0);
blowUpActiveAggregate(derefType, newBaseName, derefs, nextDeref, offset, blockIndex, arraySize);
if (offset >= 0)
offset += stride;
}
// it was all completed in the recursive calls above
return;
}
case EOpIndexDirect:
index = visitNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst();
if (baseType.getBasicType() != EbtBlock)
if (baseType.getBasicType() != EbtBlock) {
name.append(TString("[") + String(index) + "]");
if (offset >= 0)
offset += getArrayStride(baseType, visitNode->getLeft()->getType()) * index;
}
break;
case EOpIndexDirectStruct:
index = visitNode->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst();
@@ -213,23 +275,43 @@ public:
// if the terminalType is still too coarse a granularity, this is still an aggregate to expand, expand it...
if (! isReflectionGranularity(*terminalType)) {
// the base offset of this node, that children are relative to
int baseOffset = offset;
if (terminalType->isArray()) {
// Visit all the indices of this array, and for each one,
// fully explode the remaining aggregate to dereference
int stride = 0;
if (offset >= 0)
stride = getArrayStride(baseType, *terminalType);
for (int i = 0; i < std::max(terminalType->getOuterArraySize(), 1); ++i) {
TString newBaseName = name;
newBaseName.append(TString("[") + String(i) + "]");
TType derefType(*terminalType, 0);
if (offset >= 0)
offset = baseOffset + stride * i;
blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), offset, blockIndex, 0);
}
} else {
// Visit all members of this aggregate, and for each one,
// fully explode the remaining aggregate to dereference
const TTypeList& typeList = *terminalType->getStruct();
TVector<int> memberOffsets;
if (baseOffset >= 0) {
memberOffsets.resize(typeList.size());
getOffsets(*terminalType, memberOffsets);
}
for (int i = 0; i < (int)typeList.size(); ++i) {
TString newBaseName = name;
newBaseName.append(TString(".") + typeList[i].type->getFieldName());
TType derefType(*terminalType, i);
if (offset >= 0)
offset = baseOffset + memberOffsets[i];
blowUpActiveAggregate(derefType, newBaseName, derefs, derefs.end(), offset, blockIndex, 0);
}
}
@@ -245,10 +327,10 @@ public:
if (arraySize == 0)
arraySize = mapToGlArraySize(*terminalType);
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name);
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str());
if (it == reflection.nameToIndex.end()) {
reflection.nameToIndex[name] = (int)reflection.indexToUniform.size();
reflection.indexToUniform.push_back(TObjectReflection(name, *terminalType, offset,
reflection.nameToIndex[name.c_str()] = (int)reflection.indexToUniform.size();
reflection.indexToUniform.push_back(TObjectReflection(name.c_str(), *terminalType, offset,
mapToGlType(*terminalType),
arraySize, blockIndex));
} else if (arraySize > 1) {
@@ -348,11 +430,11 @@ public:
int addBlockName(const TString& name, const TType& type, int size)
{
int blockIndex;
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name);
if (reflection.nameToIndex.find(name) == reflection.nameToIndex.end()) {
TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name.c_str());
if (reflection.nameToIndex.find(name.c_str()) == reflection.nameToIndex.end()) {
blockIndex = (int)reflection.indexToUniformBlock.size();
reflection.nameToIndex[name] = blockIndex;
reflection.indexToUniformBlock.push_back(TObjectReflection(name, type, -1, -1, size, -1));
reflection.nameToIndex[name.c_str()] = blockIndex;
reflection.indexToUniformBlock.push_back(TObjectReflection(name.c_str(), type, -1, -1, size, -1));
} else
blockIndex = it->second;
@@ -770,7 +852,7 @@ void TReflection::buildCounterIndices(const TIntermediate& intermediate)
{
// search for ones that have counters
for (int i = 0; i < int(indexToUniformBlock.size()); ++i) {
const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name));
const TString counterName(intermediate.addCounterBufferName(indexToUniformBlock[i].name).c_str());
const int index = getIndex(counterName);
if (index >= 0)

View File

@@ -55,7 +55,7 @@ class TReflectionTraverser;
// Data needed for just a single object at the granularity exchanged by the reflection API
class TObjectReflection {
public:
TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) :
TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) :
name(pName), offset(pOffset),
glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), stages(EShLanguageMask(0)), type(pType.clone()) { }
@@ -78,7 +78,7 @@ public:
}
static TObjectReflection badReflection() { return TObjectReflection(); }
TString name;
std::string name;
int offset;
int glDefineType;
int size; // data size in bytes for a block, array size for a (non-block) object that's an array
@@ -87,7 +87,8 @@ public:
EShLanguageMask stages;
protected:
TObjectReflection() : offset(-1), glDefineType(-1), size(-1), index(-1), type(nullptr) { }
TObjectReflection() :
offset(-1), glDefineType(-1), size(-1), index(-1), counterIndex(-1), stages(EShLanguageMask(0)), type(nullptr) { }
const TType* type;
};
@@ -162,7 +163,7 @@ protected:
void buildAttributeReflection(EShLanguage, const TIntermediate&);
// Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;
typedef std::map<TString, int> TNameToIndex;
typedef std::map<std::string, int> TNameToIndex;
typedef std::vector<TObjectReflection> TMapIndexToReflection;
TObjectReflection badReflection; // return for queries of -1 or generally out of range; has expected descriptions with in it for this

View File

@@ -45,7 +45,10 @@
#include <stdint.h>
#include <cstdio>
#include <sys/time.h>
#if !defined(__Fuchsia__)
#include <sys/resource.h>
#endif
namespace glslang {
@@ -70,7 +73,7 @@ static void DetachThreadLinux(void *)
//
void OS_CleanupThreadData(void)
{
#ifdef __ANDROID__
#if defined(__ANDROID__) || defined(__Fuchsia__)
DetachThreadLinux(NULL);
#else
int old_cancel_state, old_cancel_type;

View File

@@ -113,6 +113,7 @@ INSTANTIATE_TEST_CASE_P(
"300operations.frag",
"300block.frag",
"300samplerExternal.frag",
"300samplerExternalYUV.frag",
"310.comp",
"310.vert",
"310.geom",

View File

@@ -100,7 +100,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::ValuesIn(std::vector<TestCaseSpec>({
{"specExamples.vert", "baseResults/test.conf", "specExamplesConf.vert.out", (EShMessages)(EShMsgAST | EShMsgCascadingErrors)},
{"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgCascadingErrors},
})),
}))
);
// clang-format on

View File

@@ -127,7 +127,7 @@ INSTANTIATE_TEST_CASE_P(
{float(ldexp(1.0, -127) / 2.0 + (ldexp(1.0, -127) / 4.0f)),
"0x1.8p-128"},
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float32NanTests, HexFloatTest,
@@ -145,7 +145,7 @@ INSTANTIATE_TEST_CASE_P(
{uint32_t(0x7f800c00), "0x1.0018p+128"}, // +nan
{uint32_t(0x7F80F000), "0x1.01ep+128"}, // +nan
{uint32_t(0x7FFFFFFF), "0x1.fffffep+128"}, // +nan
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float64Tests, HexDoubleTest,
@@ -218,7 +218,7 @@ INSTANTIATE_TEST_CASE_P(
{ldexp(1.0, -1023) / 2.0 + (ldexp(1.0, -1023) / 4.0),
"0x1.8p-1024"},
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float64NanTests, HexDoubleTest,
@@ -237,7 +237,7 @@ INSTANTIATE_TEST_CASE_P(
{uint64_t(0x7FF0000000000001LL), "0x1.0000000000001p+1024"}, // -nan
{uint64_t(0x7FF0000300000000LL), "0x1.00003p+1024"}, // -nan
{uint64_t(0x7FFFFFFFFFFFFFFFLL), "0x1.fffffffffffffp+1024"}, // -nan
})),);
})));
TEST(HexFloatStreamTest, OperatorLeftShiftPreservesFloatAndFill) {
std::stringstream s;
@@ -282,7 +282,7 @@ INSTANTIATE_TEST_CASE_P(
{"0xFFp+0", 255.f},
{"0x0.8p+0", 0.5f},
{"0x0.4p+0", 0.25f},
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float32DecodeInfTests, DecodeHexFloatTest,
@@ -292,7 +292,7 @@ INSTANTIATE_TEST_CASE_P(
{"0x32p+127", uint32_t(0x7F800000)}, // inf
{"0x32p+500", uint32_t(0x7F800000)}, // inf
{"-0x32p+127", uint32_t(0xFF800000)}, // -inf
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float64DecodeTests, DecodeHexDoubleTest,
@@ -315,7 +315,7 @@ INSTANTIATE_TEST_CASE_P(
{"0xFFp+0", 255.},
{"0x0.8p+0", 0.5},
{"0x0.4p+0", 0.25},
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float64DecodeInfTests, DecodeHexDoubleTest,
@@ -326,7 +326,7 @@ INSTANTIATE_TEST_CASE_P(
{"0x32p+1023", uint64_t(0x7FF0000000000000)}, // inf
{"0x32p+5000", uint64_t(0x7FF0000000000000)}, // inf
{"-0x32p+1023", uint64_t(0xFFF0000000000000)}, // -inf
})),);
})));
TEST(FloatProxy, ValidConversion) {
EXPECT_THAT(FloatProxy<float>(1.f).getAsFloat(), Eq(1.0f));
@@ -495,7 +495,7 @@ INSTANTIATE_TEST_CASE_P(
{std::numeric_limits<float>::infinity(), "0x1p+128"},
{-std::numeric_limits<float>::infinity(), "-0x1p+128"},
})),);
})));
INSTANTIATE_TEST_CASE_P(
Float64Tests, FloatProxyDoubleTest,
@@ -532,7 +532,7 @@ INSTANTIATE_TEST_CASE_P(
{std::numeric_limits<double>::infinity(), "0x1p+1024"},
{-std::numeric_limits<double>::infinity(), "-0x1p+1024"},
})),);
})));
// double is used so that unbiased_exponent can be used with the output
// of ldexp directly.
@@ -793,7 +793,7 @@ INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatRoundTest,
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -129)), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToPositiveInfinity},
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -131)), std::make_pair(half_bits_set({0}), false), spvutils::kRoundToNegativeInfinity},
{static_cast<float>(ldexp(float_fractions({0, 1, 11, 13}), -130)), std::make_pair(half_bits_set({0, 9}), false), spvutils::kRoundToNearestEven},
})),);
})));
// clang-format on
struct UpCastSignificandCase {
@@ -837,7 +837,7 @@ INSTANTIATE_TEST_CASE_P(F16toF32, HexFloatRoundUpSignificandTest,
{0x0F00, 0x600000},
{0x0F01, 0x602000},
{0x0FFF, 0x7FE000},
})),);
})));
struct DownCastTest {
float source_float;
@@ -914,7 +914,7 @@ INSTANTIATE_TEST_CASE_P(F32ToF16, HexFloatFP32To16Tests,
{-std::numeric_limits<float>::infinity(), negative_infinity, {spvutils::kRoundToZero, spvutils::kRoundToPositiveInfinity, spvutils::kRoundToNegativeInfinity, spvutils::kRoundToNearestEven}},
// Nans are below because we cannot test for equality.
})),);
})));
struct UpCastCase{
uint16_t source_half;
@@ -965,7 +965,7 @@ INSTANTIATE_TEST_CASE_P(F16ToF32, HexFloatFP16To32Tests,
// inf
{0x7C00, std::numeric_limits<float>::infinity()},
{0xFC00, -std::numeric_limits<float>::infinity()},
})),);
})));
TEST(HexFloatOperationTests, NanTests) {
using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>;
@@ -1071,7 +1071,7 @@ INSTANTIATE_TEST_CASE_P(
// We can't have -1e40 and negate_value == true since
// that represents an original case of "--1e40" which
// is invalid.
}),);
}));
using ParseNormalFloat16Test =
::testing::TestWithParam<FloatParseCase<Float16>>;
@@ -1114,7 +1114,7 @@ INSTANTIATE_TEST_CASE_P(
BadFloatParseCase<Float16>("-2.0", true, uint16_t{0}),
BadFloatParseCase<Float16>("+0.0", true, uint16_t{0}),
BadFloatParseCase<Float16>("+2.0", true, uint16_t{0}),
}),);
}));
// A test case for detecting infinities.
template <typename T>
@@ -1149,7 +1149,7 @@ INSTANTIATE_TEST_CASE_P(
{"-1e40", false, -FLT_MAX},
{"1e400", false, FLT_MAX},
{"-1e400", false, -FLT_MAX},
})),);
})));
using FloatProxyParseOverflowDoubleTest =
::testing::TestWithParam<OverflowParseCase<double>>;
@@ -1176,7 +1176,7 @@ INSTANTIATE_TEST_CASE_P(
{"-1e40", true, -1e40},
{"1e400", false, DBL_MAX},
{"-1e400", false, -DBL_MAX},
})),);
})));
using FloatProxyParseOverflowFloat16Test =
::testing::TestWithParam<OverflowParseCase<uint16_t>>;
@@ -1207,7 +1207,7 @@ INSTANTIATE_TEST_CASE_P(
{"-1e38", false, uint16_t{0xfbff}},
{"-1e40", false, uint16_t{0xfbff}},
{"-1e400", false, uint16_t{0xfbff}},
})),);
})));
TEST(FloatProxy, Max) {
EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(),

View File

@@ -185,6 +185,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.depthLess.frag", "PixelShaderFunction"},
{"hlsl.discard.frag", "PixelShaderFunction"},
{"hlsl.doLoop.frag", "PixelShaderFunction"},
{"hlsl.earlydepthstencil.frag", "main"},
{"hlsl.emptystructreturn.frag", "main"},
{"hlsl.emptystructreturn.vert", "main"},
{"hlsl.emptystruct.init.vert", "main"},

View File

@@ -108,7 +108,7 @@ INSTANTIATE_TEST_CASE_P(
::testing::ValuesIn(std::vector<std::vector<std::string>>({
{"link1.vk.frag", "link2.vk.frag"},
{"spv.unit1.frag", "spv.unit2.frag", "spv.unit3.frag"},
})),
}))
);
// clang-format on

View File

@@ -101,7 +101,7 @@ INSTANTIATE_TEST_CASE_P(
{"max_vertices_0.geom"},
{"es-link1.frag", "es-link2.frag"},
{"missingBodies.vert"}
})),
}))
);
// clang-format on

View File

@@ -1869,6 +1869,9 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T
}
break;
}
case EatEarlyDepthStencil:
intermediate.setEarlyFragmentTests();
break;
case EatBuiltIn:
case EatLocation:
// tolerate these because of dual use of entrypoint and type attributes