Minor fixes. (#1390)
* Moved greedy generic release(Ty) below release(const Memory*). * OGL: Resolve all color attachments, not only the first one.
This commit is contained in:
parent
1a7226f8ec
commit
2d1c2987ec
18
src/bgfx_p.h
18
src/bgfx_p.h
@ -454,6 +454,15 @@ namespace bgfx
|
||||
}
|
||||
};
|
||||
|
||||
void setGraphicsDebuggerPresent(bool _present);
|
||||
bool isGraphicsDebuggerPresent();
|
||||
void release(const Memory* _mem);
|
||||
const char* getAttribName(Attrib::Enum _attr);
|
||||
void getTextureSizeFromRatio(BackbufferRatio::Enum _ratio, uint16_t& _width, uint16_t& _height);
|
||||
TextureFormat::Enum getViableTextureFormat(const bimg::ImageContainer& _imageContainer);
|
||||
const char* getName(TextureFormat::Enum _fmt);
|
||||
const char* getName(UniformHandle _handle);
|
||||
|
||||
template<typename Ty>
|
||||
inline void release(Ty)
|
||||
{
|
||||
@ -465,15 +474,6 @@ namespace bgfx
|
||||
release( (const Memory*)_mem);
|
||||
}
|
||||
|
||||
void setGraphicsDebuggerPresent(bool _present);
|
||||
bool isGraphicsDebuggerPresent();
|
||||
void release(const Memory* _mem);
|
||||
const char* getAttribName(Attrib::Enum _attr);
|
||||
void getTextureSizeFromRatio(BackbufferRatio::Enum _ratio, uint16_t& _width, uint16_t& _height);
|
||||
TextureFormat::Enum getViableTextureFormat(const bimg::ImageContainer& _imageContainer);
|
||||
const char* getName(TextureFormat::Enum _fmt);
|
||||
const char* getName(UniformHandle _handle);
|
||||
|
||||
inline uint32_t castfu(float _value)
|
||||
{
|
||||
union { float fl; uint32_t ui; } un;
|
||||
|
@ -6342,10 +6342,23 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
|
||||
void FrameBufferGL::resolve()
|
||||
{
|
||||
if (0 != m_fbo[1])
|
||||
{
|
||||
uint32_t colorIdx = 0;
|
||||
for (uint32_t ii = 0; ii < m_numTh; ++ii)
|
||||
{
|
||||
TextureHandle handle = m_attachment[ii].handle;
|
||||
if (isValid(handle) )
|
||||
{
|
||||
const TextureGL& texture = s_renderGL->m_textures[handle.idx];
|
||||
|
||||
bimg::TextureFormat::Enum format = bimg::TextureFormat::Enum(texture.m_textureFormat);
|
||||
if (!bimg::isDepth(format) )
|
||||
{
|
||||
GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo[0]) );
|
||||
GL_CHECK(glReadBuffer(GL_COLOR_ATTACHMENT0) );
|
||||
GL_CHECK(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo[1]) );
|
||||
GL_CHECK(glReadBuffer(GL_COLOR_ATTACHMENT0 + colorIdx) );
|
||||
GL_CHECK(glDrawBuffer(GL_COLOR_ATTACHMENT0 + colorIdx) );
|
||||
colorIdx++;
|
||||
GL_CHECK(glBlitFramebuffer(0
|
||||
, 0
|
||||
, m_width
|
||||
@ -6357,13 +6370,15 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
|
||||
, GL_COLOR_BUFFER_BIT
|
||||
, GL_LINEAR
|
||||
) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo[0]) );
|
||||
GL_CHECK(glReadBuffer(GL_NONE) );
|
||||
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, s_renderGL->m_msaaBackBufferFbo) );
|
||||
}
|
||||
|
||||
if (0 < m_numTh)
|
||||
{
|
||||
for (uint32_t ii = 0; ii < m_numTh; ++ii)
|
||||
{
|
||||
TextureHandle handle = m_attachment[ii].handle;
|
||||
@ -6374,7 +6389,6 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FrameBufferGL::discard(uint16_t _flags)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user