diff options
author | Eric Anholt <[email protected]> | 2012-07-26 14:43:56 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-08-07 11:47:19 -0700 |
commit | 9c1b41879aab2ff7386c547a2ccce7686c018cf5 (patch) | |
tree | 934b03d503f257d3979d6ebe9ad36cee2953bb25 /src/mesa/main/glformats.c | |
parent | 3aaeb3e5e76b7b468e2eb2a26f30d68d19d3c854 (diff) |
mesa: Replace VersionMajor/VersionMinor with a Version field.
As we get into supporting GL 3.x core, we come across more and more features
of the API that depend on the version number as opposed to just the extension
list. This will let us more sanely do version checks than "(VersionMajor == 3
&& VersionMinor >= 2) || VersionMajor >= 4".
v2: Fix a bad <= 30 check.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/glformats.c')
-rw-r--r-- | src/mesa/main/glformats.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 4fe0ae07810..daf1b7667b8 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -1237,7 +1237,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_SHORT: case GL_INT: case GL_UNSIGNED_INT: - return (ctx->VersionMajor >= 3 || + return (ctx->Version >= 30 || ctx->Extensions.EXT_texture_integer) ? GL_NO_ERROR : GL_INVALID_ENUM; default: @@ -1252,7 +1252,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_SHORT: case GL_INT: case GL_UNSIGNED_INT: - return (ctx->VersionMajor >= 3 || + return (ctx->Version >= 30 || ctx->Extensions.EXT_texture_integer) ? GL_NO_ERROR : GL_INVALID_ENUM; case GL_UNSIGNED_BYTE_3_3_2: @@ -1274,7 +1274,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_INT: case GL_UNSIGNED_INT: /* NOTE: no packed formats w/ BGR format */ - return (ctx->VersionMajor >= 3 || + return (ctx->Version >= 30 || ctx->Extensions.EXT_texture_integer) ? GL_NO_ERROR : GL_INVALID_ENUM; default: @@ -1290,7 +1290,7 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_UNSIGNED_SHORT: case GL_INT: case GL_UNSIGNED_INT: - return (ctx->VersionMajor >= 3 || + return (ctx->Version >= 30 || ctx->Extensions.EXT_texture_integer) ? GL_NO_ERROR : GL_INVALID_ENUM; case GL_UNSIGNED_SHORT_4_4_4_4: |