[Mesa-dev] [PATCH 5/5] i965: Allow creation of OpenGL 3.1 contexts
Eric Anholt
eric at anholt.net
Fri Aug 24 14:52:07 PDT 2012
Ian Romanick <idr at freedesktop.org> writes:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_context.c | 20 ++++++++++++++++++++
> 1 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index 2945b3c..2e2ca20 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -109,6 +109,26 @@ brwCreateContext(int api,
> case API_OPENGLES:
> case API_OPENGLES2:
> break;
> + case API_OPENGL_CORE: {
> +#ifdef TEXTURE_FLOAT_ENABLED
> + const unsigned max_version =
> + (screen->gen == 6 ||
> + (screen->gen == 7 && screen->kernel_has_gen7_sol_reset))
> + ? 31 : 0;
> + const unsigned req_version = major_version * 10 + minor_version;
> +
> + if (req_version > max_version) {
> + *error = (max_version == 0)
> + ? __DRI_CTX_ERROR_BAD_API : __DRI_CTX_ERROR_BAD_VERSION;
> + return false;
> + }
> + break;
> +#else
> + *error = (max_version == 0)
> + ? __DRI_CTX_ERROR_BAD_API : __DRI_CTX_ERROR_BAD_VERSION;
> + return false;
> +#endif
max_version was defined in the #if case.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120824/5bea811b/attachment.pgp>
More information about the mesa-dev
mailing list