mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-09 22:00:05 +00:00
Add reflection support for ray tracing acceleration structures
This commit is contained in:
parent
524bd43deb
commit
b2a667520d
9
shaders-reflection/rgen/acceleration_structure.vk.rgen
Normal file
9
shaders-reflection/rgen/acceleration_structure.vk.rgen
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#version 460
|
||||||
|
#extension GL_NV_ray_tracing : require
|
||||||
|
|
||||||
|
layout(set = 0, binding = 1) uniform accelerationStructureNV as;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
traceNV(as, 0u, 255u, 0u, 1u, 0u, vec3(0.0), 0.0, vec3(1.0), 1000.0, 0);
|
||||||
|
}
|
@ -820,6 +820,11 @@ ShaderResources Compiler::get_shader_resources(const unordered_set<uint32_t> *ac
|
|||||||
{
|
{
|
||||||
res.atomic_counters.push_back({ var.self, var.basetype, type.self, get_name(var.self) });
|
res.atomic_counters.push_back({ var.self, var.basetype, type.self, get_name(var.self) });
|
||||||
}
|
}
|
||||||
|
// Acceleration structures
|
||||||
|
else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::AccelerationStructureNV)
|
||||||
|
{
|
||||||
|
res.acceleration_structures.push_back({ var.self, var.basetype, type.self, get_name(var.self) });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -62,6 +62,7 @@ struct ShaderResources
|
|||||||
std::vector<Resource> storage_images;
|
std::vector<Resource> storage_images;
|
||||||
std::vector<Resource> sampled_images;
|
std::vector<Resource> sampled_images;
|
||||||
std::vector<Resource> atomic_counters;
|
std::vector<Resource> atomic_counters;
|
||||||
|
std::vector<Resource> acceleration_structures;
|
||||||
|
|
||||||
// There can only be one push constant block,
|
// There can only be one push constant block,
|
||||||
// but keep the vector in case this restriction is lifted in the future.
|
// but keep the vector in case this restriction is lifted in the future.
|
||||||
|
@ -436,6 +436,7 @@ void CompilerReflection::emit_resources()
|
|||||||
emit_resources("ubos", res.uniform_buffers);
|
emit_resources("ubos", res.uniform_buffers);
|
||||||
emit_resources("push_constants", res.push_constant_buffers);
|
emit_resources("push_constants", res.push_constant_buffers);
|
||||||
emit_resources("counters", res.atomic_counters);
|
emit_resources("counters", res.atomic_counters);
|
||||||
|
emit_resources("acceleration_structures", res.acceleration_structures);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerReflection::emit_resources(const char *tag, const vector<Resource> &resources)
|
void CompilerReflection::emit_resources(const char *tag, const vector<Resource> &resources)
|
||||||
|
Loading…
Reference in New Issue
Block a user