Skip to content

Comments

Hlsl path tracer#224

Open
devshgraphicsprogramming wants to merge 171 commits intomasterfrom
hlsl_path_tracer
Open

Hlsl path tracer#224
devshgraphicsprogramming wants to merge 171 commits intomasterfrom
hlsl_path_tracer

Conversation

@devshgraphicsprogramming
Copy link
Member

@devshgraphicsprogramming devshgraphicsprogramming commented Nov 3, 2025

@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

TODO

  • 4 unresolved conversations from RWMC #218, check if done

// resolve
if(useRWMC)
{
// TODO: shouldn't it be computed only at initialization stage and on window resize?
Copy link
Member Author

Choose a reason for hiding this comment

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

meh, it really doesn't matter much

Comment on lines +1213 to +1214
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, pipeline->getLayout(), 0u, 1u, &m_descriptorSet0.get());
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, pipeline->getLayout(), 2u, 1u, &m_descriptorSet2.get());
Copy link
Member Author

Choose a reason for hiding this comment

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

why not just use one descriptor set ?

Copy link
Member Author

Choose a reason for hiding this comment

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

uint64_t m_realFrameIx = 0;
std::array<smart_refctd_ptr<IGPUCommandBuffer>, MaxFramesInFlight> m_cmdBufs;
ISimpleManagedSurface::SAcquireResult m_currentImageAcquire = {};
smart_refctd_ptr<IGPUDescriptorSet> m_descriptorSet0, m_descriptorSet2, m_presentDescriptorSet;
Copy link
Member Author

Choose a reason for hiding this comment

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

better names for the path tracing descriptor sets

params.shader.entryPoint = "main";
params.shader.entries = nullptr;
params.cached.requireFullSubgroups = true;
params.shader.requiredSubgroupSize = static_cast<IPipelineBase::SUBGROUP_SIZE>(5);
Copy link
Member Author

Choose a reason for hiding this comment

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

This will break on anything but Nvidia and it will break llvm-pipe

#218 (comment)

m_cascadeView = createHDRIImageView(cascade, CascadeCount, IGPUImageView::ET_2D_ARRAY);
m_cascadeView->setObjectDebugName("Cascade View");

// TODO: change cascade layout to general
Copy link
Member Author

Choose a reason for hiding this comment

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

not needed, you transition it from UNDEFINED to gENERAL every frame, that's sufficient

Comment on lines +211 to +219
#ifdef SPHERE_LIGHT
scene.light_spheres[0] = spheres[0];
#endif
#ifdef TRIANGLE_LIGHT
scene.light_triangles[0] = triangles[0];
#endif
#ifdef RECTANGLE_LIGHT
scene.light_rectangles[0] = rectangles[0];
#endif
Copy link
Member Author

Choose a reason for hiding this comment

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

have an init() method, and hide that macro crap


// mutable
scalar_type intersectionT;
ObjectID objectID;
Copy link
Member Author

Choose a reason for hiding this comment

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

to be returned in the intersection type of the intersector instead

scalar_type intersectionT;
ObjectID objectID;

Payload<T> payload;
Copy link
Member Author

Choose a reason for hiding this comment

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

the whole payload should be a template arg

Comment on lines 27 to 28
isotropic_interaction_type iso_interaction;
anisotropic_interaction_type aniso_interaction;
Copy link
Member Author

Choose a reason for hiding this comment

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

nope, aniso has iso inside it

struct SIntersectData
{
bool foundHit;
vector3_type intersection;
Copy link
Member Author

Choose a reason for hiding this comment

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

name it position


struct SIntersectData
{
bool foundHit;
Copy link
Member Author

Choose a reason for hiding this comment

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

you don't need a separate bool, you can just check the position x coordinate is NaN

return retval;
}

return_type operator()(uint32_t protoDimension, uint32_t _sample, uint32_t i)
Copy link
Member Author

Choose a reason for hiding this comment

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

what's the difference between _sample and i !?

Copy link
Member Author

Choose a reason for hiding this comment

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

and protoDimension !?

Copy link
Member Author

Choose a reason for hiding this comment

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

write comments about what they all mean, because right now its hard to remember

This is the mental effort I have to go to:

if protoDimension is supposed to be a LSB offset in the same sequence, and the _sample does MSB

but also the protoDimension doesn't have clear documented semantics

I also don't get what i is, its kinda like a sub-dimension or something

But your RawBufferLoad loads 3 dimensions at once.. so what is what!?

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.

5 participants