-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Basically, with how descriptors currently work, when I pass layouts to a pipeline, I have to either know in advance how many I have, or I have to make it in a const before passing its length and pointer
// either
const attachments = &[_]wgpu.ColorAttachment{
.{
.view = next.view,
.load_op = .clear,
.store_op = .store,
.clear_value = .{ .r = 0, .g = 0, .b = 0, .a = 1 },
}
};
const pass = encoder.beginRenderPass(&.{
.color_attachment_count = attachments.len,
.color_attachments = attachments.ptr,
}).?
// or
const pass = encoder.beginRenderPass(&.{
.color_attachment_count = 1,
.color_attachments = &.{
.{
.view = next.view,
.load_op = .clear,
.store_op = .store,
.clear_value = .{ .r = 0, .g = 0, .b = 0, .a = 1 },
},
},
}).?;I wish I could do something as simple as this
const pass = encoder.beginRenderPass(&.{
.color_attachments = &.{ // <-- []const wgpu.ColorAttachment, which has a .len and .ptr
.{
.view = next.view,
.load_op = .clear,
.store_op = .store,
.clear_value = .{ .r = 0, .g = 0, .b = 0, .a = 1 },
},
},
}).?;Metadata
Metadata
Assignees
Labels
No labels