summaryrefslogtreecommitdiff
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gpu.cc10
-rw-r--r--src/gpu/gpu.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index 535de67..afbba90 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -84,6 +84,16 @@ TextureWithView gpu_create_storage_texture_2d(WGPUDevice device, uint32_t width,
WGPUTextureUsage_StorageBinding | WGPUTextureUsage_TextureBinding, 1);
}
+TextureWithView gpu_create_post_process_texture(WGPUDevice device,
+ uint32_t width, uint32_t height,
+ WGPUTextureFormat format) {
+ return gpu_create_texture_2d(
+ device, width, height, format,
+ WGPUTextureUsage_RenderAttachment | WGPUTextureUsage_TextureBinding |
+ WGPUTextureUsage_CopySrc,
+ 1);
+}
+
WGPUTextureView gpu_create_mip_view(WGPUTexture texture,
WGPUTextureFormat format,
uint32_t mip_level) {
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h
index 74e0eb7..0b0153b 100644
--- a/src/gpu/gpu.h
+++ b/src/gpu/gpu.h
@@ -97,6 +97,9 @@ TextureWithView gpu_create_texture_2d(WGPUDevice device, uint32_t width,
TextureWithView gpu_create_storage_texture_2d(WGPUDevice device, uint32_t width,
uint32_t height,
WGPUTextureFormat format);
+TextureWithView gpu_create_post_process_texture(WGPUDevice device,
+ uint32_t width, uint32_t height,
+ WGPUTextureFormat format);
WGPUTextureView gpu_create_mip_view(WGPUTexture texture,
WGPUTextureFormat format, uint32_t mip_level);
WGPUTextureView gpu_create_texture_view_2d(WGPUTexture texture,