glslang/Test/spv.ext.World3x4.rahit
2020-07-13 00:35:58 -06:00

22 lines
505 B
Plaintext

#version 460
#extension GL_EXT_ray_tracing : enable
hitAttributeEXT vec3 attribs;
layout(location = 0) rayPayloadInEXT vec3 hitValue;
layout(set = 0, binding = 0, r32i) uniform iimage3D result;
void main()
{
float k = 1048576.0f;
int ndx = -1;
for (int col = 0; col < 3; col++)
for (int row = 0; row < 4; row++)
{
ndx++;
ivec3 p = ivec3(gl_LaunchIDEXT.xy, ndx);
float r = k * gl_WorldToObject3x4EXT[col][row];
ivec4 c = ivec4(int(r),0,0,1);
imageStore(result, p, c);
}
}