Updates for final Vulkan ray tracing extensions (#2466)
* Fix traceRay/executeCallable to have id instead of constant. Update to final (non-provisional) SPIR-V capabilities (includes review feedback) - Change visibilty of findLinkerObjects. See merge request GLSL/glslang!78 * Add support for OpConvertUToAccelerationStructureKHR. GLSL : https://gitlab.khronos.org/GLSL/GLSL/-/merge_requests/60 SPV : https://gitlab.khronos.org/spirv/spirv-extensions/-/merge_requests/182 See merge request GLSL/glslang!77 * Add volatile qualifier to certain builtins for ray tracing. See merge request GLSL/glslang!81 * make gl_RayTmaxEXT volatile in intersection shader Vulkan Issue #2268 * Add testing for layouts on SBT vulkan/vulkan#2230 - no layout specified should be same as std430 - explicitly test std140, std430, scalar layouts See merge request GLSL/glslang!86 * Support for new opcodes OpIgnoreIntersectionKHR and OpTerminateRayKHR vulkan/vulkan#2374 Add support for ignoreIntersectionEXT and terminateRayEXT as block terminator statements. See merge request GLSL/glslang!87 * Fix code-generation issues with global ray query variables See merge request GLSL/glslang!88 * update dependencies for spirv-headers and tools And update mesh shader results * Fix indeterminate argument ordering Authored-by: David Neto <dneto@google.com> Co-authored-by: Ashwin Lele (NVIDIA Corporation) <alele@nvidia.com> Co-authored-by: Neslisah <Neslisah.Torosdagli@amd.com>
This commit is contained in:
parent
7f6559d280
commit
ffccefddfd
76 changed files with 4951 additions and 3663 deletions
|
|
@ -1057,8 +1057,8 @@ bool TIntermediate::userOutputUsed() const
|
|||
return found;
|
||||
}
|
||||
|
||||
// Accumulate locations used for inputs, outputs, and uniforms, and check for collisions
|
||||
// as the accumulation is done.
|
||||
// Accumulate locations used for inputs, outputs, and uniforms, payload and callable data
|
||||
// and check for collisions as the accumulation is done.
|
||||
//
|
||||
// Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
|
||||
//
|
||||
|
|
@ -1070,6 +1070,7 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||
typeCollision = false;
|
||||
|
||||
int set;
|
||||
int setRT;
|
||||
if (qualifier.isPipeInput())
|
||||
set = 0;
|
||||
else if (qualifier.isPipeOutput())
|
||||
|
|
@ -1078,11 +1079,17 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||
set = 2;
|
||||
else if (qualifier.storage == EvqBuffer)
|
||||
set = 3;
|
||||
else if (qualifier.isAnyPayload())
|
||||
setRT = 0;
|
||||
else if (qualifier.isAnyCallable())
|
||||
setRT = 1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
int size;
|
||||
if (qualifier.isUniformOrBuffer() || qualifier.isTaskMemory()) {
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable()) {
|
||||
size = 1;
|
||||
} else if (qualifier.isUniformOrBuffer() || qualifier.isTaskMemory()) {
|
||||
if (type.isSizedArray())
|
||||
size = type.getCumulativeArraySize();
|
||||
else
|
||||
|
|
@ -1110,10 +1117,17 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
|
|||
// (A vertex shader input will show using only one location, even for a dvec3/4.)
|
||||
//
|
||||
// So, for the case of dvec3, we need two independent ioRanges.
|
||||
|
||||
//
|
||||
// For raytracing IO (payloads and callabledata) each declaration occupies a single
|
||||
// slot irrespective of type.
|
||||
int collision = -1; // no collision
|
||||
#ifndef GLSLANG_WEB
|
||||
if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
|
||||
if (qualifier.isAnyPayload() || qualifier.isAnyCallable()) {
|
||||
TRange range(qualifier.layoutLocation, qualifier.layoutLocation);
|
||||
collision = checkLocationRT(setRT, qualifier.layoutLocation);
|
||||
if (collision < 0)
|
||||
usedIoRT[setRT].push_back(range);
|
||||
} else if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
|
||||
(qualifier.isPipeInput() || qualifier.isPipeOutput())) {
|
||||
// Dealing with dvec3 in/out split across two locations.
|
||||
// Need two io-ranges.
|
||||
|
|
@ -1189,6 +1203,16 @@ int TIntermediate::checkLocationRange(int set, const TIoRange& range, const TTyp
|
|||
return -1; // no collision
|
||||
}
|
||||
|
||||
int TIntermediate::checkLocationRT(int set, int location) {
|
||||
TRange range(location, location);
|
||||
for (size_t r = 0; r < usedIoRT[set].size(); ++r) {
|
||||
if (range.overlap(usedIoRT[set][r])) {
|
||||
return range.start;
|
||||
}
|
||||
}
|
||||
return -1; // no collision
|
||||
}
|
||||
|
||||
// Accumulate bindings and offsets, and check for collisions
|
||||
// as the accumulation is done.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue