i965: Validate requested GLES context version in brwCreateContext
authorChad Versace <chad.versace@linux.intel.com>
Fri, 9 Nov 2012 22:06:40 +0000 (14:06 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Mon, 19 Nov 2012 16:17:32 +0000 (08:17 -0800)
commit243cf7a924eaef78ce0d5150747fae6c3c4e6974
treedc399fb5deed8146580785c7cfb00fc6b9d35dfe
parentddb901fbf4489ffcd85d3320f23913eb1d4fbdfe
i965: Validate requested GLES context version in brwCreateContext

For GLES1 and GLES2, brwCreateContext neglected to validate the requested
context version received from the DRI layer. If DRI requested an OpenGL
ES2 context with version 3.9, we provided it one.

Before this fix, the switch statement that validated the requested GL
context flavor was an ugly #ifdef copy-paste mess. Instead of reproducing
the copy-past-mess for GLES1 and GLES2, I first refactored it.  Now the
switch statement is readable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_context.c