diff options
Diffstat (limited to '3rdparty/bgfx/src/renderer_gl.h')
-rw-r--r-- | 3rdparty/bgfx/src/renderer_gl.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h index 8dbb24fa2f7..4d9778a0c4d 100644 --- a/3rdparty/bgfx/src/renderer_gl.h +++ b/3rdparty/bgfx/src/renderer_gl.h @@ -1310,7 +1310,7 @@ namespace bgfx { namespace gl , m_num(0) , m_needPresent(false) { - memset(m_fbo, 0, sizeof(m_fbo) ); + bx::memSet(m_fbo, 0, sizeof(m_fbo) ); } void create(uint8_t _num, const Attachment* _attachment); @@ -1343,9 +1343,28 @@ namespace bgfx { namespace gl void create(const ShaderGL& _vsh, const ShaderGL& _fsh); void destroy(); void init(); - void bindAttributes(const VertexDecl& _vertexDecl, uint32_t _baseVertex = 0) const; void bindInstanceData(uint32_t _stride, uint32_t _baseVertex = 0) const; + void bindAttributesBegin() + { + bx::memCopy(m_unboundUsedAttrib, m_used, sizeof(m_unboundUsedAttrib) ); + } + + void bindAttributes(const VertexDecl& _vertexDecl, uint32_t _baseVertex = 0); + + void bindAttributesEnd() + { + for (uint32_t ii = 0, iiEnd = m_usedCount; ii < iiEnd; ++ii) + { + if (Attrib::Count != m_unboundUsedAttrib[ii]) + { + Attrib::Enum attr = Attrib::Enum(m_unboundUsedAttrib[ii]); + GLint loc = m_attributes[attr]; + GL_CHECK(glDisableVertexAttribArray(loc) ); + } + } + } + void add(uint32_t _hash) { m_vcref.add(_hash); @@ -1353,8 +1372,10 @@ namespace bgfx { namespace gl GLuint m_id; - uint8_t m_used[Attrib::Count+1]; // dense - GLint m_attributes[Attrib::Count]; // sparse + uint8_t m_unboundUsedAttrib[Attrib::Count]; // For tracking unbound used attributes between begin()/end(). + uint8_t m_usedCount; + uint8_t m_used[Attrib::Count]; // Dense. + GLint m_attributes[Attrib::Count]; // Sparse. GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT+1]; GLint m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS]; @@ -1484,6 +1505,7 @@ namespace bgfx { namespace gl void begin(Frame* _render, OcclusionQueryHandle _handle); void end(); void resolve(Frame* _render, bool _wait = false); + void invalidate(OcclusionQueryHandle _handle); struct Query { |