From 63e79499fa11fa1f8f54b264972a30876f54334d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 20 Aug 2016 08:10:20 -0700 Subject: [PATCH] Cleanup. --- src/bgfx.cpp | 64 +++++++++++++++++++++--------------------- src/bgfx_p.h | 2 +- src/renderer_d3d11.cpp | 16 +++++------ src/renderer_d3d12.cpp | 16 +++++------ src/renderer_d3d9.cpp | 16 +++++------ src/renderer_gl.cpp | 16 +++++------ src/renderer_mtl.mm | 16 +++++------ 7 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 13757818d..251ca0467 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -352,14 +352,14 @@ namespace bgfx bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = uint8_t(bx::uint16_max(1, _numMips) ); - tc.m_format = _format; - tc.m_cubeMap = false; - tc.m_mem = NULL; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = uint8_t(bx::uint16_max(1, _numMips) ); + tc.m_format = _format; + tc.m_cubeMap = false; + tc.m_mem = NULL; bx::write(&writer, tc); rci->destroyTexture(_handle); @@ -2974,14 +2974,14 @@ error: bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = numMips; - tc.m_format = _format; - tc.m_cubeMap = false; - tc.m_mem = _mem; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = numMips; + tc.m_format = _format; + tc.m_cubeMap = false; + tc.m_mem = _mem; bx::write(&writer, tc); return s_ctx->createTexture(mem, _flags, 0, NULL, _ratio); @@ -3030,14 +3030,14 @@ error: bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = _depth; - tc.m_numMips = numMips; - tc.m_format = _format; - tc.m_cubeMap = false; - tc.m_mem = _mem; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = _depth; + tc.m_numLayers = 1; + tc.m_numMips = numMips; + tc.m_format = _format; + tc.m_cubeMap = false; + tc.m_mem = _mem; bx::write(&writer, tc); return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count); @@ -3073,14 +3073,14 @@ error: bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _size; - tc.m_height = _size; - tc.m_sides = 6; - tc.m_depth = 0; - tc.m_numMips = numMips; - tc.m_format = _format; - tc.m_cubeMap = true; - tc.m_mem = _mem; + tc.m_width = _size; + tc.m_height = _size; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = numMips; + tc.m_format = _format; + tc.m_cubeMap = true; + tc.m_mem = _mem; bx::write(&writer, tc); return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count); diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 0481e8dc8..d8e89d5d2 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -320,8 +320,8 @@ namespace bgfx TextureFormat::Enum m_format; uint16_t m_width; uint16_t m_height; - uint16_t m_sides; uint16_t m_depth; + uint16_t m_numLayers; uint8_t m_numMips; bool m_cubeMap; const Memory* m_mem; diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 5e6fb036d..2ebcefb15 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -1850,14 +1850,14 @@ BX_PRAGMA_DIAGNOSTIC_POP(); bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = _numMips; + tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); + tc.m_cubeMap = false; + tc.m_mem = NULL; bx::write(&writer, tc); texture.destroy(); diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 5624dc5dc..7b23233df 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -1476,14 +1476,14 @@ namespace bgfx { namespace d3d12 bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = _numMips; + tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); + tc.m_cubeMap = false; + tc.m_mem = NULL; bx::write(&writer, tc); texture.destroy(); diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 81e53cecb..834547be7 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -1031,14 +1031,14 @@ namespace bgfx { namespace d3d9 bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = _numMips; + tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); + tc.m_cubeMap = false; + tc.m_mem = NULL; bx::write(&writer, tc); texture.destroy(true); diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 8b2555260..c6b2d086c 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -2322,14 +2322,14 @@ namespace bgfx { namespace gl bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = _numMips; + tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); + tc.m_cubeMap = false; + tc.m_mem = NULL; bx::write(&writer, tc); texture.destroy(); diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 875b69341..56aed310a 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -809,14 +809,14 @@ namespace bgfx { namespace mtl bx::write(&writer, magic); TextureCreate tc; - tc.m_width = _width; - tc.m_height = _height; - tc.m_sides = 0; - tc.m_depth = 0; - tc.m_numMips = _numMips; - tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); - tc.m_cubeMap = false; - tc.m_mem = NULL; + tc.m_width = _width; + tc.m_height = _height; + tc.m_depth = 0; + tc.m_numLayers = 1; + tc.m_numMips = _numMips; + tc.m_format = TextureFormat::Enum(texture.m_requestedFormat); + tc.m_cubeMap = false; + tc.m_mem = NULL; bx::write(&writer, tc); texture.destroy();