added swap chain usage flags to core.init() options
This commit is contained in:
parent
27fd19271c
commit
f369b31137
4 changed files with 4 additions and 3 deletions
|
|
@ -154,6 +154,7 @@ pub const Options = struct {
|
|||
power_preference: gpu.PowerPreference = .undefined,
|
||||
required_features: ?[]const gpu.FeatureName = null,
|
||||
required_limits: ?gpu.Limits = null,
|
||||
swap_chain_usage: gpu.Texture.UsageFlags = .{ .render_attachment = true, },
|
||||
};
|
||||
|
||||
pub fn init(options_in: Options) !void {
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ pub fn init(
|
|||
const framebuffer_size = window.getFramebufferSize();
|
||||
const swap_chain_desc = gpu.SwapChain.Descriptor{
|
||||
.label = "main swap chain",
|
||||
.usage = .{ .render_attachment = true },
|
||||
.usage = options.swap_chain_usage,
|
||||
.format = .bgra8_unorm,
|
||||
.width = framebuffer_size.width,
|
||||
.height = framebuffer_size.height,
|
||||
|
|
|
|||
|
|
@ -977,7 +977,7 @@ pub fn init(
|
|||
|
||||
const swap_chain_desc = gpu.SwapChain.Descriptor{
|
||||
.label = "main swap chain",
|
||||
.usage = .{ .render_attachment = true },
|
||||
.usage = options.swap_chain_usage,
|
||||
.format = .bgra8_unorm,
|
||||
.width = options.size.width,
|
||||
.height = options.size.height,
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ pub fn init(
|
|||
|
||||
const swap_chain_desc = gpu.SwapChain.Descriptor{
|
||||
.label = "main swap chain",
|
||||
.usage = .{ .render_attachment = true },
|
||||
.usage = options.swap_chain_usage,
|
||||
.format = .bgra8_unorm,
|
||||
.width = @intCast(window_attrs.width),
|
||||
.height = @intCast(window_attrs.height),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue