GLSL: Add more test shaders for hit attribute types.

This commit is contained in:
Hans-Kristian Arntzen 2020-05-20 14:59:11 +02:00
parent 66ec3e3e54
commit b4dd0b6fb1
12 changed files with 206 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo
{
float a;
float b;
};
struct Foo2
{
float a;
float b;
};
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo2 hit;
void main()
{
payload.a = hit.a;
payload.b = hit.b;
}

View File

@ -0,0 +1,24 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo
{
float a;
float b;
};
struct Foo2
{
float a;
float b;
};
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo2 hit;
void main()
{
payload.a = hit.a;
payload.b = hit.b;
}

View File

@ -0,0 +1,11 @@
#version 460
#extension GL_NV_ray_tracing : require
layout(location = 0) rayPayloadInNV vec2 payload;
hitAttributeNV vec2 hit;
void main()
{
payload = hit;
}

View File

@ -0,0 +1,17 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo
{
float a;
float b;
};
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo hit;
void main()
{
payload = hit;
}

View File

@ -0,0 +1,24 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo
{
float a;
float b;
};
struct Foo2
{
float a;
float b;
};
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo2 hit;
void main()
{
payload.a = hit.a;
payload.b = hit.b;
}

View File

@ -0,0 +1,29 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo
{
float a;
float b;
};
struct Foo2
{
float a;
float b;
};
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo2 hit;
void in_function()
{
payload.a = hit.a;
payload.b = hit.b;
}
void main()
{
in_function();
}

View File

@ -0,0 +1,11 @@
#version 460
#extension GL_NV_ray_tracing : require
layout(location = 0) rayPayloadInNV vec2 payload;
hitAttributeNV vec2 hit;
void main()
{
payload = hit;
}

View File

@ -0,0 +1,17 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo
{
float a;
float b;
};
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo hit;
void main()
{
payload = hit;
}

View File

@ -0,0 +1,11 @@
#version 460
#extension GL_NV_ray_tracing : require
layout(location = 0) rayPayloadInNV Foo { float a; float b; } payload;
hitAttributeNV Foo2 { float a; float b; } hit;
void main()
{
payload.a = hit.a;
payload.b = hit.b;
}

View File

@ -0,0 +1,16 @@
#version 460
#extension GL_NV_ray_tracing : require
layout(location = 0) rayPayloadInNV Foo { float a; float b; } payload;
hitAttributeNV Foo2 { float a; float b; } hit;
void in_function()
{
payload.a = hit.a;
payload.b = hit.b;
}
void main()
{
in_function();
}

View File

@ -0,0 +1,10 @@
#version 460
#extension GL_NV_ray_tracing : require
layout(location = 0) rayPayloadInNV vec2 payload;
hitAttributeNV vec2 hit;
void main()
{
payload = hit;
}

View File

@ -0,0 +1,12 @@
#version 460
#extension GL_NV_ray_tracing : require
struct Foo { float a; float b; };
layout(location = 0) rayPayloadInNV Foo payload;
hitAttributeNV Foo hit;
void main()
{
payload = hit;
}