diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index 4b09de2f..450fc165 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -478,7 +478,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::FrameBufferHandle fbh; bgfx::TextureHandle fbtextures[] = { - bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT), + bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT|BGFX_TEXTURE_U_CLAMP|BGFX_TEXTURE_V_CLAMP), bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::D16, BGFX_TEXTURE_RT_BUFFER_ONLY), }; fbh = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true); @@ -539,12 +539,12 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyFrameBuffer(bright); bgfx::destroyFrameBuffer(blur); - fbtextures[0] = bgfx::createTexture2D(width, height, 1, bgfx::TextureFormat::BGRA8, ( (msaa+1)<>0x18)&(BGFX_CONFIG_MAX_PROGRAMS-1); - m_trans = (_key>>0x21)&0x3; - m_seq = (_key>>0x23)&0x7ff; - m_view = (_key>>0x2e)&(BGFX_CONFIG_MAX_VIEWS-1); + m_trans = (_key>>0x21)& 0x3; + m_seq = (_key>>0x23)& 0x7ff; + m_view = (_key>>0x2e)&(BGFX_CONFIG_MAX_VIEWS-1); } void reset() { - m_depth = 0; + m_depth = 0; m_program = 0; - m_seq = 0; - m_view = 0; - m_trans = 0; + m_seq = 0; + m_view = 0; + m_trans = 0; } int32_t m_depth; diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 80259db1..744b7b11 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1242,11 +1242,20 @@ namespace bgfx s_textureFormat[TextureFormat::PTC22].m_supported |= ptc2Supported; s_textureFormat[TextureFormat::PTC24].m_supported |= ptc2Supported; - if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) - && BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) ) + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) ) { - setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT); - setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT); + setTextureFormat(TextureFormat::RGBA16F, GL_RGBA, GL_RGBA, GL_HALF_FLOAT); + + if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) ) + { + setTextureFormat(TextureFormat::R16, GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT); + setTextureFormat(TextureFormat::RGBA16, GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT); + } + else if (BX_ENABLED(BX_PLATFORM_IOS) ) + { + setTextureFormat(TextureFormat::D16, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT); + setTextureFormat(TextureFormat::D24S8, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8); + } } if (s_extension[Extension::EXT_texture_format_BGRA8888].m_supported