diff options
author | Kristian Høgsberg <[email protected]> | 2012-06-15 09:40:41 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2012-06-18 11:53:18 -0400 |
commit | 2d7b2d7a87f037fa435772b7ce7c7cc0f426d912 (patch) | |
tree | 162c5da30a23d9a14bdef4977b52a7af8c4bb154 /src/mesa/main/get.c | |
parent | e841a2426e9d58b8cfc95e6ccbe472d5960b3b62 (diff) |
gles2: Add GL_NV_read_buffer extension
This lets us select the front buffer for reading under GLES2.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index a8e1d8681c5..8dc47306f90 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -131,6 +131,7 @@ enum value_extra { EXTRA_VERSION_30, EXTRA_VERSION_31, EXTRA_VERSION_32, + EXTRA_API_GL, EXTRA_API_ES2, EXTRA_NEW_BUFFERS, EXTRA_NEW_FRAG_CLAMP, @@ -369,6 +370,15 @@ extra_ARB_vertex_program_api_es2[] = { EXTRA_END }; +/* The ReadBuffer get token is valid under either full GL or under + * GLES2 if the NV_read_buffer extension is available. */ +static const int +extra_NV_read_buffer_api_gl[] = { + EXT(NV_read_buffer), + EXTRA_API_GL, + EXTRA_END +}; + #define API_OPENGL_BIT (1 << API_OPENGL) #define API_OPENGLES_BIT (1 << API_OPENGLES) #define API_OPENGLES2_BIT (1 << API_OPENGLES2) @@ -750,6 +760,11 @@ static const struct value_desc values[] = { /* GL_ARB_fragment_program/OES_standard_derivatives */ { GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB, CONTEXT_ENUM(Hint.FragmentShaderDerivative), extra_ARB_fragment_shader }, + + /* GL_NV_read_buffer */ + { GL_READ_BUFFER, + LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, extra_NV_read_buffer_api_gl }, + #endif /* FEATURE_GL || FEATURE_ES2 */ #if FEATURE_ES2 @@ -884,7 +899,6 @@ static const struct value_desc values[] = { { GL_POLYGON_SMOOTH, CONTEXT_BOOL(Polygon.SmoothFlag), NO_EXTRA }, { GL_POLYGON_SMOOTH_HINT, CONTEXT_ENUM(Hint.PolygonSmooth), NO_EXTRA }, { GL_POLYGON_STIPPLE, CONTEXT_BOOL(Polygon.StippleFlag), NO_EXTRA }, - { GL_READ_BUFFER, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA }, { GL_RED_BIAS, CONTEXT_FLOAT(Pixel.RedBias), NO_EXTRA }, { GL_RED_SCALE, CONTEXT_FLOAT(Pixel.RedScale), NO_EXTRA }, { GL_RENDER_MODE, CONTEXT_ENUM(RenderMode), NO_EXTRA }, @@ -1814,6 +1828,12 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d enabled++; } break; + case EXTRA_API_GL: + if (ctx->API == API_OPENGL) { + total++; + enabled++; + } + break; case EXTRA_NEW_BUFFERS: if (ctx->NewState & _NEW_BUFFERS) _mesa_update_state(ctx); |