mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1145501 - Extend validation of BufferData usage. r=jgilbert
This commit is contained in:
parent
2923eda99d
commit
bf34887a19
@ -34,7 +34,8 @@ private:
|
||||
virtual bool ValidateBufferTarget(GLenum target, const char* info) override;
|
||||
virtual bool ValidateBufferIndexedTarget(GLenum target, const char* info) override;
|
||||
virtual bool ValidateBufferForTarget(GLenum target, WebGLBuffer* buffer, const char* info) override;
|
||||
|
||||
virtual bool ValidateBufferUsageEnum(GLenum usage, const char* info) override;
|
||||
|
||||
virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) override;
|
||||
};
|
||||
|
||||
|
@ -50,3 +50,19 @@ WebGL1Context::ValidateBufferForTarget(GLenum target, WebGLBuffer* buffer,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
WebGL1Context::ValidateBufferUsageEnum(GLenum usage, const char* info)
|
||||
{
|
||||
switch (usage) {
|
||||
case LOCAL_GL_STREAM_DRAW:
|
||||
case LOCAL_GL_STATIC_DRAW:
|
||||
case LOCAL_GL_DYNAMIC_DRAW:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ErrorInvalidEnumInfo(info, usage);
|
||||
return false;
|
||||
}
|
||||
|
@ -348,6 +348,7 @@ private:
|
||||
virtual bool ValidateBufferTarget(GLenum target, const char* info) override;
|
||||
virtual bool ValidateBufferIndexedTarget(GLenum target, const char* info) override;
|
||||
virtual bool ValidateBufferForTarget(GLenum target, WebGLBuffer* buffer, const char* info) override;
|
||||
virtual bool ValidateBufferUsageEnum(GLenum usage, const char* info) override;
|
||||
|
||||
virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) override;
|
||||
};
|
||||
|
@ -75,6 +75,28 @@ WebGL2Context::ValidateBufferForTarget(GLenum target, WebGLBuffer* buffer,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
WebGL2Context::ValidateBufferUsageEnum(GLenum usage, const char* info)
|
||||
{
|
||||
switch (usage) {
|
||||
case LOCAL_GL_DYNAMIC_COPY:
|
||||
case LOCAL_GL_DYNAMIC_DRAW:
|
||||
case LOCAL_GL_DYNAMIC_READ:
|
||||
case LOCAL_GL_STATIC_COPY:
|
||||
case LOCAL_GL_STATIC_DRAW:
|
||||
case LOCAL_GL_STATIC_READ:
|
||||
case LOCAL_GL_STREAM_COPY:
|
||||
case LOCAL_GL_STREAM_DRAW:
|
||||
case LOCAL_GL_STREAM_READ:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ErrorInvalidEnumInfo(info, usage);
|
||||
return false;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Buffer objects
|
||||
|
||||
|
@ -932,7 +932,6 @@ protected:
|
||||
WebGLRefPtr<WebGLBuffer>& GetBufferSlotByTarget(GLenum target);
|
||||
WebGLRefPtr<WebGLBuffer>& GetBufferSlotByTargetIndexed(GLenum target,
|
||||
GLuint index);
|
||||
bool ValidateBufferUsageEnum(GLenum target, const char* info);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Queries (WebGL2ContextQueries.cpp)
|
||||
@ -1389,6 +1388,7 @@ private:
|
||||
virtual bool ValidateBufferTarget(GLenum target, const char* info) = 0;
|
||||
virtual bool ValidateBufferIndexedTarget(GLenum target, const char* info) = 0;
|
||||
virtual bool ValidateBufferForTarget(GLenum target, WebGLBuffer* buffer, const char* info) = 0;
|
||||
virtual bool ValidateBufferUsageEnum(GLenum usage, const char* info) = 0;
|
||||
virtual bool ValidateUniformMatrixTranspose(bool transpose, const char* info) = 0;
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user