Renderer: Implement renderpass attachments clear for OpenGL
This commit is contained in:
@@ -134,6 +134,10 @@ namespace Nz::GL
|
||||
|
||||
bool ProcessErrorStack() const;
|
||||
|
||||
inline void ResetColorWriteMasks() const;
|
||||
inline void ResetDepthWriteMasks() const;
|
||||
inline void ResetStencilWriteMasks() const;
|
||||
|
||||
void SetCurrentTextureUnit(UInt32 textureUnit) const;
|
||||
void SetScissorBox(GLint x, GLint y, GLsizei width, GLsizei height) const;
|
||||
void SetViewport(GLint x, GLint y, GLsizei width, GLsizei height) const;
|
||||
|
||||
@@ -99,6 +99,35 @@ namespace Nz::GL
|
||||
if (m_state.boundVertexArray == vao)
|
||||
m_state.boundVertexArray = 0;
|
||||
}
|
||||
|
||||
inline void Context::ResetColorWriteMasks() const
|
||||
{
|
||||
if (!m_state.renderStates.colorWrite)
|
||||
{
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
m_state.renderStates.colorWrite = true;
|
||||
}
|
||||
}
|
||||
|
||||
inline void Context::ResetDepthWriteMasks() const
|
||||
{
|
||||
if (!m_state.renderStates.depthWrite)
|
||||
{
|
||||
glDepthMask(GL_TRUE);
|
||||
m_state.renderStates.depthWrite = true;
|
||||
}
|
||||
}
|
||||
|
||||
inline void Context::ResetStencilWriteMasks() const
|
||||
{
|
||||
if (m_state.renderStates.stencilBack.writeMask != 0xFFFFFFFF || m_state.renderStates.stencilFront.writeMask != 0xFFFFFFFF)
|
||||
{
|
||||
glStencilMaskSeparate(GL_FRONT_AND_BACK, 0xFFFFFFFF);
|
||||
m_state.renderStates.stencilBack.writeMask = 0xFFFFFFFF;
|
||||
m_state.renderStates.stencilFront.writeMask = 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include <Nazara/OpenGLRenderer/DebugOff.hpp>
|
||||
|
||||
@@ -129,6 +129,7 @@ typedef void (GL_APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const G
|
||||
cb(glStencilFuncSeparate, PFNGLSTENCILFUNCSEPARATEPROC) \
|
||||
cb(glStencilOp, PFNGLSTENCILOPPROC) \
|
||||
cb(glStencilOpSeparate, PFNGLSTENCILOPSEPARATEPROC) \
|
||||
cb(glStencilMaskSeparate, PFNGLSTENCILMASKSEPARATEPROC) \
|
||||
cb(glTexImage2D, PFNGLTEXIMAGE2DPROC) \
|
||||
cb(glTexImage3D, PFNGLTEXIMAGE3DPROC) \
|
||||
cb(glTexParameterf, PFNGLTEXPARAMETERFPROC) \
|
||||
|
||||
Reference in New Issue
Block a user