mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 13:03:05 +01:00
Fixed issue #714.
This commit is contained in:
@@ -348,7 +348,6 @@ namespace bgfx
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = _flags;
|
||||
tc.m_width = _width;
|
||||
tc.m_height = _height;
|
||||
tc.m_sides = 0;
|
||||
@@ -1820,7 +1819,7 @@ namespace bgfx
|
||||
|
||||
qsort(scores, numScores, sizeof(int32_t), compareDescending);
|
||||
|
||||
RendererContextI* renderCtx = NULL;
|
||||
RendererContextI* renderCtx;
|
||||
for (uint32_t ii = 0; ii < numScores; ++ii)
|
||||
{
|
||||
RendererType::Enum renderer = RendererType::Enum(scores[ii] & 0xff);
|
||||
@@ -2913,7 +2912,6 @@ namespace bgfx
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = _flags;
|
||||
tc.m_width = _width;
|
||||
tc.m_height = _height;
|
||||
tc.m_sides = 0;
|
||||
@@ -2970,7 +2968,6 @@ namespace bgfx
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = _flags;
|
||||
tc.m_width = _width;
|
||||
tc.m_height = _height;
|
||||
tc.m_sides = 0;
|
||||
@@ -3014,7 +3011,6 @@ namespace bgfx
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = _flags;
|
||||
tc.m_width = _size;
|
||||
tc.m_height = _size;
|
||||
tc.m_sides = 6;
|
||||
|
||||
@@ -313,7 +313,6 @@ namespace bgfx
|
||||
struct TextureCreate
|
||||
{
|
||||
TextureFormat::Enum m_format;
|
||||
uint32_t m_flags;
|
||||
uint16_t m_width;
|
||||
uint16_t m_height;
|
||||
uint16_t m_sides;
|
||||
|
||||
@@ -1782,7 +1782,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = texture.m_flags;
|
||||
tc.m_width = _width;
|
||||
tc.m_height = _height;
|
||||
tc.m_sides = 0;
|
||||
@@ -1794,7 +1793,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
bx::write(&writer, tc);
|
||||
|
||||
texture.destroy();
|
||||
texture.create(mem, tc.m_flags, 0);
|
||||
texture.create(mem, texture.m_flags, 0);
|
||||
|
||||
release(mem);
|
||||
}
|
||||
|
||||
@@ -1376,7 +1376,6 @@ namespace bgfx { namespace d3d12
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = texture.m_flags;
|
||||
tc.m_width = _width;
|
||||
tc.m_height = _height;
|
||||
tc.m_sides = 0;
|
||||
@@ -1388,7 +1387,7 @@ namespace bgfx { namespace d3d12
|
||||
bx::write(&writer, tc);
|
||||
|
||||
texture.destroy();
|
||||
texture.create(mem, tc.m_flags, 0);
|
||||
texture.create(mem, texture.m_flags, 0);
|
||||
|
||||
release(mem);
|
||||
}
|
||||
|
||||
@@ -1004,8 +1004,29 @@ namespace bgfx { namespace d3d9
|
||||
void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height) BX_OVERRIDE
|
||||
{
|
||||
TextureD3D9& texture = m_textures[_handle.idx];
|
||||
texture.m_width = _width;
|
||||
texture.m_height = _height;
|
||||
|
||||
uint32_t size = sizeof(uint32_t) + sizeof(TextureCreate);
|
||||
const Memory* mem = alloc(size);
|
||||
|
||||
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
|
||||
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
|
||||
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 = 1;
|
||||
tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
|
||||
tc.m_cubeMap = false;
|
||||
tc.m_mem = NULL;
|
||||
bx::write(&writer, tc);
|
||||
|
||||
texture.destroy();
|
||||
texture.create(mem, texture.m_flags, 0);
|
||||
|
||||
release(mem);
|
||||
}
|
||||
|
||||
void overrideInternal(TextureHandle _handle, uintptr_t _ptr) BX_OVERRIDE
|
||||
|
||||
@@ -2227,7 +2227,6 @@ namespace bgfx { namespace gl
|
||||
bx::write(&writer, magic);
|
||||
|
||||
TextureCreate tc;
|
||||
tc.m_flags = texture.m_flags;
|
||||
tc.m_width = _width;
|
||||
tc.m_height = _height;
|
||||
tc.m_sides = 0;
|
||||
@@ -2239,7 +2238,7 @@ namespace bgfx { namespace gl
|
||||
bx::write(&writer, tc);
|
||||
|
||||
texture.destroy();
|
||||
texture.create(mem, tc.m_flags, 0);
|
||||
texture.create(mem, texture.m_flags, 0);
|
||||
|
||||
release(mem);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user