From: Pierre-Eric Pelloux-Prayer Date: Thu, 23 May 2019 14:34:16 +0000 (+0200) Subject: mesa: add EXT_dsa glNamedRenderbufferStorageEXT and glGetNamedRenderbufferParameterivEXT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01666ad206fbb4ab5e95667af6b73d405629f05b;p=mesa.git mesa: add EXT_dsa glNamedRenderbufferStorageEXT and glGetNamedRenderbufferParameterivEXT Reviewed-by: Marek Olšák --- diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index 32fa4094981..d01521b75d1 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -987,5 +987,18 @@ + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 2f3e448750a..bd37a34f6f6 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1569,6 +1569,8 @@ offsets = { "GetMultiTexLevelParameterfvEXT": 1533, "FramebufferParameteriMESA": 1534, "GetFramebufferParameterivMESA": 1535, + "NamedRenderbufferStorageEXT": 1536, + "GetNamedRenderbufferParameterivEXT": 1537, } functions = [ diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 50ba6dd7fad..7ae7727c9c2 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2707,6 +2707,22 @@ _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat, NO_SAMPLES, 0, "glNamedRenderbufferStorage"); } +void GLAPIENTRY +_mesa_NamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat, + GLsizei width, GLsizei height) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); + if (!rb || rb == &DummyRenderbuffer) { + _mesa_HashLockMutex(ctx->Shared->RenderBuffers); + rb = allocate_renderbuffer_locked(ctx, renderbuffer, "glNamedRenderbufferStorageEXT"); + _mesa_HashUnlockMutex(ctx->Shared->RenderBuffers); + } + renderbuffer_storage(ctx, rb, internalformat, width, height, NO_SAMPLES, + 0, "glNamedRenderbufferStorageEXT"); +} + + void GLAPIENTRY _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples, GLenum internalformat, @@ -2817,6 +2833,24 @@ _mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname, } +void GLAPIENTRY +_mesa_GetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname, + GLint *params) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); + if (!rb || rb == &DummyRenderbuffer) { + _mesa_HashLockMutex(ctx->Shared->RenderBuffers); + rb = allocate_renderbuffer_locked(ctx, renderbuffer, "glGetNamedRenderbufferParameterivEXT"); + _mesa_HashUnlockMutex(ctx->Shared->RenderBuffers); + } + + get_render_buffer_parameteriv(ctx, rb, pname, params, + "glGetNamedRenderbufferParameterivEXT"); +} + + GLboolean GLAPIENTRY _mesa_IsFramebuffer(GLuint framebuffer) { diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index e44373e7dd3..56e53544dd7 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -190,6 +190,9 @@ _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, extern void GLAPIENTRY _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +extern void GLAPIENTRY +_mesa_NamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat, + GLsizei width, GLsizei height); extern void GLAPIENTRY _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples, @@ -360,6 +363,10 @@ extern void GLAPIENTRY _mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname, GLint param); +extern void GLAPIENTRY +_mesa_GetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname, + GLint *params); + extern void GLAPIENTRY _mesa_GetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname, GLint *param); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index c3ac7beb73e..cbd65d7ba63 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1185,8 +1185,8 @@ const struct function common_desktop_functions_possible[] = { /* GL_EXT_direct_state_access - GL 3.0 */ //{ "glGetFloati_vEXT", 30, -1 }, //{ "glGetDoublei_vEXT", 30, -1 }, - //{ "glNamedRenderbufferStorageEXT", 30, -1 }, - //{ "glGetNamedRenderbufferParameterivEXT", 30, -1 }, + { "glNamedRenderbufferStorageEXT", 30, -1 }, + { "glGetNamedRenderbufferParameterivEXT", 30, -1 }, //{ "glNamedRenderbufferStorageMultisampleEXT", 30, -1 }, { "glCheckNamedFramebufferStatusEXT", 30, -1 }, { "glNamedFramebufferTexture1DEXT", 30, -1 },