Add missing render pass encoder depth stencil attachment handling
This commit is contained in:
parent
78a131952b
commit
3e10b1e294
2 changed files with 16 additions and 1 deletions
|
|
@ -50,7 +50,7 @@ namespace psemek::wgpu
|
|||
struct depth_stencil_attachment
|
||||
{
|
||||
texture_view view;
|
||||
load_op depth_load_pp;
|
||||
load_op depth_load_op;
|
||||
store_op depth_store_op;
|
||||
float depth_clear_value;
|
||||
bool depth_read_only;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,20 @@ namespace psemek::wgpu
|
|||
dst.clearValue = {src.clear_value[0], src.clear_value[1], src.clear_value[2], src.clear_value[3]};
|
||||
}
|
||||
|
||||
WGPURenderPassDepthStencilAttachment depth_stencil_attachment = {};
|
||||
if (desc.depth_stencil_attachment)
|
||||
{
|
||||
depth_stencil_attachment.view = (WGPUTextureView)desc.depth_stencil_attachment->view.get();
|
||||
depth_stencil_attachment.depthLoadOp = (WGPULoadOp)desc.depth_stencil_attachment->depth_load_op;
|
||||
depth_stencil_attachment.depthStoreOp = (WGPUStoreOp)desc.depth_stencil_attachment->depth_store_op;
|
||||
depth_stencil_attachment.depthClearValue = desc.depth_stencil_attachment->depth_clear_value;
|
||||
depth_stencil_attachment.depthReadOnly = desc.depth_stencil_attachment->depth_read_only;
|
||||
depth_stencil_attachment.stencilLoadOp = (WGPULoadOp)desc.depth_stencil_attachment->stencil_load_op;
|
||||
depth_stencil_attachment.stencilStoreOp = (WGPUStoreOp)desc.depth_stencil_attachment->stencil_store_op;
|
||||
depth_stencil_attachment.stencilClearValue = desc.depth_stencil_attachment->stencil_clear_value;
|
||||
depth_stencil_attachment.stencilReadOnly = desc.depth_stencil_attachment->stencil_clear_value;
|
||||
}
|
||||
|
||||
WGPURenderPassTimestampWrites timestamp_writes = {};
|
||||
if (desc.timestamp_writes)
|
||||
{
|
||||
|
|
@ -49,6 +63,7 @@ namespace psemek::wgpu
|
|||
descriptor.label = desc.label.data();
|
||||
descriptor.colorAttachmentCount = color_attachments.size();
|
||||
descriptor.colorAttachments = color_attachments.data();
|
||||
descriptor.depthStencilAttachment = desc.depth_stencil_attachment ? &depth_stencil_attachment : nullptr;
|
||||
descriptor.occlusionQuerySet = (WGPUQuerySet)desc.occlusion_query_set.get();
|
||||
descriptor.timestampWrites = desc.timestamp_writes ? ×tamp_writes : nullptr;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue