-
Notifications
You must be signed in to change notification settings - Fork 15
Adds tests for the new Morton Code class #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
CMakeLists.txt
Outdated
|
|
||
| add_subdirectory(70_FLIPFluids) | ||
| add_subdirectory(71_RayTracingPipeline) | ||
| add_subdirectory(73_Mortons EXCLUDE_FROM_ALL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually can you make it example 14 or 15 because the low numbers is where I keep basic HLSL/C++
| /* | ||
| void fillSecondTestValues(NBL_CONST_REF_ARG(InputTestValues) input) | ||
| { | ||
| uint64_t2 Vec2A = { input.coordX, input.coordY }; | ||
| uint64_t2 Vec2B = { input.coordZ, input.coordW }; | ||
|
|
||
| uint64_t3 Vec3A = { input.coordX, input.coordY, input.coordZ }; | ||
| uint64_t3 Vec3B = { input.coordY, input.coordZ, input.coordW }; | ||
|
|
||
| uint64_t4 Vec4A = { input.coordX, input.coordY, input.coordZ, input.coordW }; | ||
| uint64_t4 Vec4B = { input.coordY, input.coordZ, input.coordW, input.coordX }; | ||
|
|
||
| int64_t2 Vec2ASigned = int64_t2(Vec2A); | ||
| int64_t2 Vec2BSigned = int64_t2(Vec2B); | ||
|
|
||
| int64_t3 Vec3ASigned = int64_t3(Vec3A); | ||
| int64_t3 Vec3BSigned = int64_t3(Vec3B); | ||
|
|
||
| int64_t4 Vec4ASigned = int64_t4(Vec4A); | ||
| int64_t4 Vec4BSigned = int64_t4(Vec4B); | ||
|
|
||
| morton::code<false, fullBits_4, 4, emulated_uint64_t> morton_emulated_4A = morton::code<false, fullBits_4, 4, emulated_uint64_t>::create(Vec4A); | ||
| morton::code<true, fullBits_2, 2, emulated_uint64_t> morton_emulated_2_signed = morton::code<true, fullBits_2, 2, emulated_uint64_t>::create(Vec2ASigned); | ||
| morton::code<true, fullBits_3, 3, emulated_uint64_t> morton_emulated_3_signed = morton::code<true, fullBits_3, 3, emulated_uint64_t>::create(Vec3ASigned); | ||
| morton::code<true, fullBits_4, 4, emulated_uint64_t> morton_emulated_4_signed = morton::code<true, fullBits_4, 4, emulated_uint64_t>::create(Vec4ASigned); | ||
|
|
||
| output.mortonEqual_emulated_4 = uint32_t4(morton_emulated_4A.equal<false>(uint16_t4(Vec4B))); | ||
|
|
||
| output.mortonUnsignedLess_emulated_4 = uint32_t4(morton_emulated_4A.lessThan<false>(uint16_t4(Vec4B))); | ||
|
|
||
| mortonSignedLess_emulated_2 = uint32_t2(morton_emulated_2_signed.lessThan<false>(int32_t2(Vec2BSigned))); | ||
| mortonSignedLess_emulated_3 = uint32_t3(morton_emulated_3_signed.lessThan<false>(int32_t3(Vec3BSigned))); | ||
| mortonSignedLess_emulated_4 = uint32_t4(morton_emulated_4_signed.lessThan<false>(int16_t4(Vec4BSigned))); | ||
|
|
||
| uint16_t castedShift = uint16_t(input.shift); | ||
|
|
||
| arithmetic_right_shift_operator<morton::code<true, fullBits_2, 2, emulated_uint64_t> > rightShiftSignedEmulated2; | ||
| mortonSignedRightShift_emulated_2 = rightShiftSignedEmulated2(morton_emulated_2_signed, castedShift); | ||
| arithmetic_right_shift_operator<morton::code<true, fullBits_3, 3, emulated_uint64_t> > rightShiftSignedEmulated3; | ||
| mortonSignedRightShift_emulated_3 = rightShiftSignedEmulated3(morton_emulated_3_signed, castedShift); | ||
| arithmetic_right_shift_operator<morton::code<true, fullBits_4, 4, emulated_uint64_t> > rightShiftSignedEmulated4; | ||
| mortonSignedRightShift_emulated_4 = rightShiftSignedEmulated4(morton_emulated_4_signed, castedShift); | ||
| } | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fletterio whats this commented out block about ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was some fucked up reason that was preventing me from running all tests in a single shader (likely some DXC bug) so I think I was in the middle of moving the commented code to a different shader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so bug no longer there and we can remove this commented block of code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug is probably still there, I thought I had reported it but it seems not. These are tests that if for some reason you add them to testCommon.hlsl it will fail to compile. I had temporarily commented them out here and the idea was to have many different test shaders so these could be tested apart. Specifically these would be tests for comparison operators for a 4D morton with 16bits per coord stored in an emulated uint64, and tests for the arithmetic right shift operator for a 2D, 3D or 4D morton backed by an emulated uint64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then coordinate with @kevyuu to reproduce the bug and file it with DXC, make sure you use latest DXC from master though
| #ifndef __HLSL_VERSION | ||
|
|
||
| constexpr uint64_t smallBitsMask_2 = (uint64_t(1) << smallBits_2) - 1; | ||
| constexpr uint64_t mediumBitsMask_2 = (uint64_t(1) << mediumBits_2) - 1; | ||
| constexpr uint64_t fullBitsMask_2 = (uint64_t(1) << fullBits_2) - 1; | ||
|
|
||
| constexpr uint64_t smallBitsMask_3 = (uint64_t(1) << smallBits_3) - 1; | ||
| constexpr uint64_t mediumBitsMask_3 = (uint64_t(1) << mediumBits_3) - 1; | ||
| constexpr uint64_t fullBitsMask_3 = (uint64_t(1) << fullBits_3) - 1; | ||
|
|
||
| constexpr uint64_t smallBitsMask_4 = (uint64_t(1) << smallBits_4) - 1; | ||
| constexpr uint64_t mediumBitsMask_4 = (uint64_t(1) << mediumBits_4) - 1; | ||
| constexpr uint64_t fullBitsMask_4 = (uint64_t(1) << fullBits_4) - 1; | ||
|
|
||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these variables used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No clue what I had in mind here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok @kevyuu delete them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are used in CTester.h, CTester::performTests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok can you move them closer to where they're being used ?
Checks that the arithmetic and comparisons work as expected + checks it compiles for GPU