Revert "Re^5-land "Move Uniform and UBO info to the gl::Program layer.""
Failing dEQP-GLES3.functional.uniform_api.random.22 and 23:
There's a bug with arrays of tranpsosed matrix uniforms.
BUG=angleproject:1123
This reverts commit 78d356929bd0441d81e2dd8a63130cd6788e2fde.
Change-Id: If39b5908af39671dfe98965e6a1ba77fd18ea8fc
Reviewed-on: https://chromium-review.googlesource.com/299320
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index db00caf..d8e1dd7 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1145,11 +1145,8 @@
return true;
}
-static bool ValidateUniformCommonBase(gl::Context *context,
- GLenum targetUniformType,
- GLint location,
- GLsizei count,
- const LinkedUniform **uniformOut)
+static bool ValidateUniformCommonBase(gl::Context *context, GLenum targetUniformType,
+ GLint location, GLsizei count, LinkedUniform **uniformOut)
{
if (count < 0)
{
@@ -1176,16 +1173,16 @@
return false;
}
- const LinkedUniform &uniform = program->getUniformByLocation(location);
+ LinkedUniform *uniform = program->getUniformByLocation(location);
// attempting to write an array to a non-array uniform is an INVALID_OPERATION
- if (!uniform.isArray() && count > 1)
+ if (!uniform->isArray() && count > 1)
{
context->recordError(Error(GL_INVALID_OPERATION));
return false;
}
- *uniformOut = &uniform;
+ *uniformOut = uniform;
return true;
}
@@ -1198,7 +1195,7 @@
return false;
}
- const LinkedUniform *uniform = nullptr;
+ LinkedUniform *uniform = NULL;
if (!ValidateUniformCommonBase(context, uniformType, location, count, &uniform))
{
return false;
@@ -1233,7 +1230,7 @@
return false;
}
- const LinkedUniform *uniform = nullptr;
+ LinkedUniform *uniform = NULL;
if (!ValidateUniformCommonBase(context, matrixType, location, count, &uniform))
{
return false;
@@ -1529,7 +1526,7 @@
// Uniform buffer validation
for (unsigned int uniformBlockIndex = 0; uniformBlockIndex < program->getActiveUniformBlockCount(); uniformBlockIndex++)
{
- const gl::UniformBlock &uniformBlock = program->getUniformBlockByIndex(uniformBlockIndex);
+ const gl::UniformBlock *uniformBlock = program->getUniformBlockByIndex(uniformBlockIndex);
GLuint blockBinding = program->getUniformBlockBinding(uniformBlockIndex);
const gl::Buffer *uniformBuffer = state.getIndexedUniformBuffer(blockBinding);
@@ -1548,7 +1545,7 @@
uniformBufferSize = static_cast<size_t>(uniformBuffer->getSize());
}
- if (uniformBufferSize < uniformBlock.dataSize)
+ if (uniformBufferSize < uniformBlock->dataSize)
{
// undefined behaviour
context->recordError(Error(GL_INVALID_OPERATION, "It is undefined behaviour to use a uniform buffer that is too small."));
@@ -1947,8 +1944,8 @@
ASSERT(programObject);
// sized queries -- ensure the provided buffer is large enough
- const LinkedUniform &uniform = programObject->getUniformByLocation(location);
- size_t requiredBytes = VariableExternalSize(uniform.type);
+ LinkedUniform *uniform = programObject->getUniformByLocation(location);
+ size_t requiredBytes = VariableExternalSize(uniform->type);
if (static_cast<size_t>(bufSize) < requiredBytes)
{
context->recordError(Error(GL_INVALID_OPERATION));