|
|
@@ -1499,41 +1499,41 @@ namespace bgfx
|
|
|
{
|
|
|
uint32_t width = tc.m_width;
|
|
|
uint32_t height = tc.m_height;
|
|
|
- uint32_t depth = tc.m_depth;
|
|
|
+ uint32_t depth = tc.m_depth;
|
|
|
|
|
|
for (uint32_t lod = 0, num = tc.m_numMips; lod < num; ++lod)
|
|
|
{
|
|
|
width = uint32_max(width, min);
|
|
|
height = uint32_max(height, min);
|
|
|
- depth = uint32_max(1, depth);
|
|
|
- uint32_t size = width*height*bpp/8;
|
|
|
+ depth = uint32_max(1, depth);
|
|
|
+ uint32_t size = width*height*bpp/8;
|
|
|
|
|
|
if (m_compressed)
|
|
|
{
|
|
|
- compressedTexImage(target+side
|
|
|
- , lod
|
|
|
- , internalFmt
|
|
|
- , width
|
|
|
- , height
|
|
|
- , depth
|
|
|
- , 0
|
|
|
- , size
|
|
|
- , data
|
|
|
- );
|
|
|
+ compressedTexImage(target+side
|
|
|
+ , lod
|
|
|
+ , internalFmt
|
|
|
+ , width
|
|
|
+ , height
|
|
|
+ , depth
|
|
|
+ , 0
|
|
|
+ , size
|
|
|
+ , data
|
|
|
+ );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- texImage(target+side
|
|
|
- , lod
|
|
|
- , internalFmt
|
|
|
- , width
|
|
|
- , height
|
|
|
- , depth
|
|
|
- , 0
|
|
|
- , m_fmt
|
|
|
- , m_type
|
|
|
- , data
|
|
|
- );
|
|
|
+ texImage(target+side
|
|
|
+ , lod
|
|
|
+ , internalFmt
|
|
|
+ , width
|
|
|
+ , height
|
|
|
+ , depth
|
|
|
+ , 0
|
|
|
+ , m_fmt
|
|
|
+ , m_type
|
|
|
+ , data
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if (NULL != data)
|
|
|
@@ -1543,7 +1543,7 @@ namespace bgfx
|
|
|
|
|
|
width >>= 1;
|
|
|
height >>= 1;
|
|
|
- depth >>= 1;
|
|
|
+ depth >>= 1;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1647,7 +1647,7 @@ namespace bgfx
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void Texture::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, const Memory* _mem)
|
|
|
+ void Texture::update(uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, const Memory* _mem)
|
|
|
{
|
|
|
GL_CHECK(glBindTexture(m_target, m_id) );
|
|
|
GL_CHECK(glPixelStorei(GL_UNPACK_ALIGNMENT, 1) );
|
|
|
@@ -1929,7 +1929,7 @@ namespace bgfx
|
|
|
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, 0) );
|
|
|
GL_CHECK(glViewport(0, 0, width, height) );
|
|
|
|
|
|
- GL_CHECK(glDisable(GL_STENCIL_TEST) );
|
|
|
+ GL_CHECK(glDisable(GL_STENCIL_TEST) );
|
|
|
GL_CHECK(glDisable(GL_DEPTH_TEST) );
|
|
|
GL_CHECK(glDepthFunc(GL_ALWAYS) );
|
|
|
GL_CHECK(glDisable(GL_CULL_FACE) );
|
|
|
@@ -2390,7 +2390,7 @@ namespace bgfx
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- GL_CHECK(glDisable(GL_STENCIL_TEST) );
|
|
|
+ GL_CHECK(glDisable(GL_STENCIL_TEST) );
|
|
|
GL_CHECK(glEnable(GL_DEPTH_TEST) );
|
|
|
GL_CHECK(glDepthFunc(GL_LESS) );
|
|
|
GL_CHECK(glEnable(GL_CULL_FACE) );
|
|
|
@@ -2401,23 +2401,23 @@ namespace bgfx
|
|
|
{
|
|
|
if (0 != newStencil)
|
|
|
{
|
|
|
- GL_CHECK(glEnable(GL_STENCIL_TEST) );
|
|
|
-
|
|
|
- uint32_t bstencil = unpackStencil(1, newStencil);
|
|
|
- uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != unpackStencil(0, newStencil);
|
|
|
-
|
|
|
+ GL_CHECK(glEnable(GL_STENCIL_TEST) );
|
|
|
+
|
|
|
+ uint32_t bstencil = unpackStencil(1, newStencil);
|
|
|
+ uint32_t frontAndBack = bstencil != BGFX_STENCIL_NONE && bstencil != unpackStencil(0, newStencil);
|
|
|
+
|
|
|
// uint32_t bchanged = unpackStencil(1, changedStencil);
|
|
|
// if (BGFX_STENCIL_FUNC_RMASK_MASK & bchanged)
|
|
|
// {
|
|
|
// uint32_t wmask = (bstencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT;
|
|
|
// GL_CHECK(glStencilMask(wmask) );
|
|
|
// }
|
|
|
-
|
|
|
- for (uint32_t ii = 0, num = frontAndBack+1; ii < num; ++ii)
|
|
|
- {
|
|
|
- uint32_t stencil = unpackStencil(ii, newStencil);
|
|
|
- uint32_t changed = unpackStencil(ii, changedStencil);
|
|
|
- GLenum face = s_stencilFace[frontAndBack+ii];
|
|
|
+
|
|
|
+ for (uint32_t ii = 0, num = frontAndBack+1; ii < num; ++ii)
|
|
|
+ {
|
|
|
+ uint32_t stencil = unpackStencil(ii, newStencil);
|
|
|
+ uint32_t changed = unpackStencil(ii, changedStencil);
|
|
|
+ GLenum face = s_stencilFace[frontAndBack+ii];
|
|
|
|
|
|
if ( (BGFX_STENCIL_TEST_MASK|BGFX_STENCIL_FUNC_REF_MASK|BGFX_STENCIL_FUNC_RMASK_MASK) & changed)
|
|
|
{
|
|
|
@@ -2434,12 +2434,12 @@ namespace bgfx
|
|
|
uint32_t zpass = (stencil&BGFX_STENCIL_OP_PASS_Z_MASK)>>BGFX_STENCIL_OP_PASS_Z_SHIFT;
|
|
|
GL_CHECK(glStencilOpSeparate(face, s_stencilOp[sfail], s_stencilOp[zfail], s_stencilOp[zpass]) );
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- GL_CHECK(glDisable(GL_STENCIL_TEST) );
|
|
|
- }
|
|
|
+ GL_CHECK(glDisable(GL_STENCIL_TEST) );
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if ( (BGFX_STATE_CULL_MASK|BGFX_STATE_DEPTH_WRITE|BGFX_STATE_DEPTH_TEST_MASK
|