summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-01-14 11:36:17 -0800
committerJason Ekstrand <[email protected]>2016-01-14 11:36:27 -0800
commit45349acad01f4a27386f676e481c4eeddf64cdc0 (patch)
treedc4c933cd6a523c425f4a62f86dcdec82c53c8f0 /src/mesa/main
parentf46f4e488641437556188a3182ce4ddabd6f42d0 (diff)
parente94ef885bb71b46aba4517523ebb63c0d4b36c4b (diff)
Merge remote-tracking branch 'mesa-public/master' into vulkan
This fixes the bitfieldextract and bitfieldinsert CTS tests
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/bufferobj.c30
-rw-r--r--src/mesa/main/dd.h5
-rw-r--r--src/mesa/main/shader_query.cpp7
-rw-r--r--src/mesa/main/shaderapi.c3
-rw-r--r--src/mesa/main/texobj.c2
5 files changed, 34 insertions, 13 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 14ee8c8fc73..26f873bc9a9 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -3898,8 +3898,14 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
struct gl_buffer_object *bufObj;
const GLintptr end = offset + length;
+ /* Section 6.5 (Invalidating Buffer Data) of the OpenGL 4.5 (Compatibility
+ * Profile) spec says:
+ *
+ * "An INVALID_VALUE error is generated if buffer is zero or is not the
+ * name of an existing buffer object."
+ */
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (!bufObj) {
+ if (!bufObj || bufObj == &DummyBufferObject) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glInvalidateBufferSubData(name = 0x%x) invalid object",
buffer);
@@ -3912,7 +3918,7 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
* negative, or if <offset> + <length> is greater than the value of
* BUFFER_SIZE."
*/
- if (end < 0 || end > bufObj->Size) {
+ if (offset < 0 || length < 0 || end > bufObj->Size) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glInvalidateBufferSubData(invalid offset or length)");
return;
@@ -3933,10 +3939,8 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
return;
}
- /* We don't actually do anything for this yet. Just return after
- * validating the parameters and generating the required errors.
- */
- return;
+ if (ctx->Driver.InvalidateBufferSubData)
+ ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
}
void GLAPIENTRY
@@ -3945,8 +3949,14 @@ _mesa_InvalidateBufferData(GLuint buffer)
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufObj;
+ /* Section 6.5 (Invalidating Buffer Data) of the OpenGL 4.5 (Compatibility
+ * Profile) spec says:
+ *
+ * "An INVALID_VALUE error is generated if buffer is zero or is not the
+ * name of an existing buffer object."
+ */
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (!bufObj) {
+ if (!bufObj || bufObj == &DummyBufferObject) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glInvalidateBufferData(name = 0x%x) invalid object",
buffer);
@@ -3967,8 +3977,6 @@ _mesa_InvalidateBufferData(GLuint buffer)
return;
}
- /* We don't actually do anything for this yet. Just return after
- * validating the parameters and generating the required errors.
- */
- return;
+ if (ctx->Driver.InvalidateBufferSubData)
+ ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index e5281ce9744..70ed5633f7b 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -634,6 +634,11 @@ struct dd_function_table {
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size );
+ void (*InvalidateBufferSubData)( struct gl_context *ctx,
+ struct gl_buffer_object *obj,
+ GLintptr offset,
+ GLsizeiptr length );
+
/* Returns pointer to the start of the mapped range.
* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
*/
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index 014977b28ca..a18b860022d 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -1500,6 +1500,13 @@ _mesa_validate_pipeline_io(struct gl_pipeline_object *pipeline)
for (idx = prev + 1; idx < ARRAY_SIZE(pipeline->CurrentProgram); idx++) {
if (shProg[idx]) {
+ /* Pipeline might include both non-compute and a compute program, do
+ * not attempt to validate varyings between non-compute and compute
+ * stage.
+ */
+ if (shProg[idx]->_LinkedShaders[idx]->Stage == MESA_SHADER_COMPUTE)
+ break;
+
if (!validate_io(shProg[prev]->_LinkedShaders[prev],
shProg[idx]->_LinkedShaders[idx],
shProg[prev]->IsES || shProg[idx]->IsES))
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index e258ad9d1db..cdc85f3413b 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -300,7 +300,8 @@ create_shader(struct gl_context *ctx, GLenum type)
GLuint name;
if (!_mesa_validate_shader_target(ctx, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "CreateShader(type)");
+ _mesa_error(ctx, GL_INVALID_ENUM, "CreateShader(%s)",
+ _mesa_enum_to_string(type));
return 0;
}
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 547055ecf39..b107a8f8678 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -835,7 +835,7 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
incomplete(t, MIPMAP, "TexImage[%d] is missing", i);
return;
}
- if (img->TexFormat != baseImage->TexFormat) {
+ if (img->InternalFormat != baseImage->InternalFormat) {
incomplete(t, MIPMAP, "Format[i] != Format[baseLevel]");
return;
}