Commit 5451d532 by Jiajia Qin Committed by Commit Bot

Refactor ES31 entry points

BUG=angleproject:2254 Change-Id: I4e837a831e0950330b243bd8aa01831af0a70cc4 Reviewed-on: https://chromium-review.googlesource.com/775604 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 85072e8f
...@@ -634,6 +634,12 @@ GLuint Context::createProgramPipeline() ...@@ -634,6 +634,12 @@ GLuint Context::createProgramPipeline()
return mState.mPipelines->createProgramPipeline(); return mState.mPipelines->createProgramPipeline();
} }
GLuint Context::createShaderProgramv(GLenum type, GLsizei count, const GLchar *const *strings)
{
UNIMPLEMENTED();
return 0u;
}
void Context::deleteBuffer(GLuint buffer) void Context::deleteBuffer(GLuint buffer)
{ {
if (mState.mBuffers->getBuffer(buffer)) if (mState.mBuffers->getBuffer(buffer))
...@@ -1001,6 +1007,11 @@ void Context::useProgram(GLuint program) ...@@ -1001,6 +1007,11 @@ void Context::useProgram(GLuint program)
mGLState.setProgram(this, getProgram(program)); mGLState.setProgram(this, getProgram(program));
} }
void Context::useProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
{
UNIMPLEMENTED();
}
void Context::bindTransformFeedback(GLenum target, GLuint transformFeedbackHandle) void Context::bindTransformFeedback(GLenum target, GLuint transformFeedbackHandle)
{ {
ASSERT(target == GL_TRANSFORM_FEEDBACK); ASSERT(target == GL_TRANSFORM_FEEDBACK);
...@@ -1648,6 +1659,21 @@ void Context::getTexParameteriv(GLenum target, GLenum pname, GLint *params) ...@@ -1648,6 +1659,21 @@ void Context::getTexParameteriv(GLenum target, GLenum pname, GLint *params)
Texture *texture = getTargetTexture(target); Texture *texture = getTargetTexture(target);
QueryTexParameteriv(texture, pname, params); QueryTexParameteriv(texture, pname, params);
} }
void Context::getTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
{
Texture *texture =
getTargetTexture(IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target);
QueryTexLevelParameteriv(texture, target, level, pname, params);
}
void Context::getTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params)
{
Texture *texture =
getTargetTexture(IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target);
QueryTexLevelParameterfv(texture, target, level, pname, params);
}
void Context::texParameterf(GLenum target, GLenum pname, GLfloat param) void Context::texParameterf(GLenum target, GLenum pname, GLfloat param)
{ {
Texture *texture = getTargetTexture(target); Texture *texture = getTargetTexture(target);
...@@ -3455,6 +3481,11 @@ void Context::syncStateForBlit() ...@@ -3455,6 +3481,11 @@ void Context::syncStateForBlit()
syncRendererState(mBlitDirtyBits, mBlitDirtyObjects); syncRendererState(mBlitDirtyBits, mBlitDirtyObjects);
} }
void Context::activeShaderProgram(GLuint pipeline, GLuint program)
{
UNIMPLEMENTED();
}
void Context::activeTexture(GLenum texture) void Context::activeTexture(GLenum texture)
{ {
mGLState.setActiveSampler(texture - GL_TEXTURE0); mGLState.setActiveSampler(texture - GL_TEXTURE0);
...@@ -3776,7 +3807,7 @@ void Context::vertexAttribBinding(GLuint attribIndex, GLuint bindingIndex) ...@@ -3776,7 +3807,7 @@ void Context::vertexAttribBinding(GLuint attribIndex, GLuint bindingIndex)
mGLState.setVertexAttribBinding(this, attribIndex, bindingIndex); mGLState.setVertexAttribBinding(this, attribIndex, bindingIndex);
} }
void Context::setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor) void Context::vertexBindingDivisor(GLuint bindingIndex, GLuint divisor)
{ {
mGLState.setVertexBindingDivisor(bindingIndex, divisor); mGLState.setVertexBindingDivisor(bindingIndex, divisor);
} }
...@@ -4084,7 +4115,7 @@ void Context::getFramebufferParameteriv(GLenum target, GLenum pname, GLint *para ...@@ -4084,7 +4115,7 @@ void Context::getFramebufferParameteriv(GLenum target, GLenum pname, GLint *para
QueryFramebufferParameteriv(framebuffer, pname, params); QueryFramebufferParameteriv(framebuffer, pname, params);
} }
void Context::setFramebufferParameteri(GLenum target, GLenum pname, GLint param) void Context::framebufferParameteri(GLenum target, GLenum pname, GLint param)
{ {
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target); Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
SetFramebufferParameteri(framebuffer, pname, param); SetFramebufferParameteri(framebuffer, pname, param);
...@@ -4126,6 +4157,11 @@ void Context::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGr ...@@ -4126,6 +4157,11 @@ void Context::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGr
handleError(mImplementation->dispatchCompute(this, numGroupsX, numGroupsY, numGroupsZ)); handleError(mImplementation->dispatchCompute(this, numGroupsX, numGroupsY, numGroupsZ));
} }
void Context::dispatchComputeIndirect(GLintptr indirect)
{
UNIMPLEMENTED();
}
void Context::texStorage2D(GLenum target, void Context::texStorage2D(GLenum target,
GLsizei levels, GLsizei levels,
GLenum internalFormat, GLenum internalFormat,
...@@ -4149,6 +4185,16 @@ void Context::texStorage3D(GLenum target, ...@@ -4149,6 +4185,16 @@ void Context::texStorage3D(GLenum target,
handleError(texture->setStorage(this, target, levels, internalFormat, size)); handleError(texture->setStorage(this, target, levels, internalFormat, size));
} }
void Context::memoryBarrier(GLbitfield barriers)
{
UNIMPLEMENTED();
}
void Context::memoryBarrierByRegion(GLbitfield barriers)
{
UNIMPLEMENTED();
}
GLenum Context::checkFramebufferStatus(GLenum target) GLenum Context::checkFramebufferStatus(GLenum target)
{ {
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target); Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
...@@ -4343,6 +4389,11 @@ void Context::getProgramiv(GLuint program, GLenum pname, GLint *params) ...@@ -4343,6 +4389,11 @@ void Context::getProgramiv(GLuint program, GLenum pname, GLint *params)
QueryProgramiv(this, programObject, pname, params); QueryProgramiv(this, programObject, pname, params);
} }
void Context::getProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
{
UNIMPLEMENTED();
}
void Context::getProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length, GLchar *infolog) void Context::getProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length, GLchar *infolog)
{ {
Program *programObject = getProgram(program); Program *programObject = getProgram(program);
...@@ -4350,6 +4401,14 @@ void Context::getProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length ...@@ -4350,6 +4401,14 @@ void Context::getProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length
programObject->getInfoLog(bufsize, length, infolog); programObject->getInfoLog(bufsize, length, infolog);
} }
void Context::getProgramPipelineInfoLog(GLuint pipeline,
GLsizei bufSize,
GLsizei *length,
GLchar *infoLog)
{
UNIMPLEMENTED();
}
void Context::getShaderiv(GLuint shader, GLenum pname, GLint *params) void Context::getShaderiv(GLuint shader, GLenum pname, GLint *params)
{ {
Shader *shaderObject = getShader(shader); Shader *shaderObject = getShader(shader);
...@@ -4720,6 +4779,11 @@ void Context::validateProgram(GLuint program) ...@@ -4720,6 +4779,11 @@ void Context::validateProgram(GLuint program)
programObject->validate(mCaps); programObject->validate(mCaps);
} }
void Context::validateProgramPipeline(GLuint pipeline)
{
UNIMPLEMENTED();
}
void Context::getProgramBinary(GLuint program, void Context::getProgramBinary(GLuint program,
GLsizei bufSize, GLsizei bufSize,
GLsizei *length, GLsizei *length,
...@@ -5182,6 +5246,90 @@ void Context::getInternalformativ(GLenum target, ...@@ -5182,6 +5246,90 @@ void Context::getInternalformativ(GLenum target,
QueryInternalFormativ(formatCaps, pname, bufSize, params); QueryInternalFormativ(formatCaps, pname, bufSize, params);
} }
void Context::programUniform1i(GLuint program, GLint location, GLint v0)
{
programUniform1iv(program, location, 1, &v0);
}
void Context::programUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
{
GLint xy[2] = {v0, v1};
programUniform2iv(program, location, 1, xy);
}
void Context::programUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
{
GLint xyz[3] = {v0, v1, v2};
programUniform3iv(program, location, 1, xyz);
}
void Context::programUniform4i(GLuint program,
GLint location,
GLint v0,
GLint v1,
GLint v2,
GLint v3)
{
GLint xyzw[4] = {v0, v1, v2, v3};
programUniform4iv(program, location, 1, xyzw);
}
void Context::programUniform1ui(GLuint program, GLint location, GLuint v0)
{
programUniform1uiv(program, location, 1, &v0);
}
void Context::programUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
{
GLuint xy[2] = {v0, v1};
programUniform2uiv(program, location, 1, xy);
}
void Context::programUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
{
GLuint xyz[3] = {v0, v1, v2};
programUniform3uiv(program, location, 1, xyz);
}
void Context::programUniform4ui(GLuint program,
GLint location,
GLuint v0,
GLuint v1,
GLuint v2,
GLuint v3)
{
GLuint xyzw[4] = {v0, v1, v2, v3};
programUniform4uiv(program, location, 1, xyzw);
}
void Context::programUniform1f(GLuint program, GLint location, GLfloat v0)
{
programUniform1fv(program, location, 1, &v0);
}
void Context::programUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
{
GLfloat xy[2] = {v0, v1};
programUniform2fv(program, location, 1, xy);
}
void Context::programUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
GLfloat xyz[3] = {v0, v1, v2};
programUniform3fv(program, location, 1, xyz);
}
void Context::programUniform4f(GLuint program,
GLint location,
GLfloat v0,
GLfloat v1,
GLfloat v2,
GLfloat v3)
{
GLfloat xyzw[4] = {v0, v1, v2, v3};
programUniform4fv(program, location, 1, xyzw);
}
void Context::programUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value) void Context::programUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value)
{ {
Program *programObject = getProgram(program); Program *programObject = getProgram(program);
...@@ -5193,6 +5341,182 @@ void Context::programUniform1iv(GLuint program, GLint location, GLsizei count, c ...@@ -5193,6 +5341,182 @@ void Context::programUniform1iv(GLuint program, GLint location, GLsizei count, c
} }
} }
void Context::programUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform2iv(location, count, value);
}
void Context::programUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform3iv(location, count, value);
}
void Context::programUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform4iv(location, count, value);
}
void Context::programUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform1uiv(location, count, value);
}
void Context::programUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform2uiv(location, count, value);
}
void Context::programUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform3uiv(location, count, value);
}
void Context::programUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform4uiv(location, count, value);
}
void Context::programUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform1fv(location, count, value);
}
void Context::programUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform2fv(location, count, value);
}
void Context::programUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform3fv(location, count, value);
}
void Context::programUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniform4fv(location, count, value);
}
void Context::programUniformMatrix2fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix2fv(location, count, transpose, value);
}
void Context::programUniformMatrix3fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix3fv(location, count, transpose, value);
}
void Context::programUniformMatrix4fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix4fv(location, count, transpose, value);
}
void Context::programUniformMatrix2x3fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix2x3fv(location, count, transpose, value);
}
void Context::programUniformMatrix3x2fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix3x2fv(location, count, transpose, value);
}
void Context::programUniformMatrix2x4fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix2x4fv(location, count, transpose, value);
}
void Context::programUniformMatrix4x2fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix4x2fv(location, count, transpose, value);
}
void Context::programUniformMatrix3x4fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix3x4fv(location, count, transpose, value);
}
void Context::programUniformMatrix4x3fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix4x3fv(location, count, transpose, value);
}
void Context::onTextureChange(const Texture *texture) void Context::onTextureChange(const Texture *texture)
{ {
// Conservatively assume all textures are dirty. // Conservatively assume all textures are dirty.
......
...@@ -87,6 +87,7 @@ class Context final : public ValidationContext ...@@ -87,6 +87,7 @@ class Context final : public ValidationContext
GLuint createRenderbuffer(); GLuint createRenderbuffer();
GLuint createPaths(GLsizei range); GLuint createPaths(GLsizei range);
GLuint createProgramPipeline(); GLuint createProgramPipeline();
GLuint createShaderProgramv(GLenum type, GLsizei count, const GLchar *const *strings);
void deleteBuffer(GLuint buffer); void deleteBuffer(GLuint buffer);
void deleteShader(GLuint shader); void deleteShader(GLuint shader);
...@@ -134,6 +135,7 @@ class Context final : public ValidationContext ...@@ -134,6 +135,7 @@ class Context final : public ValidationContext
GLenum access, GLenum access,
GLenum format); GLenum format);
void useProgram(GLuint program); void useProgram(GLuint program);
void useProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
void bindTransformFeedback(GLenum target, GLuint transformFeedbackHandle); void bindTransformFeedback(GLenum target, GLuint transformFeedbackHandle);
void bindProgramPipeline(GLuint pipelineHandle); void bindProgramPipeline(GLuint pipelineHandle);
...@@ -147,7 +149,7 @@ class Context final : public ValidationContext ...@@ -147,7 +149,7 @@ class Context final : public ValidationContext
void getQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params); void getQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void vertexAttribDivisor(GLuint index, GLuint divisor); void vertexAttribDivisor(GLuint index, GLuint divisor);
void setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor); void vertexBindingDivisor(GLuint bindingIndex, GLuint divisor);
void getBufferParameteriv(BufferBinding target, GLenum pname, GLint *params); void getBufferParameteriv(BufferBinding target, GLenum pname, GLint *params);
void getFramebufferAttachmentParameteriv(GLenum target, void getFramebufferAttachmentParameteriv(GLenum target,
...@@ -158,6 +160,8 @@ class Context final : public ValidationContext ...@@ -158,6 +160,8 @@ class Context final : public ValidationContext
void getTexParameterfv(GLenum target, GLenum pname, GLfloat *params); void getTexParameterfv(GLenum target, GLenum pname, GLfloat *params);
void getTexParameteriv(GLenum target, GLenum pname, GLint *params); void getTexParameteriv(GLenum target, GLenum pname, GLint *params);
void getTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
void getTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
void texParameterf(GLenum target, GLenum pname, GLfloat param); void texParameterf(GLenum target, GLenum pname, GLfloat param);
void texParameterfv(GLenum target, GLenum pname, const GLfloat *params); void texParameterfv(GLenum target, GLenum pname, const GLfloat *params);
void texParameteri(GLenum target, GLenum pname, GLint param); void texParameteri(GLenum target, GLenum pname, GLint param);
...@@ -239,6 +243,7 @@ class Context final : public ValidationContext ...@@ -239,6 +243,7 @@ class Context final : public ValidationContext
void getIntegeri_v(GLenum target, GLuint index, GLint *data); void getIntegeri_v(GLenum target, GLuint index, GLint *data);
void getInteger64i_v(GLenum target, GLuint index, GLint64 *data); void getInteger64i_v(GLenum target, GLuint index, GLint64 *data);
void activeShaderProgram(GLuint pipeline, GLuint program);
void activeTexture(GLenum texture); void activeTexture(GLenum texture);
void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
void blendEquation(GLenum mode); void blendEquation(GLenum mode);
...@@ -701,7 +706,12 @@ class Context final : public ValidationContext ...@@ -701,7 +706,12 @@ class Context final : public ValidationContext
void getAttachedShaders(GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders); void getAttachedShaders(GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders);
GLint getAttribLocation(GLuint program, const GLchar *name); GLint getAttribLocation(GLuint program, const GLchar *name);
void getProgramiv(GLuint program, GLenum pname, GLint *params); void getProgramiv(GLuint program, GLenum pname, GLint *params);
void getProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params);
void getProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length, GLchar *infolog); void getProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei *length, GLchar *infolog);
void getProgramPipelineInfoLog(GLuint pipeline,
GLsizei bufSize,
GLsizei *length,
GLchar *infoLog);
void getShaderiv(GLuint shader, GLenum pname, GLint *params); void getShaderiv(GLuint shader, GLenum pname, GLint *params);
void getShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *infolog); void getShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *infolog);
void getShaderPrecisionFormat(GLenum shadertype, void getShaderPrecisionFormat(GLenum shadertype,
...@@ -753,6 +763,7 @@ class Context final : public ValidationContext ...@@ -753,6 +763,7 @@ class Context final : public ValidationContext
void uniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); void uniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
void uniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); void uniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
void validateProgram(GLuint program); void validateProgram(GLuint program);
void validateProgramPipeline(GLuint pipeline);
void genQueries(GLsizei n, GLuint *ids); void genQueries(GLsizei n, GLuint *ids);
void deleteQueries(GLsizei n, const GLuint *ids); void deleteQueries(GLsizei n, const GLuint *ids);
...@@ -861,7 +872,94 @@ class Context final : public ValidationContext ...@@ -861,7 +872,94 @@ class Context final : public ValidationContext
GLsizei bufSize, GLsizei bufSize,
GLint *params); GLint *params);
void programUniform1i(GLuint program, GLint location, GLint v0);
void programUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
void programUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
void programUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
void programUniform1ui(GLuint program, GLint location, GLuint v0);
void programUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1);
void programUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
void programUniform4ui(GLuint program,
GLint location,
GLuint v0,
GLuint v1,
GLuint v2,
GLuint v3);
void programUniform1f(GLuint program, GLint location, GLfloat v0);
void programUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
void programUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
void programUniform4f(GLuint program,
GLint location,
GLfloat v0,
GLfloat v1,
GLfloat v2,
GLfloat v3);
void programUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value); void programUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value);
void programUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value);
void programUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value);
void programUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value);
void programUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
void programUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
void programUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
void programUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value);
void programUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
void programUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
void programUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
void programUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value);
void programUniformMatrix2fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix3fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix4fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix2x3fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix3x2fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix2x4fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix4x2fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix3x4fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void programUniformMatrix4x3fv(GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
void deleteProgramPipelines(GLsizei n, const GLuint *pipelines); void deleteProgramPipelines(GLsizei n, const GLuint *pipelines);
void genProgramPipelines(GLsizei n, GLuint *pipelines); void genProgramPipelines(GLsizei n, GLuint *pipelines);
...@@ -893,12 +991,13 @@ class Context final : public ValidationContext ...@@ -893,12 +991,13 @@ class Context final : public ValidationContext
const Workarounds &getWorkarounds() const; const Workarounds &getWorkarounds() const;
void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params); void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
void setFramebufferParameteri(GLenum target, GLenum pname, GLint param); void framebufferParameteri(GLenum target, GLenum pname, GLint param);
Error getScratchBuffer(size_t requestedSizeBytes, angle::MemoryBuffer **scratchBufferOut) const; Error getScratchBuffer(size_t requestedSizeBytes, angle::MemoryBuffer **scratchBufferOut) const;
Error getZeroFilledBuffer(size_t requstedSizeBytes, angle::MemoryBuffer **zeroBufferOut) const; Error getZeroFilledBuffer(size_t requstedSizeBytes, angle::MemoryBuffer **zeroBufferOut) const;
void dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ); void dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ);
void dispatchComputeIndirect(GLintptr indirect);
MemoryProgramCache *getMemoryProgramCache() const { return mMemoryProgramCache; } MemoryProgramCache *getMemoryProgramCache() const { return mMemoryProgramCache; }
...@@ -917,6 +1016,9 @@ class Context final : public ValidationContext ...@@ -917,6 +1016,9 @@ class Context final : public ValidationContext
GLsizei height, GLsizei height,
GLsizei depth); GLsizei depth);
void memoryBarrier(GLbitfield barriers);
void memoryBarrierByRegion(GLbitfield barriers);
// Notification for a state change in a Texture. // Notification for a state change in a Texture.
void onTextureChange(const Texture *texture); void onTextureChange(const Texture *texture);
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "libANGLE/Query.h" #include "libANGLE/Query.h"
#include "libANGLE/Texture.h" #include "libANGLE/Texture.h"
#include "libANGLE/TransformFeedback.h" #include "libANGLE/TransformFeedback.h"
#include "libANGLE/Uniform.h"
#include "libANGLE/VertexArray.h" #include "libANGLE/VertexArray.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/queryconversions.h" #include "libANGLE/queryconversions.h"
...@@ -393,128 +392,6 @@ bool ValidateTextureSRGBDecodeValue(Context *context, ParamType *params) ...@@ -393,128 +392,6 @@ bool ValidateTextureSRGBDecodeValue(Context *context, ParamType *params)
return true; return true;
} }
bool ValidateUniformCommonBase(ValidationContext *context,
gl::Program *program,
GLint location,
GLsizei count,
const LinkedUniform **uniformOut)
{
// TODO(Jiajia): Add image uniform check in future.
if (count < 0)
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeCount);
return false;
}
if (!program)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidProgramName);
return false;
}
if (!program->isLinked())
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ProgramNotLinked);
return false;
}
if (location == -1)
{
// Silently ignore the uniform command
return false;
}
const auto &uniformLocations = program->getUniformLocations();
size_t castedLocation = static_cast<size_t>(location);
if (castedLocation >= uniformLocations.size())
{
context->handleError(InvalidOperation() << "Invalid uniform location");
return false;
}
const auto &uniformLocation = uniformLocations[castedLocation];
if (uniformLocation.ignored)
{
// Silently ignore the uniform command
return false;
}
if (!uniformLocation.used())
{
context->handleError(InvalidOperation());
return false;
}
const auto &uniform = program->getUniformByIndex(uniformLocation.index);
// attempting to write an array to a non-array uniform is an INVALID_OPERATION
if (!uniform.isArray() && count > 1)
{
context->handleError(InvalidOperation());
return false;
}
*uniformOut = &uniform;
return true;
}
bool ValidateUniform1ivValue(ValidationContext *context,
GLenum uniformType,
GLsizei count,
const GLint *value)
{
// Value type is GL_INT, because we only get here from glUniform1i{v}.
// It is compatible with INT or BOOL.
// Do these cheap tests first, for a little extra speed.
if (GL_INT == uniformType || GL_BOOL == uniformType)
{
return true;
}
if (IsSamplerType(uniformType))
{
// Check that the values are in range.
const GLint max = context->getCaps().maxCombinedTextureImageUnits;
for (GLsizei i = 0; i < count; ++i)
{
if (value[i] < 0 || value[i] >= max)
{
context->handleError(InvalidValue() << "sampler uniform value out of range");
return false;
}
}
return true;
}
context->handleError(InvalidOperation() << "wrong type of value for uniform");
return false;
}
bool ValidateUniformValue(ValidationContext *context, GLenum valueType, GLenum uniformType)
{
// Check that the value type is compatible with uniform type.
// Do the cheaper test first, for a little extra speed.
if (valueType == uniformType || VariableBoolVectorType(valueType) == uniformType)
{
return true;
}
ANGLE_VALIDATION_ERR(context, InvalidOperation(), UniformSizeMismatch);
return false;
}
bool ValidateUniformMatrixValue(ValidationContext *context, GLenum valueType, GLenum uniformType)
{
// Check that the value type is compatible with uniform type.
if (valueType == uniformType)
{
return true;
}
context->handleError(InvalidOperation() << "wrong type of value for uniform");
return false;
}
bool ValidateFragmentShaderColorBufferTypeMatch(ValidationContext *context) bool ValidateFragmentShaderColorBufferTypeMatch(ValidationContext *context)
{ {
const Program *program = context->getGLState().getProgram(); const Program *program = context->getGLState().getProgram();
...@@ -2103,62 +1980,126 @@ bool ValidateGetQueryObjectui64vRobustANGLE(Context *context, ...@@ -2103,62 +1980,126 @@ bool ValidateGetQueryObjectui64vRobustANGLE(Context *context,
return true; return true;
} }
bool ValidateProgramUniform(gl::Context *context, bool ValidateUniformCommonBase(ValidationContext *context,
GLenum valueType, gl::Program *program,
GLuint program,
GLint location, GLint location,
GLsizei count) GLsizei count,
const LinkedUniform **uniformOut)
{ {
// Check for ES31 program uniform entry points // TODO(Jiajia): Add image uniform check in future.
if (context->getClientVersion() < Version(3, 1)) if (count < 0)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeCount);
return false; return false;
} }
const LinkedUniform *uniform = nullptr; if (!program)
gl::Program *programObject = GetValidProgram(context, program); {
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) && ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidProgramName);
ValidateUniformValue(context, valueType, uniform->type); return false;
}
if (!program->isLinked())
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ProgramNotLinked);
return false;
}
if (location == -1)
{
// Silently ignore the uniform command
return false;
}
const auto &uniformLocations = program->getUniformLocations();
size_t castedLocation = static_cast<size_t>(location);
if (castedLocation >= uniformLocations.size())
{
context->handleError(InvalidOperation() << "Invalid uniform location");
return false;
}
const auto &uniformLocation = uniformLocations[castedLocation];
if (uniformLocation.ignored)
{
// Silently ignore the uniform command
return false;
}
if (!uniformLocation.used())
{
context->handleError(InvalidOperation());
return false;
}
const auto &uniform = program->getUniformByIndex(uniformLocation.index);
// attempting to write an array to a non-array uniform is an INVALID_OPERATION
if (!uniform.isArray() && count > 1)
{
context->handleError(InvalidOperation());
return false;
}
*uniformOut = &uniform;
return true;
} }
bool ValidateProgramUniform1iv(gl::Context *context, bool ValidateUniform1ivValue(ValidationContext *context,
GLuint program, GLenum uniformType,
GLint location,
GLsizei count, GLsizei count,
const GLint *value) const GLint *value)
{ {
// Check for ES31 program uniform entry points // Value type is GL_INT, because we only get here from glUniform1i{v}.
if (context->getClientVersion() < Version(3, 1)) // It is compatible with INT or BOOL.
// Do these cheap tests first, for a little extra speed.
if (GL_INT == uniformType || GL_BOOL == uniformType)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); return true;
}
if (IsSamplerType(uniformType))
{
// Check that the values are in range.
const GLint max = context->getCaps().maxCombinedTextureImageUnits;
for (GLsizei i = 0; i < count; ++i)
{
if (value[i] < 0 || value[i] >= max)
{
context->handleError(InvalidValue() << "sampler uniform value out of range");
return false; return false;
} }
}
return true;
}
const LinkedUniform *uniform = nullptr; context->handleError(InvalidOperation() << "wrong type of value for uniform");
gl::Program *programObject = GetValidProgram(context, program); return false;
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniform1ivValue(context, uniform->type, count, value);
} }
bool ValidateProgramUniformMatrix(gl::Context *context, bool ValidateUniformValue(ValidationContext *context, GLenum valueType, GLenum uniformType)
GLenum valueType,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose)
{ {
// Check for ES31 program uniform entry points // Check that the value type is compatible with uniform type.
if (context->getClientVersion() < Version(3, 1)) // Do the cheaper test first, for a little extra speed.
if (valueType == uniformType || VariableBoolVectorType(valueType) == uniformType)
{ {
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); return true;
}
ANGLE_VALIDATION_ERR(context, InvalidOperation(), UniformSizeMismatch);
return false; return false;
}
bool ValidateUniformMatrixValue(ValidationContext *context, GLenum valueType, GLenum uniformType)
{
// Check that the value type is compatible with uniform type.
if (valueType == uniformType)
{
return true;
} }
const LinkedUniform *uniform = nullptr; context->handleError(InvalidOperation() << "wrong type of value for uniform");
gl::Program *programObject = GetValidProgram(context, program); return false;
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniformMatrixValue(context, valueType, uniform->type);
} }
bool ValidateUniform(ValidationContext *context, GLenum valueType, GLint location, GLsizei count) bool ValidateUniform(ValidationContext *context, GLenum valueType, GLint location, GLsizei count)
......
...@@ -26,6 +26,7 @@ namespace gl ...@@ -26,6 +26,7 @@ namespace gl
{ {
class Context; class Context;
struct Format; struct Format;
struct LinkedUniform;
class Program; class Program;
class Shader; class Shader;
class ValidationContext; class ValidationContext;
...@@ -210,23 +211,17 @@ bool ValidateGetQueryObjectui64vRobustANGLE(Context *context, ...@@ -210,23 +211,17 @@ bool ValidateGetQueryObjectui64vRobustANGLE(Context *context,
GLsizei *length, GLsizei *length,
GLuint64 *params); GLuint64 *params);
bool ValidateProgramUniform(Context *context, bool ValidateUniformCommonBase(ValidationContext *context,
GLenum uniformType, gl::Program *program,
GLuint program,
GLint location,
GLsizei count);
bool ValidateProgramUniform1iv(Context *context,
GLuint program,
GLint location, GLint location,
GLsizei count, GLsizei count,
const GLint *value); const LinkedUniform **uniformOut);
bool ValidateProgramUniformMatrix(Context *context, bool ValidateUniform1ivValue(ValidationContext *context,
GLenum matrixType, GLenum uniformType,
GLuint program,
GLint location,
GLsizei count, GLsizei count,
GLboolean transpose); const GLint *value);
bool ValidateUniformValue(ValidationContext *context, GLenum valueType, GLenum uniformType);
bool ValidateUniformMatrixValue(ValidationContext *context, GLenum valueType, GLenum uniformType);
bool ValidateUniform(ValidationContext *context, GLenum uniformType, GLint location, GLsizei count); bool ValidateUniform(ValidationContext *context, GLenum uniformType, GLint location, GLsizei count);
bool ValidateUniformMatrix(ValidationContext *context, bool ValidateUniformMatrix(ValidationContext *context,
GLenum matrixType, GLenum matrixType,
......
...@@ -283,6 +283,78 @@ bool ValidateProgramResourceIndex(const Program *programObject, ...@@ -283,6 +283,78 @@ bool ValidateProgramResourceIndex(const Program *programObject,
} }
} }
bool ValidateProgramUniform(gl::Context *context,
GLenum valueType,
GLuint program,
GLint location,
GLsizei count)
{
// Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1))
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
const LinkedUniform *uniform = nullptr;
gl::Program *programObject = GetValidProgram(context, program);
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniformValue(context, valueType, uniform->type);
}
bool ValidateProgramUniformMatrix(gl::Context *context,
GLenum valueType,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose)
{
// Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1))
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
const LinkedUniform *uniform = nullptr;
gl::Program *programObject = GetValidProgram(context, program);
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniformMatrixValue(context, valueType, uniform->type);
}
bool ValidateVertexAttribFormatCommon(ValidationContext *context,
GLuint attribIndex,
GLint size,
GLenum type,
GLuint relativeOffset,
GLboolean pureInteger)
{
if (context->getClientVersion() < ES_3_1)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
const Caps &caps = context->getCaps();
if (relativeOffset > static_cast<GLuint>(caps.maxVertexAttribRelativeOffset))
{
context->handleError(
InvalidValue()
<< "relativeOffset cannot be greater than MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.");
return false;
}
// [OpenGL ES 3.1] Section 10.3.1 page 243:
// An INVALID_OPERATION error is generated if the default vertex array object is bound.
if (context->getGLState().getVertexArrayId() == 0)
{
context->handleError(InvalidOperation() << "Default vertex array object is bound.");
return false;
}
return ValidateVertexFormatBase(context, attribIndex, size, type, pureInteger);
}
} // anonymous namespace } // anonymous namespace
bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLboolean *data) bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLboolean *data)
...@@ -456,6 +528,333 @@ bool ValidateDrawElementsIndirect(Context *context, GLenum mode, GLenum type, co ...@@ -456,6 +528,333 @@ bool ValidateDrawElementsIndirect(Context *context, GLenum mode, GLenum type, co
return true; return true;
} }
bool ValidateProgramUniform1i(Context *context, GLuint program, GLint location, GLint v0)
{
return ValidateProgramUniform1iv(context, program, location, 1, &v0);
}
bool ValidateProgramUniform2i(Context *context, GLuint program, GLint location, GLint v0, GLint v1)
{
GLint xy[2] = {v0, v1};
return ValidateProgramUniform2iv(context, program, location, 1, xy);
}
bool ValidateProgramUniform3i(Context *context,
GLuint program,
GLint location,
GLint v0,
GLint v1,
GLint v2)
{
GLint xyz[3] = {v0, v1, v2};
return ValidateProgramUniform3iv(context, program, location, 1, xyz);
}
bool ValidateProgramUniform4i(Context *context,
GLuint program,
GLint location,
GLint v0,
GLint v1,
GLint v2,
GLint v3)
{
GLint xyzw[4] = {v0, v1, v2, v3};
return ValidateProgramUniform4iv(context, program, location, 1, xyzw);
}
bool ValidateProgramUniform1ui(Context *context, GLuint program, GLint location, GLuint v0)
{
return ValidateProgramUniform1uiv(context, program, location, 1, &v0);
}
bool ValidateProgramUniform2ui(Context *context,
GLuint program,
GLint location,
GLuint v0,
GLuint v1)
{
GLuint xy[2] = {v0, v1};
return ValidateProgramUniform2uiv(context, program, location, 1, xy);
}
bool ValidateProgramUniform3ui(Context *context,
GLuint program,
GLint location,
GLuint v0,
GLuint v1,
GLuint v2)
{
GLuint xyz[3] = {v0, v1, v2};
return ValidateProgramUniform3uiv(context, program, location, 1, xyz);
}
bool ValidateProgramUniform4ui(Context *context,
GLuint program,
GLint location,
GLuint v0,
GLuint v1,
GLuint v2,
GLuint v3)
{
GLuint xyzw[4] = {v0, v1, v2, v3};
return ValidateProgramUniform4uiv(context, program, location, 1, xyzw);
}
bool ValidateProgramUniform1f(Context *context, GLuint program, GLint location, GLfloat v0)
{
return ValidateProgramUniform1fv(context, program, location, 1, &v0);
}
bool ValidateProgramUniform2f(Context *context,
GLuint program,
GLint location,
GLfloat v0,
GLfloat v1)
{
GLfloat xy[2] = {v0, v1};
return ValidateProgramUniform2fv(context, program, location, 1, xy);
}
bool ValidateProgramUniform3f(Context *context,
GLuint program,
GLint location,
GLfloat v0,
GLfloat v1,
GLfloat v2)
{
GLfloat xyz[3] = {v0, v1, v2};
return ValidateProgramUniform3fv(context, program, location, 1, xyz);
}
bool ValidateProgramUniform4f(Context *context,
GLuint program,
GLint location,
GLfloat v0,
GLfloat v1,
GLfloat v2,
GLfloat v3)
{
GLfloat xyzw[4] = {v0, v1, v2, v3};
return ValidateProgramUniform4fv(context, program, location, 1, xyzw);
}
bool ValidateProgramUniform1iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value)
{
// Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1))
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
const LinkedUniform *uniform = nullptr;
gl::Program *programObject = GetValidProgram(context, program);
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
ValidateUniform1ivValue(context, uniform->type, count, value);
}
bool ValidateProgramUniform2iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value)
{
return ValidateProgramUniform(context, GL_INT_VEC2, program, location, count);
}
bool ValidateProgramUniform3iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value)
{
return ValidateProgramUniform(context, GL_INT_VEC3, program, location, count);
}
bool ValidateProgramUniform4iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value)
{
return ValidateProgramUniform(context, GL_INT_VEC4, program, location, count);
}
bool ValidateProgramUniform1uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value)
{
return ValidateProgramUniform(context, GL_UNSIGNED_INT, program, location, count);
}
bool ValidateProgramUniform2uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value)
{
return ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC2, program, location, count);
}
bool ValidateProgramUniform3uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value)
{
return ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC3, program, location, count);
}
bool ValidateProgramUniform4uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value)
{
return ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC4, program, location, count);
}
bool ValidateProgramUniform1fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value)
{
return ValidateProgramUniform(context, GL_FLOAT, program, location, count);
}
bool ValidateProgramUniform2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value)
{
return ValidateProgramUniform(context, GL_FLOAT_VEC2, program, location, count);
}
bool ValidateProgramUniform3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value)
{
return ValidateProgramUniform(context, GL_FLOAT_VEC3, program, location, count);
}
bool ValidateProgramUniform4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value)
{
return ValidateProgramUniform(context, GL_FLOAT_VEC4, program, location, count);
}
bool ValidateProgramUniformMatrix2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix2x3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2x3, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix3x2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3x2, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix2x4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2x4, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix4x2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4x2, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix3x4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3x4, program, location, count,
transpose);
}
bool ValidateProgramUniformMatrix4x3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value)
{
return ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4x3, program, location, count,
transpose);
}
bool ValidateGetTexLevelParameterBase(Context *context, bool ValidateGetTexLevelParameterBase(Context *context,
GLenum target, GLenum target,
GLint level, GLint level,
...@@ -548,7 +947,7 @@ bool ValidateGetTexLevelParameteriv(Context *context, ...@@ -548,7 +947,7 @@ bool ValidateGetTexLevelParameteriv(Context *context,
return ValidateGetTexLevelParameterBase(context, target, level, pname, nullptr); return ValidateGetTexLevelParameterBase(context, target, level, pname, nullptr);
} }
bool ValidateTexStorage2DMultiSample(Context *context, bool ValidateTexStorage2DMultisample(Context *context,
GLenum target, GLenum target,
GLsizei samples, GLsizei samples,
GLint internalFormat, GLint internalFormat,
...@@ -660,7 +1059,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl ...@@ -660,7 +1059,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl
return true; return true;
} }
bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pname, GLint param) bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname, GLint param)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
...@@ -733,10 +1132,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna ...@@ -733,10 +1132,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna
return true; return true;
} }
bool ValidationGetFramebufferParameteri(Context *context, bool ValidateGetFramebufferParameteriv(Context *context, GLenum target, GLenum pname, GLint *params)
GLenum target,
GLenum pname,
GLint *params)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
...@@ -878,36 +1274,23 @@ bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingInde ...@@ -878,36 +1274,23 @@ bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingInde
} }
bool ValidateVertexAttribFormat(ValidationContext *context, bool ValidateVertexAttribFormat(ValidationContext *context,
GLuint attribIndex, GLuint attribindex,
GLint size, GLint size,
GLenum type, GLenum type,
GLuint relativeOffset, GLboolean normalized,
GLboolean pureInteger) GLuint relativeoffset)
{ {
if (context->getClientVersion() < ES_3_1) return ValidateVertexAttribFormatCommon(context, attribindex, size, type, relativeoffset,
{ false);
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required); }
return false;
}
const Caps &caps = context->getCaps();
if (relativeOffset > static_cast<GLuint>(caps.maxVertexAttribRelativeOffset))
{
context->handleError(
InvalidValue()
<< "relativeOffset cannot be greater than MAX_VERTEX_ATTRIB_RELATIVE_OFFSET.");
return false;
}
// [OpenGL ES 3.1] Section 10.3.1 page 243:
// An INVALID_OPERATION error is generated if the default vertex array object is bound.
if (context->getGLState().getVertexArrayId() == 0)
{
context->handleError(InvalidOperation() << "Default vertex array object is bound.");
return false;
}
return ValidateVertexFormatBase(context, attribIndex, size, type, pureInteger); bool ValidateVertexAttribIFormat(ValidationContext *context,
GLuint attribindex,
GLint size,
GLenum type,
GLuint relativeoffset)
{
return ValidateVertexAttribFormatCommon(context, attribindex, size, type, relativeoffset, true);
} }
bool ValidateVertexAttribBinding(ValidationContext *context, bool ValidateVertexAttribBinding(ValidationContext *context,
...@@ -1042,6 +1425,12 @@ bool ValidateDispatchCompute(Context *context, ...@@ -1042,6 +1425,12 @@ bool ValidateDispatchCompute(Context *context,
return true; return true;
} }
bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect)
{
UNIMPLEMENTED();
return false;
}
bool ValidateBindImageTexture(Context *context, bool ValidateBindImageTexture(Context *context,
GLuint unit, GLuint unit,
GLuint texture, GLuint texture,
...@@ -1322,7 +1711,62 @@ bool ValidateIsProgramPipeline(Context *context, GLuint pipeline) ...@@ -1322,7 +1711,62 @@ bool ValidateIsProgramPipeline(Context *context, GLuint pipeline)
return true; return true;
} }
bool ValidateSampleMaski(Context *context, GLuint maskNumber) bool ValidateUseProgramStages(Context *context, GLuint pipeline, GLbitfield stages, GLuint program)
{
UNIMPLEMENTED();
return false;
}
bool ValidateActiveShaderProgram(Context *context, GLuint pipeline, GLuint program)
{
UNIMPLEMENTED();
return false;
}
bool ValidateCreateShaderProgramv(Context *context,
GLenum type,
GLsizei count,
const GLchar *const *strings)
{
UNIMPLEMENTED();
return false;
}
bool ValidateGetProgramPipelineiv(Context *context, GLuint pipeline, GLenum pname, GLint *params)
{
UNIMPLEMENTED();
return false;
}
bool ValidateValidateProgramPipeline(Context *context, GLuint pipeline)
{
UNIMPLEMENTED();
return false;
}
bool ValidateGetProgramPipelineInfoLog(Context *context,
GLuint pipeline,
GLsizei bufSize,
GLsizei *length,
GLchar *infoLog)
{
UNIMPLEMENTED();
return false;
}
bool ValidateMemoryBarrier(Context *context, GLbitfield barriers)
{
UNIMPLEMENTED();
return false;
}
bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers)
{
UNIMPLEMENTED();
return false;
}
bool ValidateSampleMaski(Context *context, GLuint maskNumber, GLbitfield mask)
{ {
if (context->getClientVersion() < ES_3_1) if (context->getClientVersion() < ES_3_1)
{ {
......
...@@ -35,7 +35,7 @@ bool ValidateGetTexLevelParameteriv(Context *context, ...@@ -35,7 +35,7 @@ bool ValidateGetTexLevelParameteriv(Context *context,
GLenum pname, GLenum pname,
GLint *param); GLint *param);
bool ValidateTexStorage2DMultiSample(Context *context, bool ValidateTexStorage2DMultisample(Context *context,
GLenum target, GLenum target,
GLsizei samples, GLsizei samples,
GLint internalFormat, GLint internalFormat,
...@@ -48,8 +48,183 @@ bool ValidateDrawIndirectBase(Context *context, GLenum mode, const void *indirec ...@@ -48,8 +48,183 @@ bool ValidateDrawIndirectBase(Context *context, GLenum mode, const void *indirec
bool ValidateDrawArraysIndirect(Context *context, GLenum mode, const void *indirect); bool ValidateDrawArraysIndirect(Context *context, GLenum mode, const void *indirect);
bool ValidateDrawElementsIndirect(Context *context, GLenum mode, GLenum type, const void *indirect); bool ValidateDrawElementsIndirect(Context *context, GLenum mode, GLenum type, const void *indirect);
bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pname, GLint param); bool ValidateProgramUniform1i(Context *context, GLuint program, GLint location, GLint v0);
bool ValidationGetFramebufferParameteri(Context *context, bool ValidateProgramUniform2i(Context *context, GLuint program, GLint location, GLint v0, GLint v1);
bool ValidateProgramUniform3i(Context *context,
GLuint program,
GLint location,
GLint v0,
GLint v1,
GLint v2);
bool ValidateProgramUniform4i(Context *context,
GLuint program,
GLint location,
GLint v0,
GLint v1,
GLint v2,
GLint v3);
bool ValidateProgramUniform1ui(Context *context, GLuint program, GLint location, GLuint v0);
bool ValidateProgramUniform2ui(Context *context,
GLuint program,
GLint location,
GLuint v0,
GLuint v1);
bool ValidateProgramUniform3ui(Context *context,
GLuint program,
GLint location,
GLuint v0,
GLuint v1,
GLuint v2);
bool ValidateProgramUniform4ui(Context *context,
GLuint program,
GLint location,
GLuint v0,
GLuint v1,
GLuint v2,
GLuint v3);
bool ValidateProgramUniform1f(Context *context, GLuint program, GLint location, GLfloat v0);
bool ValidateProgramUniform2f(Context *context,
GLuint program,
GLint location,
GLfloat v0,
GLfloat v1);
bool ValidateProgramUniform3f(Context *context,
GLuint program,
GLint location,
GLfloat v0,
GLfloat v1,
GLfloat v2);
bool ValidateProgramUniform4f(Context *context,
GLuint program,
GLint location,
GLfloat v0,
GLfloat v1,
GLfloat v2,
GLfloat v3);
bool ValidateProgramUniform1iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value);
bool ValidateProgramUniform2iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value);
bool ValidateProgramUniform3iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value);
bool ValidateProgramUniform4iv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLint *value);
bool ValidateProgramUniform1uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value);
bool ValidateProgramUniform2uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value);
bool ValidateProgramUniform3uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value);
bool ValidateProgramUniform4uiv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLuint *value);
bool ValidateProgramUniform1fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value);
bool ValidateProgramUniform2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value);
bool ValidateProgramUniform3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value);
bool ValidateProgramUniform4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
const GLfloat *value);
bool ValidateProgramUniformMatrix2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix2x3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix3x2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix2x4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix4x2fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix3x4fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateProgramUniformMatrix4x3fv(Context *context,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value);
bool ValidateFramebufferParameteri(Context *context, GLenum target, GLenum pname, GLint param);
bool ValidateGetFramebufferParameteriv(Context *context,
GLenum target, GLenum target,
GLenum pname, GLenum pname,
GLint *params); GLint *params);
...@@ -92,11 +267,16 @@ bool ValidateBindVertexBuffer(ValidationContext *context, ...@@ -92,11 +267,16 @@ bool ValidateBindVertexBuffer(ValidationContext *context,
GLintptr offset, GLintptr offset,
GLsizei stride); GLsizei stride);
bool ValidateVertexAttribFormat(ValidationContext *context, bool ValidateVertexAttribFormat(ValidationContext *context,
GLuint attribIndex, GLuint attribindex,
GLint size,
GLenum type,
GLboolean normalized,
GLuint relativeoffset);
bool ValidateVertexAttribIFormat(ValidationContext *context,
GLuint attribindex,
GLint size, GLint size,
GLenum type, GLenum type,
GLuint relativeOffset, GLuint relativeoffset);
GLboolean pureInteger);
bool ValidateVertexAttribBinding(ValidationContext *context, bool ValidateVertexAttribBinding(ValidationContext *context,
GLuint attribIndex, GLuint attribIndex,
GLuint bindingIndex); GLuint bindingIndex);
...@@ -106,6 +286,7 @@ bool ValidateDispatchCompute(Context *context, ...@@ -106,6 +286,7 @@ bool ValidateDispatchCompute(Context *context,
GLuint numGroupsX, GLuint numGroupsX,
GLuint numGroupsY, GLuint numGroupsY,
GLuint numGroupsZ); GLuint numGroupsZ);
bool ValidateDispatchComputeIndirect(Context *context, GLintptr indirect);
bool ValidateBindImageTexture(Context *context, bool ValidateBindImageTexture(Context *context,
GLuint unit, GLuint unit,
...@@ -120,8 +301,24 @@ bool ValidateGenProgramPipelines(Context *context, GLint n, GLuint *pipelines); ...@@ -120,8 +301,24 @@ bool ValidateGenProgramPipelines(Context *context, GLint n, GLuint *pipelines);
bool ValidateDeleteProgramPipelines(Context *context, GLint n, const GLuint *pipelines); bool ValidateDeleteProgramPipelines(Context *context, GLint n, const GLuint *pipelines);
bool ValidateBindProgramPipeline(Context *context, GLuint pipeline); bool ValidateBindProgramPipeline(Context *context, GLuint pipeline);
bool ValidateIsProgramPipeline(Context *context, GLuint pipeline); bool ValidateIsProgramPipeline(Context *context, GLuint pipeline);
bool ValidateUseProgramStages(Context *context, GLuint pipeline, GLbitfield stages, GLuint program);
bool ValidateActiveShaderProgram(Context *context, GLuint pipeline, GLuint program);
bool ValidateCreateShaderProgramv(Context *context,
GLenum type,
GLsizei count,
const GLchar *const *strings);
bool ValidateGetProgramPipelineiv(Context *context, GLuint pipeline, GLenum pname, GLint *params);
bool ValidateValidateProgramPipeline(Context *context, GLuint pipeline);
bool ValidateGetProgramPipelineInfoLog(Context *context,
GLuint pipeline,
GLsizei bufSize,
GLsizei *length,
GLchar *infoLog);
bool ValidateMemoryBarrier(Context *context, GLbitfield barriers);
bool ValidateMemoryBarrierByRegion(Context *context, GLbitfield barriers);
bool ValidateSampleMaski(Context *context, GLuint maskNumber); bool ValidateSampleMaski(Context *context, GLuint maskNumber, GLbitfield mask);
} // namespace gl } // namespace gl
......
...@@ -10,15 +10,8 @@ ...@@ -10,15 +10,8 @@
#include "libGLESv2/global_state.h" #include "libGLESv2/global_state.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
#include "libANGLE/Error.h"
#include "libANGLE/validationES.h"
#include "libANGLE/validationES31.h" #include "libANGLE/validationES31.h"
#include "libANGLE/queryconversions.h"
#include "libANGLE/queryutils.h"
#include "common/debug.h"
#include "common/utilities.h"
namespace gl namespace gl
{ {
...@@ -43,14 +36,16 @@ void GL_APIENTRY DispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint nu ...@@ -43,14 +36,16 @@ void GL_APIENTRY DispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint nu
void GL_APIENTRY DispatchComputeIndirect(GLintptr indirect) void GL_APIENTRY DispatchComputeIndirect(GLintptr indirect)
{ {
EVENT("(GLintptr indirect = %d)", indirect); EVENT("(GLintptr indirect = %d)", indirect);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() && !ValidateDispatchComputeIndirect(context, indirect))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->dispatchComputeIndirect(indirect);
} }
} }
...@@ -92,12 +87,12 @@ void GL_APIENTRY FramebufferParameteri(GLenum target, GLenum pname, GLint param) ...@@ -92,12 +87,12 @@ void GL_APIENTRY FramebufferParameteri(GLenum target, GLenum pname, GLint param)
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidationFramebufferParameteri(context, target, pname, param)) !ValidateFramebufferParameteri(context, target, pname, param))
{ {
return; return;
} }
context->setFramebufferParameteri(target, pname, param); context->framebufferParameteri(target, pname, param);
} }
} }
...@@ -109,7 +104,7 @@ void GL_APIENTRY GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *p ...@@ -109,7 +104,7 @@ void GL_APIENTRY GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *p
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidationGetFramebufferParameteri(context, target, pname, params)) !ValidateGetFramebufferParameteriv(context, target, pname, params))
{ {
return; return;
} }
...@@ -233,43 +228,51 @@ void GL_APIENTRY UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint pro ...@@ -233,43 +228,51 @@ void GL_APIENTRY UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint pro
{ {
EVENT("(GLuint pipeline = %u, GLbitfield stages = 0x%X, GLuint program = %u)", pipeline, stages, EVENT("(GLuint pipeline = %u, GLbitfield stages = 0x%X, GLuint program = %u)", pipeline, stages,
program); program);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() &&
!ValidateUseProgramStages(context, pipeline, stages, program))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->useProgramStages(pipeline, stages, program);
} }
} }
void GL_APIENTRY ActiveShaderProgram(GLuint pipeline, GLuint program) void GL_APIENTRY ActiveShaderProgram(GLuint pipeline, GLuint program)
{ {
EVENT("(GLuint pipeline = %u, GLuint program = %u)", pipeline, program); EVENT("(GLuint pipeline = %u, GLuint program = %u)", pipeline, program);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() && !ValidateActiveShaderProgram(context, pipeline, program))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->activeShaderProgram(pipeline, program);
} }
} }
GLuint GL_APIENTRY CreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const *strings) GLuint GL_APIENTRY CreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const *strings)
{ {
EVENT("(GLenum type = %0x%X, GLsizei count = %d, const GLchar *const* = 0x%0.8p)", type, count, EVENT("(GLenum type = 0x%X, GLsizei count = %d, const GLchar *const*strings = 0x%0.8p)", type,
strings); count, strings);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() &&
!ValidateCreateShaderProgramv(context, type, count, strings))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return 0u;
} }
UNIMPLEMENTED();
return context->createShaderProgramv(type, count, strings);
} }
return 0u; return 0u;
} }
...@@ -338,90 +341,245 @@ GLboolean GL_APIENTRY IsProgramPipeline(GLuint pipeline) ...@@ -338,90 +341,245 @@ GLboolean GL_APIENTRY IsProgramPipeline(GLuint pipeline)
void GL_APIENTRY GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) void GL_APIENTRY GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
{ {
EVENT("(GLuint pipeline = %u, GLenum pname = 0x%X, GLint* params = 0x%0.8p)", pipeline, pname, EVENT("(GLuint pipeline = %u, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", pipeline, pname,
params); params);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() &&
!ValidateGetProgramPipelineiv(context, pipeline, pname, params))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->getProgramPipelineiv(pipeline, pname, params);
} }
} }
void GL_APIENTRY ProgramUniform1i(GLuint program, GLint location, GLint v0) void GL_APIENTRY ProgramUniform1i(GLuint program, GLint location, GLint v0)
{ {
ProgramUniform1iv(program, location, 1, &v0); EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d)", program, location, v0);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateProgramUniform1i(context, program, location, v0))
{
return;
}
context->programUniform1i(program, location, v0);
}
} }
void GL_APIENTRY ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1) void GL_APIENTRY ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
{ {
GLint xy[2] = {v0, v1}; EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d)", program,
ProgramUniform2iv(program, location, 1, xy); location, v0, v1);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform2i(context, program, location, v0, v1))
{
return;
}
context->programUniform2i(program, location, v0, v1);
}
} }
void GL_APIENTRY ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2) void GL_APIENTRY ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
{ {
GLint xyz[3] = {v0, v1, v2}; EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d)",
ProgramUniform3iv(program, location, 1, xyz); program, location, v0, v1, v2);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform3i(context, program, location, v0, v1, v2))
{
return;
}
context->programUniform3i(program, location, v0, v1, v2);
}
} }
void GL_APIENTRY void GL_APIENTRY
ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3) ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{ {
GLint xyzw[4] = {v0, v1, v2, v3}; EVENT(
ProgramUniform4iv(program, location, 1, xyzw); "(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d, "
"GLint v3 = %d)",
program, location, v0, v1, v2, v3);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform4i(context, program, location, v0, v1, v2, v3))
{
return;
}
context->programUniform4i(program, location, v0, v1, v2, v3);
}
} }
void GL_APIENTRY ProgramUniform1ui(GLuint program, GLint location, GLuint v0) void GL_APIENTRY ProgramUniform1ui(GLuint program, GLint location, GLuint v0)
{ {
ProgramUniform1uiv(program, location, 1, &v0); EVENT("(GLuint program = %u, GLint location = %d, GLuint v0 = %u)", program, location, v0);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform1ui(context, program, location, v0))
{
return;
}
context->programUniform1ui(program, location, v0);
}
} }
void GL_APIENTRY ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1) void GL_APIENTRY ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
{ {
GLuint xy[2] = {v0, v1}; EVENT("(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u)", program,
ProgramUniform2uiv(program, location, 1, xy); location, v0, v1);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform2ui(context, program, location, v0, v1))
{
return;
}
context->programUniform2ui(program, location, v0, v1);
}
} }
void GL_APIENTRY ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2) void GL_APIENTRY ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
{ {
GLuint xyz[3] = {v0, v1, v2}; EVENT(
ProgramUniform3uiv(program, location, 1, xyz); "(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = "
"%u)",
program, location, v0, v1, v2);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform3ui(context, program, location, v0, v1, v2))
{
return;
}
context->programUniform3ui(program, location, v0, v1, v2);
}
} }
void GL_APIENTRY void GL_APIENTRY
ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
{ {
GLuint xyzw[4] = {v0, v1, v2, v3}; EVENT(
ProgramUniform4uiv(program, location, 1, xyzw); "(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = "
"%u, GLuint v3 = %u)",
program, location, v0, v1, v2, v3);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform4ui(context, program, location, v0, v1, v2, v3))
{
return;
}
context->programUniform4ui(program, location, v0, v1, v2, v3);
}
} }
void GL_APIENTRY ProgramUniform1f(GLuint program, GLint location, GLfloat v0) void GL_APIENTRY ProgramUniform1f(GLuint program, GLint location, GLfloat v0)
{ {
ProgramUniform1fv(program, location, 1, &v0); EVENT("(GLuint program = %u, GLint location = %d, GLfloat v0 = %f)", program, location, v0);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() && !ValidateProgramUniform1f(context, program, location, v0))
{
return;
}
context->programUniform1f(program, location, v0);
}
} }
void GL_APIENTRY ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1) void GL_APIENTRY ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
{ {
GLfloat xy[2] = {v0, v1}; EVENT("(GLuint program = %u, GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f)", program,
ProgramUniform2fv(program, location, 1, xy); location, v0, v1);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform2f(context, program, location, v0, v1))
{
return;
}
context->programUniform2f(program, location, v0, v1);
}
} }
void GL_APIENTRY void GL_APIENTRY
ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2) ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{ {
GLfloat xyz[3] = {v0, v1, v2}; EVENT(
ProgramUniform3fv(program, location, 1, xyz); "(GLuint program = %u, GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = "
"%f)",
program, location, v0, v1, v2);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform3f(context, program, location, v0, v1, v2))
{
return;
}
context->programUniform3f(program, location, v0, v1, v2);
}
} }
void GL_APIENTRY void GL_APIENTRY
ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{ {
GLfloat xyzw[4] = {v0, v1, v2, v3}; EVENT(
ProgramUniform4fv(program, location, 1, xyzw); "(GLuint program = %u, GLint location = %d, GLfloat v0 = %f, GLfloat v1 = %f, GLfloat v2 = "
"%f, GLfloat v3 = %f)",
program, location, v0, v1, v2, v3);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateProgramUniform4f(context, program, location, v0, v1, v2, v3))
{
return;
}
context->programUniform4f(program, location, v0, v1, v2, v3);
}
} }
void GL_APIENTRY ProgramUniform1iv(GLuint program, void GL_APIENTRY ProgramUniform1iv(GLuint program,
...@@ -457,14 +615,12 @@ void GL_APIENTRY ProgramUniform2iv(GLuint program, ...@@ -457,14 +615,12 @@ void GL_APIENTRY ProgramUniform2iv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_INT_VEC2, program, location, count)) if (!ValidateProgramUniform2iv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform2iv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform2iv(location, count, value);
} }
} }
...@@ -480,14 +636,12 @@ void GL_APIENTRY ProgramUniform3iv(GLuint program, ...@@ -480,14 +636,12 @@ void GL_APIENTRY ProgramUniform3iv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_INT_VEC3, program, location, count)) if (!ValidateProgramUniform3iv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform3iv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform3iv(location, count, value);
} }
} }
...@@ -503,14 +657,12 @@ void GL_APIENTRY ProgramUniform4iv(GLuint program, ...@@ -503,14 +657,12 @@ void GL_APIENTRY ProgramUniform4iv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_INT_VEC4, program, location, count)) if (!ValidateProgramUniform4iv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform4iv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform4iv(location, count, value);
} }
} }
...@@ -526,14 +678,12 @@ void GL_APIENTRY ProgramUniform1uiv(GLuint program, ...@@ -526,14 +678,12 @@ void GL_APIENTRY ProgramUniform1uiv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT, program, location, count)) if (!ValidateProgramUniform1uiv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform1uiv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform1uiv(location, count, value);
} }
} }
...@@ -549,14 +699,12 @@ void GL_APIENTRY ProgramUniform2uiv(GLuint program, ...@@ -549,14 +699,12 @@ void GL_APIENTRY ProgramUniform2uiv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC2, program, location, count)) if (!ValidateProgramUniform2uiv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform2uiv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform2uiv(location, count, value);
} }
} }
...@@ -572,14 +720,12 @@ void GL_APIENTRY ProgramUniform3uiv(GLuint program, ...@@ -572,14 +720,12 @@ void GL_APIENTRY ProgramUniform3uiv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC3, program, location, count)) if (!ValidateProgramUniform3uiv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform3uiv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform3uiv(location, count, value);
} }
} }
...@@ -595,14 +741,12 @@ void GL_APIENTRY ProgramUniform4uiv(GLuint program, ...@@ -595,14 +741,12 @@ void GL_APIENTRY ProgramUniform4uiv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC4, program, location, count)) if (!ValidateProgramUniform4uiv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform4uiv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform4uiv(location, count, value);
} }
} }
...@@ -618,14 +762,12 @@ void GL_APIENTRY ProgramUniform1fv(GLuint program, ...@@ -618,14 +762,12 @@ void GL_APIENTRY ProgramUniform1fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_FLOAT, program, location, count)) if (!ValidateProgramUniform1fv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform1fv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform1fv(location, count, value);
} }
} }
...@@ -641,14 +783,12 @@ void GL_APIENTRY ProgramUniform2fv(GLuint program, ...@@ -641,14 +783,12 @@ void GL_APIENTRY ProgramUniform2fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_FLOAT_VEC2, program, location, count)) if (!ValidateProgramUniform2fv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform2fv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform2fv(location, count, value);
} }
} }
...@@ -664,14 +804,12 @@ void GL_APIENTRY ProgramUniform3fv(GLuint program, ...@@ -664,14 +804,12 @@ void GL_APIENTRY ProgramUniform3fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_FLOAT_VEC3, program, location, count)) if (!ValidateProgramUniform3fv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform3fv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform3fv(location, count, value);
} }
} }
...@@ -687,14 +825,12 @@ void GL_APIENTRY ProgramUniform4fv(GLuint program, ...@@ -687,14 +825,12 @@ void GL_APIENTRY ProgramUniform4fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniform(context, GL_FLOAT_VEC4, program, location, count)) if (!ValidateProgramUniform4fv(context, program, location, count, value))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniform4fv(program, location, count, value);
ASSERT(programObject);
programObject->setUniform4fv(location, count, value);
} }
} }
...@@ -711,15 +847,12 @@ void GL_APIENTRY ProgramUniformMatrix2fv(GLuint program, ...@@ -711,15 +847,12 @@ void GL_APIENTRY ProgramUniformMatrix2fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2, program, location, count, if (!ValidateProgramUniformMatrix2fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix2fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix2fv(location, count, transpose, value);
} }
} }
...@@ -736,15 +869,12 @@ void GL_APIENTRY ProgramUniformMatrix3fv(GLuint program, ...@@ -736,15 +869,12 @@ void GL_APIENTRY ProgramUniformMatrix3fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3, program, location, count, if (!ValidateProgramUniformMatrix3fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix3fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix3fv(location, count, transpose, value);
} }
} }
...@@ -761,15 +891,12 @@ void GL_APIENTRY ProgramUniformMatrix4fv(GLuint program, ...@@ -761,15 +891,12 @@ void GL_APIENTRY ProgramUniformMatrix4fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4, program, location, count, if (!ValidateProgramUniformMatrix4fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix4fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix4fv(location, count, transpose, value);
} }
} }
...@@ -786,15 +913,12 @@ void GL_APIENTRY ProgramUniformMatrix2x3fv(GLuint program, ...@@ -786,15 +913,12 @@ void GL_APIENTRY ProgramUniformMatrix2x3fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2x3, program, location, count, if (!ValidateProgramUniformMatrix2x3fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix2x3fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix2x3fv(location, count, transpose, value);
} }
} }
...@@ -811,15 +935,12 @@ void GL_APIENTRY ProgramUniformMatrix3x2fv(GLuint program, ...@@ -811,15 +935,12 @@ void GL_APIENTRY ProgramUniformMatrix3x2fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3x2, program, location, count, if (!ValidateProgramUniformMatrix3x2fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix3x2fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix3x2fv(location, count, transpose, value);
} }
} }
...@@ -836,15 +957,12 @@ void GL_APIENTRY ProgramUniformMatrix2x4fv(GLuint program, ...@@ -836,15 +957,12 @@ void GL_APIENTRY ProgramUniformMatrix2x4fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2x4, program, location, count, if (!ValidateProgramUniformMatrix2x4fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix2x4fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix2x4fv(location, count, transpose, value);
} }
} }
...@@ -861,15 +979,12 @@ void GL_APIENTRY ProgramUniformMatrix4x2fv(GLuint program, ...@@ -861,15 +979,12 @@ void GL_APIENTRY ProgramUniformMatrix4x2fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4x2, program, location, count, if (!ValidateProgramUniformMatrix4x2fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix4x2fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix4x2fv(location, count, transpose, value);
} }
} }
...@@ -886,15 +1001,12 @@ void GL_APIENTRY ProgramUniformMatrix3x4fv(GLuint program, ...@@ -886,15 +1001,12 @@ void GL_APIENTRY ProgramUniformMatrix3x4fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3x4, program, location, count, if (!ValidateProgramUniformMatrix3x4fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix3x4fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix3x4fv(location, count, transpose, value);
} }
} }
...@@ -911,29 +1023,28 @@ void GL_APIENTRY ProgramUniformMatrix4x3fv(GLuint program, ...@@ -911,29 +1023,28 @@ void GL_APIENTRY ProgramUniformMatrix4x3fv(GLuint program,
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4x3, program, location, count, if (!ValidateProgramUniformMatrix4x3fv(context, program, location, count, transpose, value))
transpose))
{ {
return; return;
} }
Program *programObject = context->getProgram(program); context->programUniformMatrix4x3fv(program, location, count, transpose, value);
ASSERT(programObject);
programObject->setUniformMatrix4x3fv(location, count, transpose, value);
} }
} }
void GL_APIENTRY ValidateProgramPipeline(GLuint pipeline) void GL_APIENTRY ValidateProgramPipeline(GLuint pipeline)
{ {
EVENT("(GLuint pipeline = %u)", pipeline); EVENT("(GLuint pipeline = %u)", pipeline);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() && !ValidateValidateProgramPipeline(context, pipeline))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->validateProgramPipeline(pipeline);
} }
} }
...@@ -943,17 +1054,20 @@ void GL_APIENTRY GetProgramPipelineInfoLog(GLuint pipeline, ...@@ -943,17 +1054,20 @@ void GL_APIENTRY GetProgramPipelineInfoLog(GLuint pipeline,
GLchar *infoLog) GLchar *infoLog)
{ {
EVENT( EVENT(
"(GLuint pipeline = %u, GLsizei bufSize = %d, GLsizei* length = 0x%0.8p, GLchar* infoLog = " "(GLuint pipeline = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
"0x%0.8p)", "0x%0.8p)",
pipeline, bufSize, length, infoLog); pipeline, bufSize, length, infoLog);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() &&
!ValidateGetProgramPipelineInfoLog(context, pipeline, bufSize, length, infoLog))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->getProgramPipelineInfoLog(pipeline, bufSize, length, infoLog);
} }
} }
...@@ -1001,28 +1115,32 @@ void GL_APIENTRY GetBooleani_v(GLenum target, GLuint index, GLboolean *data) ...@@ -1001,28 +1115,32 @@ void GL_APIENTRY GetBooleani_v(GLenum target, GLuint index, GLboolean *data)
void GL_APIENTRY MemoryBarrier(GLbitfield barriers) void GL_APIENTRY MemoryBarrier(GLbitfield barriers)
{ {
EVENT("(GLbitfield barriers = 0x%X)", barriers); EVENT("(GLbitfield barriers = 0x%X)", barriers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() && !ValidateMemoryBarrier(context, barriers))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->memoryBarrier(barriers);
} }
} }
void GL_APIENTRY MemoryBarrierByRegion(GLbitfield barriers) void GL_APIENTRY MemoryBarrierByRegion(GLbitfield barriers)
{ {
EVENT("(GLbitfield barriers = 0x%X)", barriers); EVENT("(GLbitfield barriers = 0x%X)", barriers);
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation()) if (!context->skipValidation() && !ValidateMemoryBarrierByRegion(context, barriers))
{ {
context->handleError(InvalidOperation() << "Entry point not implemented"); return;
} }
UNIMPLEMENTED();
context->memoryBarrierByRegion(barriers);
} }
} }
...@@ -1041,7 +1159,7 @@ void GL_APIENTRY TexStorage2DMultisample(GLenum target, ...@@ -1041,7 +1159,7 @@ void GL_APIENTRY TexStorage2DMultisample(GLenum target,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateTexStorage2DMultiSample(context, target, samples, internalformat, width, !ValidateTexStorage2DMultisample(context, target, samples, internalformat, width,
height, fixedsamplelocations)) height, fixedsamplelocations))
{ {
return; return;
...@@ -1073,7 +1191,7 @@ void GL_APIENTRY SampleMaski(GLuint maskNumber, GLbitfield mask) ...@@ -1073,7 +1191,7 @@ void GL_APIENTRY SampleMaski(GLuint maskNumber, GLbitfield mask)
Context *context = GetValidGlobalContext(); Context *context = GetValidGlobalContext();
if (context) if (context)
{ {
if (!context->skipValidation() && !ValidateSampleMaski(context, maskNumber)) if (!context->skipValidation() && !ValidateSampleMaski(context, maskNumber, mask))
{ {
return; return;
} }
...@@ -1095,9 +1213,7 @@ void GL_APIENTRY GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname ...@@ -1095,9 +1213,7 @@ void GL_APIENTRY GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname
return; return;
} }
Texture *texture = context->getTargetTexture( context->getTexLevelParameteriv(target, level, pname, params);
IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target);
QueryTexLevelParameteriv(texture, target, level, pname, params);
} }
} }
...@@ -1116,9 +1232,7 @@ void GL_APIENTRY GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname ...@@ -1116,9 +1232,7 @@ void GL_APIENTRY GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname
return; return;
} }
Texture *texture = context->getTargetTexture( context->getTexLevelParameterfv(target, level, pname, params);
IsCubeMapTextureTarget(target) ? GL_TEXTURE_CUBE_MAP : target);
QueryTexLevelParameterfv(texture, target, level, pname, params);
} }
} }
...@@ -1157,7 +1271,8 @@ void GL_APIENTRY VertexAttribFormat(GLuint attribindex, ...@@ -1157,7 +1271,8 @@ void GL_APIENTRY VertexAttribFormat(GLuint attribindex,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateVertexAttribFormat(context, attribindex, size, type, relativeoffset, false)) !ValidateVertexAttribFormat(context, attribindex, size, type, normalized,
relativeoffset))
{ {
return; return;
} }
...@@ -1179,7 +1294,7 @@ void GL_APIENTRY VertexAttribIFormat(GLuint attribindex, ...@@ -1179,7 +1294,7 @@ void GL_APIENTRY VertexAttribIFormat(GLuint attribindex,
if (context) if (context)
{ {
if (!context->skipValidation() && if (!context->skipValidation() &&
!ValidateVertexAttribFormat(context, attribindex, size, type, relativeoffset, true)) !ValidateVertexAttribIFormat(context, attribindex, size, type, relativeoffset))
{ {
return; return;
} }
...@@ -1216,7 +1331,7 @@ void GL_APIENTRY VertexBindingDivisor(GLuint bindingindex, GLuint divisor) ...@@ -1216,7 +1331,7 @@ void GL_APIENTRY VertexBindingDivisor(GLuint bindingindex, GLuint divisor)
return; return;
} }
context->setVertexBindingDivisor(bindingindex, divisor); context->vertexBindingDivisor(bindingindex, divisor);
} }
} }
} // namespace gl } // namespace gl
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