diff options
author | Simon Ser <[email protected]> | 2020-04-02 22:53:41 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-07 16:52:15 +0000 |
commit | 0bc77bcdb2c4f943ac1c946daaeda6295242d059 (patch) | |
tree | 6a6b19ae0095c47c56c8efdc07617e86e416a7e9 /src/mesa | |
parent | a1727598a0ec5b33615624f2f3640dee6bf649c3 (diff) |
mesa: add support for NV_pixel_buffer_object
Signed-off-by: Simon Ser <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4422>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4422>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/bufferobj.c | 20 | ||||
-rw-r--r-- | src/mesa/main/extensions_table.h | 1 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index f4c8bd8bd85..222b91eb6c1 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -105,11 +105,21 @@ static struct gl_buffer_object DummyBufferObject; static inline struct gl_buffer_object ** get_buffer_target(struct gl_context *ctx, GLenum target) { - /* Other targets are only supported in desktop OpenGL and OpenGL ES 3.0. - */ - if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx) - && target != GL_ARRAY_BUFFER && target != GL_ELEMENT_ARRAY_BUFFER) - return NULL; + /* Other targets are only supported in desktop OpenGL and OpenGL ES 3.0. */ + if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) { + switch (target) { + case GL_ARRAY_BUFFER: + case GL_ELEMENT_ARRAY_BUFFER: + break; + case GL_PIXEL_PACK_BUFFER: + case GL_PIXEL_UNPACK_BUFFER: + if (!ctx->Extensions.EXT_pixel_buffer_object) + return NULL; + break; + default: + return NULL; + } + } switch (target) { case GL_ARRAY_BUFFER_ARB: diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 75733b0eaee..9a678e247b8 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -388,6 +388,7 @@ EXT(NV_fragment_shader_interlock , ARB_fragment_shader_interlock EXT(NV_image_formats , ARB_shader_image_load_store , x , x , x , 31, 2014) EXT(NV_light_max_exponent , dummy_true , GLL, x , x , x , 1999) EXT(NV_packed_depth_stencil , dummy_true , GLL, GLC, x , x , 2000) +EXT(NV_pixel_buffer_object , EXT_pixel_buffer_object , x , x , x , ES2, 2012) EXT(NV_point_sprite , NV_point_sprite , GLL, GLC, x , x , 2001) EXT(NV_primitive_restart , NV_primitive_restart , GLL, x , x , x , 2002) EXT(NV_read_buffer , dummy_true , x , x , x , ES2, 2011) |