Commit 004a6f9f by Jamie Madill Committed by Shannon Woods

Move VAO buffer clearing code to the destructor, instead of the constructor.

This fixes assertion failures during the VertexArray destructor in Debug mode. TRAC #23390 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Authored-by: Jamie Madill
parent 93e50deb
...@@ -16,6 +16,10 @@ namespace gl ...@@ -16,6 +16,10 @@ namespace gl
VertexArray::VertexArray(rx::Renderer *renderer, GLuint id) VertexArray::VertexArray(rx::Renderer *renderer, GLuint id)
: RefCountObject(id) : RefCountObject(id)
{ {
}
VertexArray::~VertexArray()
{
for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++) for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
{ {
mVertexAttributes[i].mBoundBuffer.set(NULL); mVertexAttributes[i].mBoundBuffer.set(NULL);
......
...@@ -30,6 +30,7 @@ class VertexArray : public RefCountObject ...@@ -30,6 +30,7 @@ class VertexArray : public RefCountObject
{ {
public: public:
VertexArray(rx::Renderer *renderer, GLuint id); VertexArray(rx::Renderer *renderer, GLuint id);
~VertexArray();
const VertexAttribute& getVertexAttribute(unsigned int attributeIndex) const; const VertexAttribute& getVertexAttribute(unsigned int attributeIndex) const;
void detachBuffer(GLuint bufferName); void detachBuffer(GLuint bufferName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment