If no ARRAY_BUFFER is bound in glVertexAttrib*Pointer, sanitise pointer

* This ensures we don't serialise a pointer to client memory which is non-
  deterministic. The value isn't used, we will readback the actual data at draw
  time and replace with client-memory buffer updates.
This commit is contained in:
baldurk committed 2018-10-24 15:40:41 +01:00
1 parent 67ba5f3ed1
commit b42931e238
1 file changed
+8 -7
@@ -3154,7 +3154,8 @@ void WrappedOpenGL::glVertexAttribPointer(GLuint index, GLint size, GLenum type,
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_glVertexArrayVertexAttribOffsetEXT(
ser, varecord ? varecord->Resource.name : 0, bufrecord ? bufrecord->Resource.name : 0,
index, size, type, normalized, stride, (GLintptr)pointer);
index, size, type, normalized, stride,
bufrecord ? (GLintptr)pointer : GLintptr(0xDEADBEEF));
r->AddChunk(scope.Get());
}
@@ -3280,9 +3281,9 @@ void WrappedOpenGL::glVertexAttribIPointer(GLuint index, GLint size, GLenum type
{
USE_SCRATCH_SERIALISER();
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_glVertexArrayVertexAttribIOffsetEXT(ser, varecord ? varecord->Resource.name : 0,
bufrecord ? bufrecord->Resource.name : 0,
index, size, type, stride, (GLintptr)pointer);
Serialise_glVertexArrayVertexAttribIOffsetEXT(
ser, varecord ? varecord->Resource.name : 0, bufrecord ? bufrecord->Resource.name : 0,
index, size, type, stride, bufrecord ? (GLintptr)pointer : GLintptr(0xDEADBEEF));
r->AddChunk(scope.Get());
}
@@ -3408,9 +3409,9 @@ void WrappedOpenGL::glVertexAttribLPointer(GLuint index, GLint size, GLenum type
{
USE_SCRATCH_SERIALISER();
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_glVertexArrayVertexAttribLOffsetEXT(ser, varecord ? varecord->Resource.name : 0,
bufrecord ? bufrecord->Resource.name : 0,
index, size, type, stride, (GLintptr)pointer);
Serialise_glVertexArrayVertexAttribLOffsetEXT(
ser, varecord ? varecord->Resource.name : 0, bufrecord ? bufrecord->Resource.name : 0,
index, size, type, stride, bufrecord ? (GLintptr)pointer : GLintptr(0xDEADBEEF));
r->AddChunk(scope.Get());
}