summaryrefslogtreecommitdiff
path: root/src/gui/Post.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/Post.zig')
-rw-r--r--src/gui/Post.zig22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/gui/Post.zig b/src/gui/Post.zig
index c0b71d97..64a431b9 100644
--- a/src/gui/Post.zig
+++ b/src/gui/Post.zig
@@ -383,16 +383,7 @@ pub fn draw(post: *Post, device: *c.SDL_GPUDevice, cmd: *c.SDL_GPUCommandBuffer,
if (live > 1 and (post.ping[0] == null or post.ping_w != w or post.ping_h != h)) {
for (&post.ping) |*texture| {
if (texture.*) |old| c.SDL_ReleaseGPUTexture(device, old);
- var info = std.mem.zeroes(c.SDL_GPUTextureCreateInfo);
- info.type = c.SDL_GPU_TEXTURETYPE_2D;
- info.format = format;
- info.usage = c.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | c.SDL_GPU_TEXTUREUSAGE_SAMPLER;
- info.width = w;
- info.height = h;
- info.layer_count_or_depth = 1;
- info.num_levels = 1;
- info.sample_count = c.SDL_GPU_SAMPLECOUNT_1;
- texture.* = c.SDL_CreateGPUTexture(device, &info) orelse return error.GpuCreate;
+ texture.* = gui.texture2d(device, format, c.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | c.SDL_GPU_TEXTUREUSAGE_SAMPLER, w, h) orelse return error.GpuCreate;
}
post.ping_w = w;
post.ping_h = h;
@@ -482,16 +473,7 @@ fn bloomChain(post: *Post, device: *c.SDL_GPUDevice, cmd: *c.SDL_GPUCommandBuffe
if (post.bloom_tex[0] == null or post.bloom_w != w or post.bloom_h != h) {
for (&post.bloom_tex, 0..) |*texture, i| {
if (texture.*) |old| c.SDL_ReleaseGPUTexture(device, old);
- var info = std.mem.zeroes(c.SDL_GPUTextureCreateInfo);
- info.type = c.SDL_GPU_TEXTURETYPE_2D;
- info.format = bloom_format;
- info.usage = c.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | c.SDL_GPU_TEXTUREUSAGE_SAMPLER;
- info.width = @max(1, w >> @intCast(i + 1));
- info.height = @max(1, h >> @intCast(i + 1));
- info.layer_count_or_depth = 1;
- info.num_levels = 1;
- info.sample_count = c.SDL_GPU_SAMPLECOUNT_1;
- texture.* = c.SDL_CreateGPUTexture(device, &info) orelse return error.GpuCreate;
+ texture.* = gui.texture2d(device, bloom_format, c.SDL_GPU_TEXTUREUSAGE_COLOR_TARGET | c.SDL_GPU_TEXTUREUSAGE_SAMPLER, @max(1, w >> @intCast(i + 1)), @max(1, h >> @intCast(i + 1))) orelse return error.GpuCreate;
}
post.bloom_w = w;
post.bloom_h = h;