Skip to content

Commit

Permalink
fixing some issues with s12
Browse files Browse the repository at this point in the history
  • Loading branch information
natevm committed Aug 2, 2023
1 parent 376e342 commit d3dc95a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
5 changes: 1 addition & 4 deletions gprt/gprt_lbvh.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,7 @@ GPRT_COMPUTE_PROGRAM(ComputeTriangleMortonCodes, (LBVHData, record), (1, 1, 1))
pt = (pt - aabbMin) / (aabbMax - aabbMin);

// Quantize to 10 bit
// pt = min(max(pt * 1024.f, float3(0.f, 0.f, 0.f)), float3(1023.f, 1023.f, 1023.f));

// Quantize to 4 bit
pt = min(max(pt * 16.f, float3(0.f, 0.f, 0.f)), float3(15.f, 15.f, 15.f));
pt = min(max(pt * 1024.f, float3(0.f, 0.f, 0.f)), float3(1023.f, 1023.f, 1023.f));

uint code = morton_encode3D(pt.x, pt.y, pt.z);
gprt::store<uint>(record.mortonCodes, primID, code);
Expand Down
1 change: 0 additions & 1 deletion samples/s12-swBVH/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ add_executable(s12_swBVH hostCode.cpp)
target_link_libraries(s12_swBVH
PRIVATE
s12_deviceCode
lbvhDeviceCode
gprt::gprt
tiny_obj_loader
)
Expand Down
2 changes: 0 additions & 2 deletions samples/s12-swBVH/hostCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
std::cout << GPRT_TERMINAL_DEFAULT;

extern GPRTProgram s12_deviceCode;
extern GPRTProgram lbvhDeviceCode;

// A class we'll use to quickly generate meshes and bottom level trees
template <typename T> struct Mesh {
Expand Down Expand Up @@ -112,7 +111,6 @@ main(int ac, char **av) {
gprtRequestWindow(fbSize.x, fbSize.y, "S04 Compute AABB");
GPRTContext context = gprtContextCreate(nullptr, 1);
GPRTModule module = gprtModuleCreate(context, s12_deviceCode);
GPRTModule lbvhModule = gprtModuleCreate(context, lbvhDeviceCode);

// ##################################################################
// set up all the GPU kernels we want to run
Expand Down

0 comments on commit d3dc95a

Please sign in to comment.