mesa/es: Enable GL_EXT_map_buffer_range
This extension is functionally the same as GL_ARB_map_buffer_range. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
017c6fb324
commit
762d9ace6b
|
@ -737,4 +737,28 @@
|
|||
<enum name="COMPRESSED_RGBA_S3TC_DXT5_ANGLE" value="0x83F3"/>
|
||||
</category>
|
||||
|
||||
<!-- 121. GL_EXT_map_buffer_range -->
|
||||
<category name="GL_EXT_map_buffer_range" number="121">
|
||||
<enum name="MAP_READ_BIT_EXT" value="0x0001"/>
|
||||
<enum name="MAP_WRITE_BIT_EXT" value="0x0002"/>
|
||||
<enum name="MAP_INVALIDATE_RANGE_BIT_EXT" value="0x0004"/>
|
||||
<enum name="MAP_INVALIDATE_BUFFER_BIT_EXT" value="0x0008"/>
|
||||
<enum name="MAP_FLUSH_EXPLICIT_BIT_EXT" value="0x0010"/>
|
||||
<enum name="MAP_UNSYNCHRONIZED_BIT_EXT" value="0x0020"/>
|
||||
|
||||
<function name="MapBufferRangeEXT" alias="MapBufferRange">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="offset" type="GLintptr"/>
|
||||
<param name="size" type="GLsizeiptr"/>
|
||||
<param name="length" type="GLbitfield"/>
|
||||
<return type="GLvoid *"/>
|
||||
</function>
|
||||
|
||||
<function name="FlushMappedBufferRangeEXT" alias="FlushMappedBufferRange">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="offset" type="GLintptr"/>
|
||||
<param name="length" type="GLsizeiptr"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
</OpenGLAPI>
|
||||
|
|
|
@ -185,6 +185,9 @@ es1_api = es1_core + (
|
|||
'GetBufferPointervOES',
|
||||
'MapBufferOES',
|
||||
'UnmapBufferOES',
|
||||
# GL_EXT_map_buffer_range
|
||||
'MapBufferRangeEXT',
|
||||
'FlushMappedBufferRangeEXT',
|
||||
# GL_EXT_multi_draw_arrays
|
||||
'MultiDrawArraysEXT',
|
||||
'MultiDrawElementsEXT',
|
||||
|
@ -436,6 +439,9 @@ es2_api = es2_core + (
|
|||
'GetBufferPointervOES',
|
||||
'MapBufferOES',
|
||||
'UnmapBufferOES',
|
||||
# GL_EXT_map_buffer_range
|
||||
'MapBufferRangeEXT',
|
||||
'FlushMappedBufferRangeEXT',
|
||||
# GL_EXT_multi_draw_arrays
|
||||
'MultiDrawArraysEXT',
|
||||
'MultiDrawElementsEXT',
|
||||
|
|
|
@ -756,10 +756,9 @@ _mesa_create_exec_table(struct gl_context *ctx)
|
|||
SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample);
|
||||
}
|
||||
|
||||
if (ctx->API != API_OPENGLES2) {
|
||||
SET_MapBufferRange(exec, _mesa_MapBufferRange);
|
||||
SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
|
||||
}
|
||||
/* GL_ARB_map_buffer_range / GL_EXT_map_buffer_range */
|
||||
SET_MapBufferRange(exec, _mesa_MapBufferRange);
|
||||
SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange);
|
||||
|
||||
/* GL_ARB_copy_buffer */
|
||||
if (ctx->API != API_OPENGLES2) {
|
||||
|
|
|
@ -1312,20 +1312,17 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params)
|
|||
*params = _mesa_bufferobj_mapped(bufObj);
|
||||
return;
|
||||
case GL_BUFFER_ACCESS_FLAGS:
|
||||
if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range)
|
||||
&& !_mesa_is_gles3(ctx))
|
||||
if (!ctx->Extensions.ARB_map_buffer_range)
|
||||
goto invalid_pname;
|
||||
*params = bufObj->AccessFlags;
|
||||
return;
|
||||
case GL_BUFFER_MAP_OFFSET:
|
||||
if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range)
|
||||
&& !_mesa_is_gles3(ctx))
|
||||
if (!ctx->Extensions.ARB_map_buffer_range)
|
||||
goto invalid_pname;
|
||||
*params = (GLint) bufObj->Offset;
|
||||
return;
|
||||
case GL_BUFFER_MAP_LENGTH:
|
||||
if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range)
|
||||
&& !_mesa_is_gles3(ctx))
|
||||
if (!ctx->Extensions.ARB_map_buffer_range)
|
||||
goto invalid_pname;
|
||||
*params = (GLint) bufObj->Length;
|
||||
return;
|
||||
|
@ -1524,6 +1521,19 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Page 38 of the PDF of the OpenGL ES 3.0 spec says:
|
||||
*
|
||||
* "An INVALID_OPERATION error is generated for any of the following
|
||||
* conditions:
|
||||
*
|
||||
* * <length> is zero."
|
||||
*/
|
||||
if (_mesa_is_gles(ctx) && length == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glMapBufferRange(length = 0)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (access & ~(GL_MAP_READ_BIT |
|
||||
GL_MAP_WRITE_BIT |
|
||||
GL_MAP_INVALIDATE_RANGE_BIT |
|
||||
|
|
|
@ -176,6 +176,7 @@ static const struct extension extension_table[] = {
|
|||
{ "GL_EXT_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 },
|
||||
{ "GL_EXT_gpu_program_parameters", o(EXT_gpu_program_parameters), GLL, 2006 },
|
||||
{ "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 },
|
||||
{ "GL_EXT_map_buffer_range", o(ARB_map_buffer_range), ES1 | ES2, 2012 },
|
||||
{ "GL_EXT_multi_draw_arrays", o(dummy_true), GLL | ES1 | ES2, 1999 },
|
||||
{ "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 },
|
||||
{ "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 },
|
||||
|
|
|
@ -195,6 +195,7 @@ const struct function gles2_functions_possible[] = {
|
|||
{ "glEnableVertexAttribArray", -1 },
|
||||
{ "glFinish", _gloffset_Finish },
|
||||
{ "glFlush", _gloffset_Flush },
|
||||
{ "glFlushMappedBufferRangeEXT", -1 },
|
||||
{ "glFramebufferRenderbuffer", -1 },
|
||||
{ "glFramebufferTexture2D", -1 },
|
||||
{ "glFramebufferTexture3DOES", -1 },
|
||||
|
@ -244,6 +245,7 @@ const struct function gles2_functions_possible[] = {
|
|||
{ "glLineWidth", _gloffset_LineWidth },
|
||||
{ "glLinkProgram", -1 },
|
||||
{ "glMapBufferOES", -1 },
|
||||
{ "glMapBufferRangeEXT", -1 },
|
||||
{ "glMultiDrawArraysEXT", -1 },
|
||||
{ "glMultiDrawElementsEXT", -1 },
|
||||
{ "glPixelStorei", _gloffset_PixelStorei },
|
||||
|
|
Loading…
Reference in New Issue