-
Notifications
You must be signed in to change notification settings - Fork 28
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
Improving SBT API #94
base: master
Are you sure you want to change the base?
Conversation
Rigid particles from triangles fixed Toggle rigid particles
Indices & vertices accessible + proper triangle shading
Debugging CDF states working again Fixed normals Modifying color management
Activated penalty force again
…orm + rigid particle geometry dettached from fluid particles (BLAS) CDF was broken
…flag 2 way coupled. Rotation??
Trying to add Rigid Body to slang. It compiles but it still lacks a lot of logic. Fixed bug int to float conversion RT slang completed Adapting Rigid Body code to slang Adapted rigid code for slang (not working yet). Slang: rasterize rigid bound fixed Cleaning up 2-way couple seems to work (trying to fix rigid physics) Fixed boundary check
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.
Hi @Jaisiero I would like to understand why the create default sbt function now constructs multiple buffers, one for each "region". I would like to know why this is, and if it makes sense, why the create default sbt also returns a buffer
This does not explain why there are multiple buffers. Also, the buffer that contains the shader handles absolutely should not be a host buffer as it currently is. Either way, though, there should only be a SINGLE buffer created, with the function just returning the single buffer and the strided device address regions. Note: the API has this, where there is both a buffer output in the function signature, but also a buffer output within the entries struct which is also a result of the same function. typedef struct
{
daxa_BufferId buffer;
daxa_SpanToConst(daxa_GroupRegionInfo) group_regions;
} daxa_RayTracingShaderBindingTableEntries;
DAXA_EXPORT daxa_Result
daxa_ray_tracing_pipeline_create_sbt(
daxa_RayTracingPipeline pipeline,
daxa_RayTracingShaderBindingTableEntries * out_sbts, daxa_BufferId * out_buffer,
daxa_BuildShaderBindingTableInfo const * info); |
this appears to be a copy+paste error and I would like you to completely review the changes you've made because it does not seem complete or tested. It appears that the buffer is created twice with the same size (but computed completely differently) // Allocate a buffer for storing the SBT.
auto sbt_info = daxa_BufferInfo{
.size = current_offset,
.allocate_info = DAXA_MEMORY_FLAG_HOST_ACCESS_SEQUENTIAL_WRITE,
.name = std::bit_cast<daxa_SmallString>(name_cstr),
};
// NOTE: it is responsibility of the user to destroy the buffer
auto & sbt_buffer_id = *out_buffer;
auto const create_buffer_result = daxa_dvc_create_buffer(device, &sbt_info, r_cast<daxa_BufferId *>(&sbt_buffer_id));
/// LATER, in the same function...
// Allocate a buffer for storing the SBT.
auto sbt_handler_info = daxa_BufferInfo{
.size = sbt_handle_size,
.allocate_info = DAXA_MEMORY_FLAG_HOST_ACCESS_RANDOM,
.name = std::bit_cast<daxa_SmallString>(name_handle_cstr),
};
auto handle_result = daxa_dvc_create_buffer(device, &sbt_handler_info, r_cast<daxa_BufferId *>(&out_entries->buffer)); |
Yes that's where the actual SBT lives composited by handler GROUPS. Then based on your handlers (one for every stage), you made your SBT based on shader groups. Each color is a group. Each cell is a handler: To sum up. For setting up your RT pipeline and for tracing rays you need at least two buffers during RT pipeline's lifetime: one for the actual handlers and one made up of shader groups. I hope that makes sense. |
Hi guys.
I want you to check out these changes.
SBT now is more complex but allows you to relate better betwen shader stages and shader groups and ask for any SBT configuration.
I added more features (which I've been working on for a few weeks) to the MPM sample.
Let me know if some changes are needed.