Fixes texture format for NanoVG framebuffer. (#1147)
* Fixes pixel format for iOS. * Fixes texture format of nanovg framebuffer.
This commit is contained in:
parent
9cf4df65cc
commit
ed99f83093
@ -1191,11 +1191,15 @@ NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* ctx, int width, int height,
|
|||||||
NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* _ctx, int _width, int _height, int _imageFlags)
|
NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* _ctx, int _width, int _height, int _imageFlags)
|
||||||
{
|
{
|
||||||
BX_UNUSED(_imageFlags);
|
BX_UNUSED(_imageFlags);
|
||||||
|
bgfx::TextureHandle textures[] =
|
||||||
|
{
|
||||||
|
bgfx::createTexture2D(_width, _height, false, 1, bgfx::TextureFormat::RGBA8, BGFX_TEXTURE_RT),
|
||||||
|
bgfx::createTexture2D(_width, _height, false, 1, bgfx::TextureFormat::D24S8, BGFX_TEXTURE_RT | BGFX_TEXTURE_RT_WRITE_ONLY)
|
||||||
|
};
|
||||||
bgfx::FrameBufferHandle fbh = bgfx::createFrameBuffer(
|
bgfx::FrameBufferHandle fbh = bgfx::createFrameBuffer(
|
||||||
_width
|
BX_COUNTOF(textures)
|
||||||
, _height
|
, textures
|
||||||
, bgfx::TextureFormat::RGBA8
|
, true
|
||||||
, BGFX_TEXTURE_NONE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!bgfx::isValid(fbh) )
|
if (!bgfx::isValid(fbh) )
|
||||||
|
@ -581,7 +581,7 @@ namespace bgfx { namespace mtl
|
|||||||
|
|
||||||
if (BX_ENABLED(BX_PLATFORM_IOS) )
|
if (BX_ENABLED(BX_PLATFORM_IOS) )
|
||||||
{
|
{
|
||||||
s_textureFormat[TextureFormat::D24S8].m_fmt = MTLPixelFormatDepth32Float;
|
s_textureFormat[TextureFormat::D24S8].m_fmt = MTLPixelFormatDepth32Float_Stencil8;
|
||||||
|
|
||||||
g_caps.formats[TextureFormat::BC1 ] =
|
g_caps.formats[TextureFormat::BC1 ] =
|
||||||
g_caps.formats[TextureFormat::BC2 ] =
|
g_caps.formats[TextureFormat::BC2 ] =
|
||||||
|
Loading…
Reference in New Issue
Block a user