summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-09-15 02:10:24 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-09-16 19:42:56 -0700
commiteaacb278128ca64b170285feae58c89d16bff8a1 (patch)
tree08b56915db76bc80678e96d21ac11115eb0822e3 /src/mesa/main/api_validate.c
parent6b0ba02cae1526d6e6671a9ff620fd3bd7d4d032 (diff)
downloadexternal_mesa3d-eaacb278128ca64b170285feae58c89d16bff8a1.zip
external_mesa3d-eaacb278128ca64b170285feae58c89d16bff8a1.tar.gz
external_mesa3d-eaacb278128ca64b170285feae58c89d16bff8a1.tar.bz2
mesa: Move buffers-unmapped earlier in check_valid_to_render().
This needs to be above the switch on API, as that can return true (valid to render) before this error check even had a chance to run. Fixes ESEXT-CTS.draw_elements_base_vertex_tests.invalid_mapped_bos, which worked before commit 72f1566f90c434c7752d8405193eec68d6743246. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index b35751e..6cb626a 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -45,6 +45,12 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
return false;
}
+ if (!_mesa_all_buffers_are_unmapped(ctx->Array.VAO)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(vertex buffers are mapped)", function);
+ return false;
+ }
+
switch (ctx->API) {
case API_OPENGLES2:
/* For ES2, we can draw if we have a vertex program/shader). */
@@ -119,12 +125,6 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
unreachable("Invalid API value in check_valid_to_render()");
}
- if (!_mesa_all_buffers_are_unmapped(ctx->Array.VAO)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(vertex buffers are mapped)", function);
- return false;
- }
-
return true;
}