Add tests for loops compiled with debug semantics.

This commit is contained in:
Hans-Kristian Arntzen 2023-01-11 15:18:19 +01:00
parent 07a629f149
commit 457fd3db70
5 changed files with 90 additions and 1 deletions

View File

@ -0,0 +1,26 @@
#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer SSBO
{
int v[];
} _23;
void main()
{
int i = 0;
for (;;)
{
if (i < 4)
{
_23.v[i] += 10;
i++;
continue;
}
else
{
break;
}
}
}

View File

@ -0,0 +1,26 @@
#version 450
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer SSBO
{
int v[];
} _64;
void main()
{
int i = 0;
for (;;)
{
if (i < 4)
{
_64.v[i] += 10;
i++;
continue;
}
else
{
break;
}
}
}

View File

@ -0,0 +1,16 @@
#version 450
layout(local_size_x = 1) in;
layout(set = 0, binding = 0) buffer SSBO
{
int v[];
};
void main()
{
for (int i = 0; i < 4; i++)
{
v[i] += 10;
}
}

View File

@ -0,0 +1,16 @@
#version 450
layout(local_size_x = 1) in;
layout(set = 0, binding = 0) buffer SSBO
{
int v[];
};
void main()
{
for (int i = 0; i < 4; i++)
{
v[i] += 10;
}
}

View File

@ -573,7 +573,12 @@ def cross_compile(shader, vulkan, spirv, invalid_spirv, eliminate, is_legacy, fo
if spirv:
subprocess.check_call(spirv_cmd)
else:
subprocess.check_call([paths.glslang, '--amb', '--target-env', glslang_env, '-V', '-o', spirv_path, shader])
glslang_cmd = [paths.glslang, '--amb', '--target-env', glslang_env, '-V', '-o', spirv_path, shader]
if '.g.' in shader:
glslang_cmd.append('-g')
if '.gV.' in shader:
glslang_cmd.append('-gV')
subprocess.check_call(glslang_cmd)
if opt and (not invalid_spirv):
subprocess.check_call([paths.spirv_opt, '--skip-validation', '-O', '-o', spirv_path, spirv_path])