Revert "Re-re-re-land "Move Uniform and UBO info to the gl::Program layer.""
Seems to be failing the dEQP-GLES2.functional.uniform_api tests relating to boolean arrays.
BUG=angleproject:1123
This reverts commit 892a6a4b17b35e89898be8b4605c1ee595d3ae13.
Change-Id: Ifc4ce3ca806ef88a02ac6f693334ac37ce098a88
Reviewed-on: https://chromium-review.googlesource.com/298520
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 b858d6f..ed642a7 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1096,11 +1096,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)
{
@@ -1127,16 +1124,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;
}
@@ -1149,7 +1146,7 @@
return false;
}
- const LinkedUniform *uniform = nullptr;
+ LinkedUniform *uniform = NULL;
if (!ValidateUniformCommonBase(context, uniformType, location, count, &uniform))
{
return false;
@@ -1184,7 +1181,7 @@
return false;
}
- const LinkedUniform *uniform = nullptr;
+ LinkedUniform *uniform = NULL;
if (!ValidateUniformCommonBase(context, matrixType, location, count, &uniform))
{
return false;
@@ -1480,7 +1477,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);
@@ -1499,7 +1496,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."));
@@ -1899,8 +1896,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));