glslang/Test/spv.nv.hitobject-errors.rgen
dTry 7c4d91e781
Add type checks for hitObjectNV (#3689)
`VK_NV_ray_tracing_invocation_reorder` extension introduces `hitObjectNV`, a special opaque type
that can only be declared without storage qualifiers in either global or function scope.
Added checks/tests to enforce this constraint.

References:
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_ray_tracing_invocation_reorder.html
3e0d9a3b3f/extensions/nv/GLSL_NV_shader_invocation_reorder.txt (L180)

Co-authored-by: Tianyun <tianyuny@nvidia.com>
2024-08-08 08:21:00 -06:00

25 lines
612 B
Plaintext

#version 460
#extension GL_EXT_ray_tracing : enable
#extension GL_NV_shader_invocation_reorder : enable
hitObjectNV hObjGlob; // OK
uniform hitObjectNV uHitObj; // ERROR
layout(location=0) in hitObjectNV hobjIn; // ERROR
out hitObjectNV hobjOut; // ERROR
struct hObjWrapper{
hitObjectNV objField;
vec3 v;
};
void foo(hitObjectNV hObjArg) {} // OK
void main()
{
hObjWrapper wrapper; // ERROR
hitObjectNV localHitObj; // OK
foo(localHitObj); // OK
}