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)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Sun, 20 Jan 2013 14:08:28 +0000 (15:08 +0100)
commit8a3a76e1dac98244140b3e8d663719965c38be5f
treeed8789d2dfab8123437e9edbda9f6fb7c3b76dd4
parent07b505bfdf94430780734aa4b82170a1f21978ff
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>
(cherry picked from commit 243cf7a924eaef78ce0d5150747fae6c3c4e6974)
src/mesa/drivers/dri/i965/brw_context.c