Skip to content

Commit 3339a38

Browse files
committed
Fix compiler warnings
1 parent 8239404 commit 3339a38

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

docs/own/gpu-shader-debug.md

+21
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,24 @@ We build this Type during shader patching.
114114
For OpLine candidates for the breakpoint, remember the start of their
115115
function. When we have our selected candidate, evaluate all OpVariable
116116
values in that function (that came before the OpLine instruction itself).
117+
118+
---
119+
120+
For raytracing commands, we have to hook the shader table.
121+
Do it like this:
122+
- RayTracingPipeline has a unordered_map<RTGroupHandleBuf, u32>
123+
that maps the RTGroupHandleBuf identifier (dyn-sized u32[] buffer)
124+
to the groupID
125+
- Our patched RT pipeline has retrieved all handles and knows
126+
which groups need to be overwritten
127+
- when hook-recording dispatchRays command, first create a hooked
128+
copy of the shader table
129+
- allocate ownBuf large enough
130+
- run compute shader, one thread per group
131+
thread compares its group with all groups that need to be replaced
132+
and does so, if needed. If not, just copies the group.
133+
- barrier!
134+
- then dispatch rays with our own shaderTable.
135+
- maybe abort when the hooked shader table would get too large?
136+
maybe cache this somehow? could be major bottleneck for
137+
large shader tables.

src/util/patch.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ struct ShaderPatch {
155155
u32 typeUint3 = u32(-1);
156156
u32 typeBool3 = u32(-1);
157157

158-
LinAllocator alloc;
158+
LinAllocator alloc {};
159159

160160
template<spv::Op Op>
161161
DeclInstrBuilder decl() {
@@ -338,6 +338,7 @@ struct VariableCapture {
338338
};
339339

340340
bool supportedForCapture(ShaderPatch& patch, const spc::SPIRType& type) {
341+
(void) patch;
341342
return type.basetype >= spc::SPIRType::Boolean &&
342343
type.basetype != spc::SPIRType::AtomicCounter &&
343344
type.basetype <= spc::SPIRType::Struct;
@@ -809,12 +810,18 @@ vku::Pipeline createPatchCopy(const ComputePipeline& src, VkShaderStageFlagBits
809810

810811
vku::Pipeline createPatchCopy(const GraphicsPipeline& src, VkShaderStageFlagBits stage,
811812
span<const u32> patchedSpv) {
813+
(void) src;
814+
(void) stage;
815+
(void) patchedSpv;
812816
dlg_error("unimplemented");
813817
return {};
814818
}
815819

816820
vku::Pipeline createPatchCopy(const RayTracingPipeline& src, VkShaderStageFlagBits stage,
817821
span<const u32> patchedSpv) {
822+
(void) src;
823+
(void) stage;
824+
(void) patchedSpv;
818825
dlg_error("unimplemented");
819826
return {};
820827
}

0 commit comments

Comments
 (0)