KhronosGroup / KhronosGroup/glslang

raypayloadNV usage warning

Open
#1,638 2 comments 0 reactions 0 assignees View on GitHub
GLSL/ESSL question
Dominant language
C++
Stars
3.6k
Forks
989
Avg merge
1d 2h
Merged PRs (30d)
31

Description

Hello, I had this the following rchit shader:
```
#version 460
#extension GL_NV_ray_tracing : require

struct HitInfo
{
vec4 color_dist;
};

layout(location = 0) rayPayloadNV HitInfo payload;
hitAttributeNV vec2 bary;

void main()
{
vec3 barys = vec3(1.0f - bary.x - bary.y, bary.x, bary.y);

const vec3 A = vec3(1.0, 0.0, 0.0);
const vec3 B = vec3(0.0, 1.0, 0.0);
const vec3 C = vec3(0.0, 0.0, 1.0);
vec3 hit_color = A * barys.x + B * barys.y + C * barys.z;
payload.color_dist = vec4(hit_color, 0.0);
}
```
The code compiles without warnings with glslValidator.exe but the driver crashes on
vkCreateRayTracingPipelinesNV without any validation warning.
The right thing to do was to use rayPayloadInNV.
Can the glslValidator catch such issues?

**glslValidator version**:
Glslang Version: 7.10.2984
ESSL Version: OpenGL ES GLSL 3.20 glslang Khronos. 10.2984
GLSL Version: 4.60 glslang Khronos. 10.2984
SPIR-V Version 0x00010300, Revision 1
GLSL.std.450 Version 100, Revision 1
Khronos Tool ID 8
SPIR-V Generator Version 7
GL_KHR_vulkan_glsl version 100
ARB_GL_gl_spirv version 100

Contributor guide

Open the contributing guide

Research direction

Start with the shader sample and the glslValidator entry point, then inspect how rayPayloadNV and rayPayloadInNV declarations are handled for NV ray tracing. Reproduce the compilation and pipeline-creation behavior, and compare the generated validation diagnostics. Done means the invalid declaration is caught with a clear validator warning or error before vkCreateRayTracingPipelinesNV.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.