summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2014-11-11 10:29:34 +0000
committerKenneth Graunke <kenneth@whitecape.org>2015-01-14 17:09:50 -0800
commitead200d156c887bed77645ecba7f36ba0be14b8c (patch)
treec50fd7b9b89329e7dbcd9ea9fd831b7829fcf318 /src/mesa/main/api_validate.c
parentd5f936367ffbec5833e5eb7cf22666e38c8e3821 (diff)
downloadexternal_mesa3d-ead200d156c887bed77645ecba7f36ba0be14b8c.zip
external_mesa3d-ead200d156c887bed77645ecba7f36ba0be14b8c.tar.gz
external_mesa3d-ead200d156c887bed77645ecba7f36ba0be14b8c.tar.bz2
mesa: Check for vertex program the same way in desktop GL and ES
On Bay Trail-D using Fedora 20 compile flags (-m64 -O2 -mtune=generic for 64-bit and -m32 -march=i686 -mtune=atom for 32-bit), affects Gl32Multithread: 32-bit: Difference at 95.0% confidence 0.416027% +/- 0.163529% (n=40) 64-bit: Difference at 95.0% confidence 0.494771% +/- 0.259985% (n=40) Gl32Batch7 had no difference proven at 95.0% confidence (n=120) on 32-bit or 64-bit. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 869dc4e..b882f0e 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -48,9 +48,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
switch (ctx->API) {
case API_OPENGLES2:
/* For ES2, we can draw if we have a vertex program/shader). */
- if (!ctx->VertexProgram._Current)
- return false;
- break;
+ return ctx->VertexProgram._Current != NULL;
case API_OPENGLES:
/* For OpenGL ES, only draw if we have vertex positions
@@ -83,13 +81,8 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
*/
return ctx->VertexProgram._Current != NULL;
- case API_OPENGL_COMPAT: {
- const struct gl_shader_program *const vsProg =
- ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
- const bool haveVertexShader = (vsProg && vsProg->LinkStatus);
- const bool haveVertexProgram = ctx->VertexProgram._Enabled;
-
- if (haveVertexShader || haveVertexProgram) {
+ case API_OPENGL_COMPAT:
+ if (ctx->VertexProgram._Current != NULL) {
/* Draw regardless of whether or not we have any vertex arrays.
* (Ex: could draw a point using a constant vertex pos)
*/
@@ -102,7 +95,6 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled);
}
break;
- }
default:
unreachable("Invalid API value in check_valid_to_render()");