Commit dae7ab17 authored by Timothy Arceri's avatar Timothy Arceri

mesa: add support for glNamedBuffer*DataEXT()

parent 9f9342a2
......@@ -108,5 +108,21 @@
<param name="texture" type="GLuint" />
</function>
<!-- OpenGL 1.5 -->
<function name="NamedBufferDataEXT">
<param name="buffer" type="GLuint" />
<param name="size" type="GLsizeiptr" />
<param name="data" type="const GLvoid *" />
<param name="usage" type="GLenum" />
</function>
<function name="NamedBufferSubDataEXT">
<param name="buffer" type="GLuint" />
<param name="offset" type="GLintptr" />
<param name="size" type="GLsizeiptr" />
<param name="data" type="const GLvoid *" />
</function>
</category>
</OpenGLAPI>
......@@ -2162,6 +2162,20 @@ _mesa_NamedBufferData(GLuint buffer, GLsizeiptr size, const GLvoid *data,
"glNamedBufferData");
}
void GLAPIENTRY
_mesa_NamedBufferDataEXT(GLuint buffer, GLsizeiptr size, const GLvoid *data,
GLenum usage)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
&bufObj, "glNamedBufferDataEXT"))
return;
_mesa_buffer_data(ctx, bufObj, GL_NONE, size, data, usage,
"glNamedBufferDataEXT");
}
static bool
validate_buffer_sub_data(struct gl_context *ctx,
......@@ -2290,6 +2304,23 @@ _mesa_NamedBufferSubData(GLuint buffer, GLintptr offset,
"glNamedBufferSubData");
}
void GLAPIENTRY
_mesa_NamedBufferSubDataEXT(GLuint buffer, GLintptr offset,
GLsizeiptr size, const GLvoid *data)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
&bufObj, "glNamedBufferSubDataEXT"))
return;
if (validate_buffer_sub_data(ctx, bufObj, offset, size,
"glNamedBufferSubDataEXT")) {
_mesa_buffer_sub_data(ctx, bufObj, offset, size, data);
}
}
void GLAPIENTRY
_mesa_GetBufferSubData(GLenum target, GLintptr offset,
......
......@@ -222,6 +222,9 @@ _mesa_NamedBufferData_no_error(GLuint buffer, GLsizeiptr size,
void GLAPIENTRY
_mesa_NamedBufferData(GLuint buffer, GLsizeiptr size,
const GLvoid *data, GLenum usage);
void GLAPIENTRY
_mesa_NamedBufferDataEXT(GLuint buffer, GLsizeiptr size,
const GLvoid *data, GLenum usage);
void GLAPIENTRY
_mesa_BufferSubData_no_error(GLenum target, GLintptr offset,
......@@ -236,6 +239,9 @@ _mesa_NamedBufferSubData_no_error(GLuint buffer, GLintptr offset,
void GLAPIENTRY
_mesa_NamedBufferSubData(GLuint buffer, GLintptr offset,
GLsizeiptr size, const GLvoid *data);
void GLAPIENTRY
_mesa_NamedBufferSubDataEXT(GLuint buffer, GLintptr offset,
GLsizeiptr size, const GLvoid *data);
void GLAPIENTRY
_mesa_GetBufferSubData(GLenum target, GLintptr offset,
......
......@@ -1133,8 +1133,8 @@ const struct function common_desktop_functions_possible[] = {
//{ "glMatrixMultTransposefEXT", 10, -1 },
//{ "glMatrixMultTransposedEXT", 10, -1 },
/* GL_EXT_direct_state_access - GL 1.5 */
//{ "glNamedBufferDataEXT", 10, -1 },
//{ "glNamedBufferSubDataEXT", 10, -1 },
{ "glNamedBufferDataEXT", 10, -1 },
{ "glNamedBufferSubDataEXT", 10, -1 },
//{ "glMapNamedBufferEXT", 10, -1 },
//{ "glUnmapNamedBufferEXT", 10, -1 },
//{ "glGetNamedBufferParameterivEXT", 10, -1 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment