Commit ee9f08c0 by Jiajia Qin Committed by Commit Bot

Implement ES3.1 glProgramUniform* entry points

BUG=angleproject:1589 TEST=dEQP-GLES31.functional.program_uniform.* Change-Id: I27fffa755fd277ed918746259cac88ab9e349c41 Reviewed-on: https://chromium-review.googlesource.com/412193 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 51f75c5d
......@@ -188,32 +188,67 @@ GLboolean ProgramGL::validate(const gl::Caps & /*caps*/, gl::InfoLog * /*infoLog
void ProgramGL::setUniform1fv(GLint location, GLsizei count, const GLfloat *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform1fv(uniLoc(location), count, v);
if (mFunctions->programUniform1fv != nullptr)
{
mFunctions->programUniform1fv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform1fv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform2fv(GLint location, GLsizei count, const GLfloat *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform2fv(uniLoc(location), count, v);
if (mFunctions->programUniform2fv != nullptr)
{
mFunctions->programUniform2fv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform2fv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform3fv(GLint location, GLsizei count, const GLfloat *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform3fv(uniLoc(location), count, v);
if (mFunctions->programUniform3fv != nullptr)
{
mFunctions->programUniform3fv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform3fv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform4fv(GLint location, GLsizei count, const GLfloat *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform4fv(uniLoc(location), count, v);
if (mFunctions->programUniform4fv != nullptr)
{
mFunctions->programUniform4fv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform4fv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform1iv(GLint location, GLsizei count, const GLint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform1iv(uniLoc(location), count, v);
if (mFunctions->programUniform1iv != nullptr)
{
mFunctions->programUniform1iv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform1iv(uniLoc(location), count, v);
}
const gl::VariableLocation &locationEntry = mState.getUniformLocations()[location];
......@@ -230,98 +265,216 @@ void ProgramGL::setUniform1iv(GLint location, GLsizei count, const GLint *v)
void ProgramGL::setUniform2iv(GLint location, GLsizei count, const GLint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform2iv(uniLoc(location), count, v);
if (mFunctions->programUniform2iv != nullptr)
{
mFunctions->programUniform2iv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform2iv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform3iv(GLint location, GLsizei count, const GLint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform3iv(uniLoc(location), count, v);
if (mFunctions->programUniform3iv != nullptr)
{
mFunctions->programUniform3iv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform3iv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform4iv(GLint location, GLsizei count, const GLint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform4iv(uniLoc(location), count, v);
if (mFunctions->programUniform4iv != nullptr)
{
mFunctions->programUniform4iv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform4iv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform1uiv(GLint location, GLsizei count, const GLuint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform1uiv(uniLoc(location), count, v);
if (mFunctions->programUniform1uiv != nullptr)
{
mFunctions->programUniform1uiv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform1uiv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform2uiv(GLint location, GLsizei count, const GLuint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform2uiv(uniLoc(location), count, v);
if (mFunctions->programUniform2uiv != nullptr)
{
mFunctions->programUniform2uiv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform2uiv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform3uiv(GLint location, GLsizei count, const GLuint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform3uiv(uniLoc(location), count, v);
if (mFunctions->programUniform3uiv != nullptr)
{
mFunctions->programUniform3uiv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform3uiv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniform4uiv(GLint location, GLsizei count, const GLuint *v)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform4uiv(uniLoc(location), count, v);
if (mFunctions->programUniform4uiv != nullptr)
{
mFunctions->programUniform4uiv(mProgramID, uniLoc(location), count, v);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniform4uiv(uniLoc(location), count, v);
}
}
void ProgramGL::setUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix2fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix2fv != nullptr)
{
mFunctions->programUniformMatrix2fv(mProgramID, uniLoc(location), count, transpose, value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix2fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix3fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix3fv != nullptr)
{
mFunctions->programUniformMatrix3fv(mProgramID, uniLoc(location), count, transpose, value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix3fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix4fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix4fv != nullptr)
{
mFunctions->programUniformMatrix4fv(mProgramID, uniLoc(location), count, transpose, value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix4fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix2x3fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix2x3fv != nullptr)
{
mFunctions->programUniformMatrix2x3fv(mProgramID, uniLoc(location), count, transpose,
value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix2x3fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix3x2fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix3x2fv != nullptr)
{
mFunctions->programUniformMatrix3x2fv(mProgramID, uniLoc(location), count, transpose,
value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix3x2fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix2x4fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix2x4fv != nullptr)
{
mFunctions->programUniformMatrix2x4fv(mProgramID, uniLoc(location), count, transpose,
value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix2x4fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix4x2fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix4x2fv != nullptr)
{
mFunctions->programUniformMatrix4x2fv(mProgramID, uniLoc(location), count, transpose,
value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix4x2fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix3x4fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix3x4fv != nullptr)
{
mFunctions->programUniformMatrix3x4fv(mProgramID, uniLoc(location), count, transpose,
value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix3x4fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix4x3fv(uniLoc(location), count, transpose, value);
if (mFunctions->programUniformMatrix4x3fv != nullptr)
{
mFunctions->programUniformMatrix4x3fv(mProgramID, uniLoc(location), count, transpose,
value);
}
else
{
mStateManager->useProgram(mProgramID);
mFunctions->uniformMatrix4x3fv(uniLoc(location), count, transpose, value);
}
}
void ProgramGL::setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding)
......
......@@ -2560,19 +2560,20 @@ bool ValidateGetQueryObjectui64vRobustANGLE(Context *context,
}
static bool ValidateUniformCommonBase(gl::Context *context,
gl::Program *program,
GLenum targetUniformType,
GLint location,
GLsizei count,
const LinkedUniform **uniformOut)
{
// TODO(Jiajia): Add image uniform check in future.
if (count < 0)
{
context->handleError(Error(GL_INVALID_VALUE));
return false;
}
gl::Program *program = context->getGLState().getProgram();
if (!program)
if (!program || !program->isLinked())
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
......@@ -2603,6 +2604,67 @@ static bool ValidateUniformCommonBase(gl::Context *context,
return true;
}
bool ValidateProgramUniform(gl::Context *context,
GLenum uniformType,
GLuint program,
GLint location,
GLsizei count)
{
// Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1))
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
const LinkedUniform *uniform = nullptr;
gl::Program *programObject = GetValidProgram(context, program);
if (!ValidateUniformCommonBase(context, programObject, uniformType, location, count, &uniform))
{
return false;
}
GLenum targetBoolType = VariableBoolVectorType(uniformType);
bool samplerUniformCheck = (IsSamplerType(uniform->type) && uniformType == GL_INT);
if (!samplerUniformCheck && uniformType != uniform->type && targetBoolType != uniform->type)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
return true;
}
bool ValidateProgramUniformMatrix(gl::Context *context,
GLenum matrixType,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose)
{
// Check for ES31 program uniform entry points
if (context->getClientVersion() < Version(3, 1))
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
const LinkedUniform *uniform = nullptr;
gl::Program *programObject = GetValidProgram(context, program);
if (!ValidateUniformCommonBase(context, programObject, matrixType, location, count, &uniform))
{
return false;
}
if (uniform->type != matrixType)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
}
return true;
}
bool ValidateUniform(gl::Context *context, GLenum uniformType, GLint location, GLsizei count)
{
// Check for ES3 uniform entry points
......@@ -2614,7 +2676,8 @@ bool ValidateUniform(gl::Context *context, GLenum uniformType, GLint location, G
}
const LinkedUniform *uniform = nullptr;
if (!ValidateUniformCommonBase(context, uniformType, location, count, &uniform))
gl::Program *program = context->getGLState().getProgram();
if (!ValidateUniformCommonBase(context, program, uniformType, location, count, &uniform))
{
return false;
}
......@@ -2649,7 +2712,8 @@ bool ValidateUniformMatrix(gl::Context *context, GLenum matrixType, GLint locati
}
const LinkedUniform *uniform = nullptr;
if (!ValidateUniformCommonBase(context, matrixType, location, count, &uniform))
gl::Program *program = context->getGLState().getProgram();
if (!ValidateUniformCommonBase(context, program, matrixType, location, count, &uniform))
{
return false;
}
......
......@@ -179,6 +179,18 @@ bool ValidateGetQueryObjectui64vRobustANGLE(Context *context,
GLsizei *length,
GLuint64 *params);
bool ValidateProgramUniform(Context *context,
GLenum uniformType,
GLuint program,
GLint location,
GLsizei count);
bool ValidateProgramUniformMatrix(Context *context,
GLenum matrixType,
GLuint program,
GLint location,
GLsizei count,
GLboolean transpose);
bool ValidateUniform(Context *context, GLenum uniformType, GLint location, GLsizei count);
bool ValidateUniformMatrix(Context *context, GLenum matrixType, GLint location, GLsizei count,
GLboolean transpose);
......
......@@ -12,6 +12,7 @@
#include "libANGLE/Context.h"
#include "libANGLE/Error.h"
#include "libANGLE/validationES.h"
#include "libANGLE/validationES31.h"
#include "common/debug.h"
......@@ -323,193 +324,75 @@ void GL_APIENTRY GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *para
void GL_APIENTRY ProgramUniform1i(GLuint program, GLint location, GLint v0)
{
EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d)", program, location, v0);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
ProgramUniform1iv(program, location, 1, &v0);
}
void GL_APIENTRY ProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
{
EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d)", program,
location, v0, v1);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLint xy[2] = {v0, v1};
ProgramUniform2iv(program, location, 1, xy);
}
void GL_APIENTRY ProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
{
EVENT("(GLuint program = %u, GLint location = %d, GLint v0 = %d, GLint v1 = %d, GLint v2 = %d)",
program, location, v0, v1, v2);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLint xyz[3] = {v0, v1, v2};
ProgramUniform3iv(program, location, 1, xyz);
}
void GL_APIENTRY
ProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
{
EVENT(
"(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())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLint xyzw[4] = {v0, v1, v2, v3};
ProgramUniform4iv(program, location, 1, xyzw);
}
void GL_APIENTRY ProgramUniform1ui(GLuint program, GLint location, GLuint v0)
{
EVENT("(GLuint program = %u, GLint location = %d, GLuint v0 = %u)", program, location, v0);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
ProgramUniform1uiv(program, location, 1, &v0);
}
void GL_APIENTRY ProgramUniform2ui(GLuint program, GLint location, GLuint v0, GLuint v1)
{
EVENT("(GLuint program = %u, GLint location = %d, GLuint v0 = %u, GLuint v1 = %u)", program,
location, v0, v1);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLuint xy[2] = {v0, v1};
ProgramUniform2uiv(program, location, 1, xy);
}
void GL_APIENTRY ProgramUniform3ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2)
{
EVENT(
"(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())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLuint xyz[3] = {v0, v1, v2};
ProgramUniform3uiv(program, location, 1, xyz);
}
void GL_APIENTRY
ProgramUniform4ui(GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
{
EVENT(
"(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())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLuint xyzw[4] = {v0, v1, v2, v3};
ProgramUniform4uiv(program, location, 1, xyzw);
}
void GL_APIENTRY ProgramUniform1f(GLuint program, GLint location, GLfloat v0)
{
EVENT("(GLuint program = %u, GLint location = %d, GLfloat v0 = %g)", program, location, v0);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
ProgramUniform1fv(program, location, 1, &v0);
}
void GL_APIENTRY ProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
{
EVENT("(GLuint program = %u, GLint location = %d, GLfloat v0 = %g, GLfloat v1 = %g)", program,
location, v0, v1);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLfloat xy[2] = {v0, v1};
ProgramUniform2fv(program, location, 1, xy);
}
void GL_APIENTRY
ProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
{
EVENT(
"(GLuint program = %u, GLint location = %d, GLfloat v0 = %g, GLfloat v1 = %g, GLfloat v2 = "
"%g)",
program, location, v0, v1, v2);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLfloat xyz[3] = {v0, v1, v2};
ProgramUniform3fv(program, location, 1, xyz);
}
void GL_APIENTRY
ProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
EVENT(
"(GLuint program = %u, GLint location = %d, GLfloat v0 = %g, GLfloat v1 = %g, GLfloat v2 = "
"%g, GLfloat v3 = %g)",
program, location, v0, v1, v2, v3);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
}
UNIMPLEMENTED();
}
GLfloat xyzw[4] = {v0, v1, v2, v3};
ProgramUniform4fv(program, location, 1, xyzw);
}
void GL_APIENTRY ProgramUniform1iv(GLuint program,
......@@ -524,11 +407,14 @@ void GL_APIENTRY ProgramUniform1iv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_INT, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform1iv(location, count, value);
}
}
......@@ -544,11 +430,14 @@ void GL_APIENTRY ProgramUniform2iv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_INT_VEC2, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform2iv(location, count, value);
}
}
......@@ -564,11 +453,14 @@ void GL_APIENTRY ProgramUniform3iv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_INT_VEC3, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform3iv(location, count, value);
}
}
......@@ -584,11 +476,14 @@ void GL_APIENTRY ProgramUniform4iv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_INT_VEC4, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform4iv(location, count, value);
}
}
......@@ -604,11 +499,14 @@ void GL_APIENTRY ProgramUniform1uiv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform1uiv(location, count, value);
}
}
......@@ -624,11 +522,14 @@ void GL_APIENTRY ProgramUniform2uiv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC2, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform2uiv(location, count, value);
}
}
......@@ -644,11 +545,14 @@ void GL_APIENTRY ProgramUniform3uiv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC3, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform3uiv(location, count, value);
}
}
......@@ -664,11 +568,14 @@ void GL_APIENTRY ProgramUniform4uiv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_UNSIGNED_INT_VEC4, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform4uiv(location, count, value);
}
}
......@@ -684,11 +591,14 @@ void GL_APIENTRY ProgramUniform1fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_FLOAT, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform1fv(location, count, value);
}
}
......@@ -704,11 +614,14 @@ void GL_APIENTRY ProgramUniform2fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_FLOAT_VEC2, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform2fv(location, count, value);
}
}
......@@ -724,11 +637,14 @@ void GL_APIENTRY ProgramUniform3fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_FLOAT_VEC3, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform3fv(location, count, value);
}
}
......@@ -744,11 +660,14 @@ void GL_APIENTRY ProgramUniform4fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniform(context, GL_FLOAT_VEC4, program, location, count))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniform4fv(location, count, value);
}
}
......@@ -765,11 +684,15 @@ void GL_APIENTRY ProgramUniformMatrix2fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix2fv(location, count, transpose, value);
}
}
......@@ -786,11 +709,15 @@ void GL_APIENTRY ProgramUniformMatrix3fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix3fv(location, count, transpose, value);
}
}
......@@ -807,11 +734,15 @@ void GL_APIENTRY ProgramUniformMatrix4fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix4fv(location, count, transpose, value);
}
}
......@@ -828,11 +759,15 @@ void GL_APIENTRY ProgramUniformMatrix2x3fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2x3, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix2x3fv(location, count, transpose, value);
}
}
......@@ -849,11 +784,15 @@ void GL_APIENTRY ProgramUniformMatrix3x2fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3x2, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix3x2fv(location, count, transpose, value);
}
}
......@@ -870,11 +809,15 @@ void GL_APIENTRY ProgramUniformMatrix2x4fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT2x4, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix2x4fv(location, count, transpose, value);
}
}
......@@ -891,11 +834,15 @@ void GL_APIENTRY ProgramUniformMatrix4x2fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4x2, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix4x2fv(location, count, transpose, value);
}
}
......@@ -912,11 +859,15 @@ void GL_APIENTRY ProgramUniformMatrix3x4fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT3x4, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix3x4fv(location, count, transpose, value);
}
}
......@@ -933,11 +884,15 @@ void GL_APIENTRY ProgramUniformMatrix4x3fv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation())
if (!ValidateProgramUniformMatrix(context, GL_FLOAT_MAT4x3, program, location, count,
transpose))
{
context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
return;
}
UNIMPLEMENTED();
Program *programObject = context->getProgram(program);
ASSERT(programObject);
programObject->setUniformMatrix4x3fv(location, count, transpose, value);
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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