summaryrefslogtreecommitdiff
path: root/src/gpu/texture_manager.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 18:56:47 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 18:56:47 +0100
commite3ef115804b46e8bfc594987b04b1059aed5e002 (patch)
tree3670f718ee23cf34e94984568900eac23022d1f0 /src/gpu/texture_manager.cc
parent7fab8880cca269621cd32610b22f2820567771f2 (diff)
feat(gpu/assets): Fix tests, integrate bumpy 3D renderer and procedural assets
- Fixed test_sequence by restoring MainSequence::init_test for mocking. - Corrected CMakeLists.txt dependencies and source groupings to prevent duplicate symbols. - standardizing Effect constructor signature for seq_compiler compatibility. - Implemented Hybrid3DEffect using bumpy Renderer3D and procedural NOISE_TEX. - Updated MainSequence to support depth buffer for 3D elements. - Formatted all source files with clang-format.
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;
}