summaryrefslogtreecommitdiff
path: root/src/gpu/texture_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/texture_manager.cc')
-rw-r--r--src/gpu/texture_manager.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/texture_manager.cc b/src/gpu/texture_manager.cc
index f2d93ad..5da82c0 100644
--- a/src/gpu/texture_manager.cc
+++ b/src/gpu/texture_manager.cc
@@ -44,13 +44,13 @@ void TextureManager::create_procedural_texture(
#endif
}
-void TextureManager::create_texture(const std::string& name, int width, int height, const uint8_t* data) {
+void TextureManager::create_texture(const std::string& name, int width,
+ int height, const uint8_t* data) {
WGPUExtent3D tex_size = {(uint32_t)width, (uint32_t)height, 1};
// 2. Create GPU Texture
WGPUTextureDescriptor tex_desc = {};
- tex_desc.usage =
- WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopyDst;
+ tex_desc.usage = WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopyDst;
tex_desc.dimension = WGPUTextureDimension_2D;
tex_desc.size = tex_size;
tex_desc.format = WGPUTextureFormat_RGBA8Unorm;
@@ -76,8 +76,8 @@ void TextureManager::create_texture(const std::string& name, int width, int heig
source_layout.bytesPerRow = width * 4;
source_layout.rowsPerImage = height;
- wgpuQueueWriteTexture(queue_, &destination, data,
- width * height * 4, &source_layout, &tex_size);
+ wgpuQueueWriteTexture(queue_, &destination, data, width * height * 4,
+ &source_layout, &tex_size);
// 4. Create View
WGPUTextureViewDescriptor view_desc = {};
@@ -97,7 +97,7 @@ void TextureManager::create_texture(const std::string& name, int width, int heig
gpu_tex.view = view;
gpu_tex.width = width;
gpu_tex.height = height;
-
+
textures_[name] = gpu_tex;
}