Skip to content

Conversation

@devshgraphicsprogramming
Copy link
Member

@keptsecret after you merge master again, you'll probably have the UI mess up and show changed from the merge commit, so close and reopen again

Comment on lines 62 to 84
static this_t create(
NBL_CONST_REF_ARG(Shape<PST_SPHERE>) spheres[SCENE_SPHERE_COUNT],
NBL_CONST_REF_ARG(Shape<PST_TRIANGLE>) triangles[SCENE_TRIANGLE_COUNT],
NBL_CONST_REF_ARG(Shape<PST_RECTANGLE>) rectangles[SCENE_RECTANGLE_COUNT],
uint32_t sphereCount, uint32_t triangleCount, uint32_t rectangleCount,
NBL_CONST_REF_ARG(light_type) lights[LIGHT_COUNT], uint32_t lightCount,
NBL_CONST_REF_ARG(bxdfnode_type) bxdfs[BXDF_COUNT], uint32_t bxdfCount)
{
this_t retval;
retval.spheres = spheres;
retval.triangles = triangles;
retval.rectangles = rectangles;
retval.sphereCount = sphereCount;
retval.triangleCount = triangleCount;
retval.rectangleCount = rectangleCount;

retval.lights = lights;
retval.lightCount = lightCount;

retval.bxdfs = bxdfs;
retval.bxdfCount = bxdfCount;
return retval;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we wont be needing this

CMakeLists.txt Outdated
# Showcase compute pathtracing
add_subdirectory(30_ComputeShaderPathTracer)

add_subdirectory(31_HLSLPathTracer EXCLUDE_FROM_ALL)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove EXCLUDE_FROM_ALL I want CI running on this before we merge

Comment on lines 16 to 19
[[vk::binding(1, 2)]] Buffer<uint3> sampleSequence;

[[vk::combinedImageSampler]][[vk::binding(2, 2)]] Texture2D<uint2> scramblebuf; // unused
[[vk::combinedImageSampler]][[vk::binding(2, 2)]] SamplerState scrambleSampler;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sampleSequence should just be a BDA provided via push constant of QuantizedSequence (3 21bit unorms packed into a struct of size 8 and alignment 4)

Comment on lines +7 to +8
int sampleCount;
int depth;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you add the BDA for sample sequence then you'll have just enough Push Constants left to add a float32_t3x4 for the light transform


[[vk::binding(1, 2)]] Buffer<uint3> sampleSequence;

[[vk::combinedImageSampler]][[vk::binding(2, 2)]] Texture2D<uint2> scramblebuf; // unused
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the scramble buffer, it will allow us to do stuff like key-exchanges to attempt to get Blue Noise (as per some Heitz papers)

Comment on lines 19 to 23
struct PTPushConstant {
matrix4SIMD invMVP;
int sampleCount;
int depth;
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the same struct as in your render_common.hlsl

using namespace nbl;
using namespace hlsl;

NBL_CONSTEXPR uint32_t WorkgroupSize = 512;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optimal is 64 due to not holding up everything with divergence (lots of small WGs in the same SM co-reisdent)

btw this needs to be in shared header

Comment on lines 45 to 46
NBL_CONSTEXPR uint32_t MAX_DEPTH_LOG2 = 4;
NBL_CONSTEXPR uint32_t MAX_SAMPLES_LOG2 = 10;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shared header!

Comment on lines 17 to 36
#ifdef SPHERE_LIGHT
#define SPHERE_COUNT 9
#define TRIANGLE_COUNT 0
#define RECTANGLE_COUNT 0
#endif

#ifdef TRIANGLE_LIGHT
#define TRIANGLE_COUNT 1
#define SPHERE_COUNT 8
#define RECTANGLE_COUNT 0
#endif

#ifdef RECTANGLE_LIGHT
#define RECTANGLE_COUNT 1
#define SPHERE_COUNT 8
#define TRIANGLE_COUNT 0
#endif

#define LIGHT_COUNT 1
#define BXDF_COUNT 7
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want this baked in STATIC_INLINE_CONSTEXPR in 3 different scenes

Comment on lines 49 to 58
constexpr static inline uint32_t2 WindowDimensions = { 1280, 720 };
constexpr static inline uint32_t MaxFramesInFlight = 5;
constexpr static inline clock_t::duration DisplayImageDuration = std::chrono::milliseconds(900);
constexpr static inline uint32_t DefaultWorkGroupSize = 512u;
constexpr static inline uint32_t MaxDescriptorCount = 256u;
constexpr static inline uint32_t MaxDepthLog2 = 4u; // 5
constexpr static inline uint32_t MaxSamplesLog2 = 10u; // 18
constexpr static inline uint32_t MaxBufferDimensions = 3u << MaxDepthLog2;
constexpr static inline uint32_t MaxBufferSamples = 1u << MaxSamplesLog2;
constexpr static inline uint8_t MaxUITextureCount = 1u;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lot of this stuff should be in shared header between HLSL and C++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants