Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raytracing Intrinsics do not work in presence of GL_EXT_spirv_intrinsics extension #2935

Closed
alelenv opened this issue Apr 29, 2022 · 1 comment · Fixed by #2940
Closed

Raytracing Intrinsics do not work in presence of GL_EXT_spirv_intrinsics extension #2935

alelenv opened this issue Apr 29, 2022 · 1 comment · Fixed by #2940
Assignees

Comments

@alelenv
Copy link
Contributor

alelenv commented Apr 29, 2022

Following legal shader fails to compile

#version 460
#extension GL_EXT_ray_tracing : enable
#extension GL_EXT_spirv_intrinsics: enable

layout(binding = 0) buffer block {
vec2 op;
};
layout ( binding = 1) uniform accelerationStructureEXT as;
layout ( location = 1) rayPayloadEXT vec2 pay;

void main()
{
traceRayEXT(as , 0xff , 0xff , 1U , 1, 1, vec3(0.5), 0.0, vec3(1.5),1.0f, 1);
op += pay;

}

This is because in layoutTypeCheck : ParseHelper.cpp, all error checks are disabled when extension is enabled (which seems a bit too prohibitive in first place)

The issue is because raytracing intrinsics like traceRayEXT, executeCallableEXT have last argument has location id which is mapped to actual variable during spirv translation and this map is populated in above function

We need to move this code to some non error check function
I plan to have a fix

@alelenv
Copy link
Contributor Author

alelenv commented May 6, 2022

this map is populated in above function

My memory failed me and I forgot we don't really map this in ParseHelper, but do a separate walk over linker objects in collectRayTracingObjects to populate the locationToSymbol map

Given we have just disabled error checking for layout qualifier related errors in presence of this extension, I am going to go with this logic and disable the error check.

I do think the outright disabling of error checks is a bit too restrictive, so long term we should look into relaxing that

Fix in flight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants