Update test suite for latest glslang.

This commit is contained in:
Hans-Kristian Arntzen 2016-09-10 12:52:23 +02:00
parent bf41aeccb3
commit b6847168b2
16 changed files with 45 additions and 23 deletions

View File

@ -55,7 +55,11 @@ void main()
meow(param_1);
foo = param_1;
Foo param_2 = foo;
Foo param_3 = foobar.foos[gl_GlobalInvocationID.x];
Foo param_3;
param_3.a = foobar.foos[gl_GlobalInvocationID.x].a;
param_3.b = foobar.foos[gl_GlobalInvocationID.x].b;
param_3.c = foobar.foos[gl_GlobalInvocationID.x].c;
param_3.d = foobar.foos[gl_GlobalInvocationID.x].d;
outdata.data[gl_GlobalInvocationID.x] = (bar(param_2) + bar(param_3));
}

View File

@ -19,12 +19,12 @@ layout(binding = 0, std430) buffer SSBO0
layout(binding = 1, std430) buffer SSBO1
{
S1 s1s[];
} _53;
} _55;
layout(binding = 2, std430) buffer SSBO2
{
vec4 outputs[];
} _62;
} _66;
vec4 overload(S0 s0)
{
@ -38,10 +38,12 @@ vec4 overload(S1 s1)
void main()
{
S0 s0 = _36.s0s[gl_GlobalInvocationID.x];
S1 s1 = _53.s1s[gl_GlobalInvocationID.x];
S0 s0;
s0.a = _36.s0s[gl_GlobalInvocationID.x].a;
S1 s1;
s1.a = _55.s1s[gl_GlobalInvocationID.x].a;
S0 param = s0;
S1 param_1 = s1;
_62.outputs[gl_GlobalInvocationID.x] = (overload(param) + overload(param_1));
_66.outputs[gl_GlobalInvocationID.x] = (overload(param) + overload(param_1));
}

View File

@ -44,14 +44,15 @@ layout(binding = 1) uniform mediump sampler2D TexLOD;
layout(binding = 0) uniform mediump sampler2D TexHeightmap;
layout(location = 1) in vec4 LODWeights;
uniform int SPIRV_Cross_BaseInstance;
layout(location = 0) in vec2 Position;
layout(location = 1) out vec3 EyeVec;
layout(location = 0) out vec2 TexCoord;
vec2 warp_position()
{
float vlod = dot(LODWeights, _284.Patches[gl_InstanceID].LODs);
vlod = mix(vlod, _284.Patches[gl_InstanceID].Position.w, all(equal(LODWeights, vec4(0.0))));
float vlod = dot(LODWeights, _284.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].LODs);
vlod = mix(vlod, _284.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].Position.w, all(equal(LODWeights, vec4(0.0))));
float floor_lod = floor(vlod);
float fract_lod = (vlod - floor_lod);
uint ufloor_lod = uint(floor_lod);
@ -93,7 +94,7 @@ vec2 lod_factor(vec2 uv)
void main()
{
vec2 PatchPos = (_284.Patches[gl_InstanceID].Position.xz * _381.InvGroundSize_PatchScale.zw);
vec2 PatchPos = (_284.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].Position.xz * _381.InvGroundSize_PatchScale.zw);
vec2 WarpedPos = warp_position();
vec2 VertexPos = (PatchPos + WarpedPos);
vec2 NormalizedPos = (VertexPos * _381.InvGroundSize_PatchScale.xy);

View File

@ -45,14 +45,15 @@ layout(binding = 1) uniform mediump sampler2D TexLOD;
layout(binding = 0) uniform mediump sampler2D TexDisplacement;
layout(location = 1) in vec4 LODWeights;
uniform int SPIRV_Cross_BaseInstance;
layout(location = 0) in vec4 Position;
layout(location = 0) out vec3 EyeVec;
layout(location = 1) out vec4 TexCoord;
vec2 warp_position()
{
float vlod = dot(LODWeights, _284.Patches[gl_InstanceID].LODs);
vlod = mix(vlod, _284.Patches[gl_InstanceID].Position.w, all(equal(LODWeights, vec4(0.0))));
float vlod = dot(LODWeights, _284.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].LODs);
vlod = mix(vlod, _284.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].Position.w, all(equal(LODWeights, vec4(0.0))));
float floor_lod = floor(vlod);
float fract_lod = (vlod - floor_lod);
uint ufloor_lod = uint(floor_lod);
@ -114,7 +115,7 @@ vec2 lod_factor(vec2 uv)
void main()
{
vec2 PatchPos = (_284.Patches[gl_InstanceID].Position.xz * _405.InvOceanSize_PatchScale.zw);
vec2 PatchPos = (_284.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].Position.xz * _405.InvOceanSize_PatchScale.zw);
vec2 WarpedPos = warp_position();
vec2 VertexPos = (PatchPos + WarpedPos);
vec2 NormalizedPos = (VertexPos * _405.InvOceanSize_PatchScale.xy);

View File

@ -1,4 +1,6 @@
#version 310 es
// This shader currently breaks in glslang (issue #506).
// Will not be part of test suite again until issue is resolved.
layout(local_size_x = 1) in;
struct S0

View File

@ -140,10 +140,16 @@ vec2 lod_factor(vec2 uv)
return vec2(floor_level, fract_level);
}
#ifdef VULKAN
#define INSTANCE_ID gl_InstanceIndex
#else
#define INSTANCE_ID gl_InstanceID
#endif
vec2 warp_position()
{
float vlod = dot(LODWeights, Patches[gl_InstanceID].LODs);
vlod = mix(vlod, Patches[gl_InstanceID].Position.w, all(equal(LODWeights, vec4(0.0))));
float vlod = dot(LODWeights, Patches[INSTANCE_ID].LODs);
vlod = mix(vlod, Patches[INSTANCE_ID].Position.w, all(equal(LODWeights, vec4(0.0))));
#ifdef DEBUG_LOD_HEIGHT
LODFactor = vec4(vlod);
@ -171,7 +177,7 @@ vec2 warp_position()
void main()
{
vec2 PatchPos = Patches[gl_InstanceID].Position.xz * InvGroundSize_PatchScale.zw;
vec2 PatchPos = Patches[INSTANCE_ID].Position.xz * InvGroundSize_PatchScale.zw;
vec2 WarpedPos = warp_position();
vec2 VertexPos = PatchPos + WarpedPos;
vec2 NormalizedPos = VertexPos * InvGroundSize_PatchScale.xy;

View File

@ -141,10 +141,16 @@ vec2 lod_factor(vec2 uv)
return vec2(floor_level, fract_level);
}
#ifdef VULKAN
#define INSTANCE_ID gl_InstanceIndex
#else
#define INSTANCE_ID gl_InstanceID
#endif
vec2 warp_position()
{
float vlod = dot(LODWeights, Patches[gl_InstanceID].LODs);
vlod = mix(vlod, Patches[gl_InstanceID].Position.w, all(equal(LODWeights, vec4(0.0))));
float vlod = dot(LODWeights, Patches[INSTANCE_ID].LODs);
vlod = mix(vlod, Patches[INSTANCE_ID].Position.w, all(equal(LODWeights, vec4(0.0))));
float floor_lod = floor(vlod);
float fract_lod = vlod - floor_lod;
@ -166,7 +172,7 @@ vec2 warp_position()
void main()
{
vec2 PatchPos = Patches[gl_InstanceID].Position.xz * InvOceanSize_PatchScale.zw;
vec2 PatchPos = Patches[INSTANCE_ID].Position.xz * InvOceanSize_PatchScale.zw;
vec2 WarpedPos = warp_position();
vec2 VertexPos = PatchPos + WarpedPos;
vec2 NormalizedPos = VertexPos * InvOceanSize_PatchScale.xy;

View File

@ -79,7 +79,7 @@ def cross_compile(shader, vulkan, spirv, eliminate):
if spirv:
subprocess.check_call(['spirv-as', '-o', spirv_path, shader])
else:
subprocess.check_call(['glslangValidator', '-V' if vulkan else '-G', '-o', spirv_path, shader])
subprocess.check_call(['glslangValidator', '-V', '-o', spirv_path, shader])
# Workaround Issue #217 in SPIRV-Tools until the issue is resolved.
#if spirv:
@ -166,13 +166,13 @@ def test_shader(stats, shader, update, keep):
vulkan = shader_is_vulkan(shader[1])
desktop = shader_is_desktop(shader[1])
eliminate = shader_is_eliminate_dead_variables(shader[1])
spirv = shader_is_spirv(shader[1])
is_spirv = shader_is_spirv(shader[1])
print('Testing shader:', joined_path)
spirv, glsl, vulkan_glsl = cross_compile(joined_path, vulkan, spirv, eliminate)
spirv, glsl, vulkan_glsl = cross_compile(joined_path, vulkan, is_spirv, eliminate)
# Only test GLSL stats if we have a shader following GL semantics.
if stats and (not vulkan) and (not spirv) and (not desktop):
if stats and (not vulkan) and (not is_spirv) and (not desktop):
cross_stats = get_shader_stats(glsl)
regression_check(shader, glsl, update, keep)
@ -180,7 +180,7 @@ def test_shader(stats, shader, update, keep):
regression_check((shader[0], shader[1] + '.vk'), vulkan_glsl, update, keep)
os.remove(spirv)
if stats and (not vulkan):
if stats and (not vulkan) and (not is_spirv) and (not desktop):
pristine_stats = get_shader_stats(joined_path)
a = []