Skip to content

Commit

Permalink
first steps relaxing hold of push constants by gprt internals
Browse files Browse the repository at this point in the history
  • Loading branch information
natevm committed Oct 8, 2023
1 parent d3dc95a commit 29b8973
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
5 changes: 5 additions & 0 deletions gprt/gprt.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ typedef struct VkAccelerationStructureInstanceKHR {
}
VkAccelerationStructureInstanceKHR;

struct PushConstants {
uint64_t r[16];
};
[[vk::push_constant]] PushConstants pc;

[shader("compute")]
[numthreads(1, 1, 1)]
void
Expand Down
13 changes: 4 additions & 9 deletions gprt/gprt_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@

#define alignas(alignment)

struct PushConstants {
uint64_t r[16];
};
[[vk::push_constant]] PushConstants pc;
// struct PushConstants {
// uint64_t r[16];
// };
// [[vk::push_constant]] PushConstants pc;

// Descriptor binding, then set number.
// Currently, 0, N is used for textures
Expand Down Expand Up @@ -187,11 +187,6 @@ getDefaultSampler() {
return samplers[0];
}

uint32_t
getNumRayTypes() {
// for now, we map PC 0 to ray type count
return uint32_t(pc.r[0]);
}
}; // namespace gprt

/*
Expand Down

0 comments on commit 29b8973

Please sign in to comment.