<param name="access" type="GLbitfield" />
</function>
+ <function name="FramebufferDrawBufferEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="mode" type="GLenum" />
+ </function>
+
+ <function name="FramebufferDrawBuffersEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="n" type="GLsizei" />
+ <param name="bufs" type="const GLenum *" />
+ </function>
+
+ <function name="FramebufferReadBufferEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="mode" type="GLenum" />
+ </function>
+
+ <function name="GetFramebufferParameterivEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="pname" type="GLenum" />
+ <param name="param" type="GLint *" />
+ </function>
+
+ <function name="CheckNamedFramebufferStatusEXT">
+ <return type="GLenum" />
+ <param name="framebuffer" type="GLuint" />
+ <param name="target" type="GLenum" />
+ </function>
+
+ <function name="NamedFramebufferTexture1DEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="textarget" type="GLenum" />
+ <param name="texture" type="GLuint" />
+ <param name="level" type="GLint" />
+ </function>
+
+ <function name="NamedFramebufferTexture2DEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="textarget" type="GLenum" />
+ <param name="texture" type="GLuint" />
+ <param name="level" type="GLint" />
+ </function>
+
+ <function name="NamedFramebufferTexture3DEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="textarget" type="GLenum" />
+ <param name="texture" type="GLuint" />
+ <param name="level" type="GLint" />
+ <param name="zoffset" type="GLint" />
+ </function>
+
+ <function name="NamedFramebufferRenderbufferEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="renderbuffertarget" type="GLenum" />
+ <param name="renderbuffer" type="GLuint" />
+ </function>
+
+ <function name="GetNamedFramebufferAttachmentParameterivEXT">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="pname" type="GLenum" />
+ <param name="params" type="GLint *" />
+ </function>
</category>
</OpenGLAPI>
fb = (struct gl_framebuffer *)
_mesa_HashLookup(ctx->Shared->FrameBuffers, id);
+
+ return fb;
+}
+
+
+struct gl_framebuffer *
+_mesa_lookup_framebuffer_dsa(struct gl_context *ctx, GLuint id,
+ const char* func)
+{
+ struct gl_framebuffer *fb;
+
+ if (id == 0)
+ return NULL;
+
+ fb = _mesa_lookup_framebuffer(ctx, id);
+
+ /* Name exists but buffer is not initialized */
+ if (fb == &DummyFramebuffer) {
+ fb = ctx->Driver.NewFramebuffer(ctx, id);
+ _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
+ _mesa_HashInsert(ctx->Shared->FrameBuffers, id, fb);
+ _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
+ }
+ /* Name doesn't exist */
+ else if (!fb) {
+ _mesa_HashLockMutex(ctx->Shared->FrameBuffers);
+ fb = ctx->Driver.NewFramebuffer(ctx, id);
+ if (!fb) {
+ _mesa_HashUnlockMutex(ctx->Shared->FrameBuffers);
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
+ return NULL;
+ }
+ _mesa_HashInsertLocked(ctx->Shared->BufferObjects, id, fb);
+ _mesa_HashUnlockMutex(ctx->Shared->BufferObjects);
+ }
return fb;
}
}
+GLenum GLAPIENTRY
+_mesa_CheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target)
+{
+ struct gl_framebuffer *fb;
+ GET_CURRENT_CONTEXT(ctx);
+
+ switch (target) {
+ case GL_DRAW_FRAMEBUFFER:
+ case GL_FRAMEBUFFER:
+ case GL_READ_FRAMEBUFFER:
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glCheckNamedFramebufferStatusEXT(invalid target %s)",
+ _mesa_enum_to_string(target));
+ return 0;
+ }
+
+ if (framebuffer == 0) {
+ return _mesa_CheckNamedFramebufferStatus(0, target);
+ }
+
+ fb = _mesa_lookup_framebuffer_dsa(ctx, framebuffer,
+ "glCheckNamedFramebufferStatusEXT");
+ if (!fb)
+ return 0;
+
+ return _mesa_check_framebuffer_status(ctx, fb);
+}
+
+
/**
* Replicate the src attachment point. Used by framebuffer_texture() when
* the same texture is attached at GL_DEPTH_ATTACHMENT and
static void
-framebuffer_texture_with_dims(int dims, GLenum target,
+framebuffer_texture_with_dims(int dims, GLenum target, GLuint framebuffer,
GLenum attachment, GLenum textarget,
GLuint texture, GLint level, GLsizei samples,
- GLint layer, const char *caller)
+ GLint layer, const char *caller, bool dsa)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_framebuffer *fb;
struct gl_texture_object *texObj;
/* Get the framebuffer object */
- fb = get_framebuffer_target(ctx, target);
+ if (dsa) {
+ fb = _mesa_lookup_framebuffer_dsa(ctx, framebuffer, caller);
+ } else {
+ fb = get_framebuffer_target(ctx, target);
+ }
if (!fb) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid target %s)", caller,
_mesa_enum_to_string(target));
_mesa_FramebufferTexture1D(GLenum target, GLenum attachment,
GLenum textarget, GLuint texture, GLint level)
{
- framebuffer_texture_with_dims(1, target, attachment, textarget, texture,
- level, 0, 0, "glFramebufferTexture1D");
+ framebuffer_texture_with_dims(1, target, 0, attachment, textarget, texture,
+ level, 0, 0, "glFramebufferTexture1D", false);
}
_mesa_FramebufferTexture2D(GLenum target, GLenum attachment,
GLenum textarget, GLuint texture, GLint level)
{
- framebuffer_texture_with_dims(2, target, attachment, textarget, texture,
- level, 0, 0, "glFramebufferTexture2D");
+ framebuffer_texture_with_dims(2, target, 0, attachment, textarget, texture,
+ level, 0, 0, "glFramebufferTexture2D", false);
}
GLenum textarget, GLuint texture,
GLint level, GLsizei samples)
{
- framebuffer_texture_with_dims(2, target, attachment, textarget, texture,
- level, samples, 0, "glFramebufferTexture2DMultisampleEXT");
+ framebuffer_texture_with_dims(2, target, 0, attachment, textarget, texture,
+ level, samples, 0,
+ "glFramebufferTexture2DMultisampleEXT",
+ false);
}
GLenum textarget, GLuint texture,
GLint level, GLint layer)
{
- framebuffer_texture_with_dims(3, target, attachment, textarget, texture,
- level, 0, layer, "glFramebufferTexture3D");
+ framebuffer_texture_with_dims(3, target, 0, attachment, textarget, texture,
+ level, 0, layer, "glFramebufferTexture3D", false);
}
}
+void GLAPIENTRY
+_mesa_NamedFramebufferTexture1DEXT(GLuint framebuffer, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level)
+{
+ framebuffer_texture_with_dims(1, GL_FRAMEBUFFER, framebuffer, attachment,
+ textarget, texture, level, 0, 0,
+ "glNamedFramebufferTexture1DEXT", true);
+}
+
+
+void GLAPIENTRY
+_mesa_NamedFramebufferTexture2DEXT(GLuint framebuffer, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level)
+{
+ framebuffer_texture_with_dims(2, GL_FRAMEBUFFER, framebuffer, attachment,
+ textarget, texture, level, 0, 0,
+ "glNamedFramebufferTexture2DEXT", true);
+}
+
+
+void GLAPIENTRY
+_mesa_NamedFramebufferTexture3DEXT(GLuint framebuffer, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level, GLint zoffset)
+{
+ framebuffer_texture_with_dims(3, GL_FRAMEBUFFER, framebuffer, attachment,
+ textarget, texture, level, 0, zoffset,
+ "glNamedFramebufferTexture3DEXT", true);
+}
+
+
void
_mesa_framebuffer_renderbuffer(struct gl_context *ctx,
struct gl_framebuffer *fb,
}
+void GLAPIENTRY
+_mesa_NamedFramebufferRenderbufferEXT(GLuint framebuffer, GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer)
+{
+ struct gl_framebuffer *fb;
+ GET_CURRENT_CONTEXT(ctx);
+
+ fb = _mesa_lookup_framebuffer_dsa(ctx, framebuffer,
+ "glNamedFramebufferRenderbufferEXT");
+ if (!fb)
+ return;
+
+ framebuffer_renderbuffer_error(ctx, fb, attachment, renderbuffertarget,
+ renderbuffer,
+ "glNamedFramebufferRenderbuffer");
+}
+
+
static void
get_framebuffer_attachment_parameter(struct gl_context *ctx,
struct gl_framebuffer *buffer,
}
+void GLAPIENTRY
+_mesa_GetNamedFramebufferAttachmentParameterivEXT(GLuint framebuffer,
+ GLenum attachment,
+ GLenum pname, GLint *params)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_framebuffer *buffer;
+
+ if (framebuffer) {
+ buffer = _mesa_lookup_framebuffer_dsa(ctx, framebuffer,
+ "glGetNamedFramebufferAttachmentParameterivEXT");
+ if (!buffer)
+ return;
+ }
+ else {
+ /*
+ * Section 9.2 Binding and Managing Framebuffer Objects of the OpenGL
+ * 4.5 core spec (30.10.2014, PDF page 314):
+ * "If framebuffer is zero, then the default draw framebuffer is
+ * queried."
+ */
+ buffer = ctx->WinSysDrawBuffer;
+ }
+
+ get_framebuffer_attachment_parameter(ctx, buffer, attachment, pname,
+ params,
+ "glGetNamedFramebufferAttachmentParameterivEXT");
+}
+
+
void GLAPIENTRY
_mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
GLint param)
}
+void GLAPIENTRY
+_mesa_GetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname,
+ GLint *param)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_framebuffer *fb;
+
+ if (framebuffer)
+ fb = _mesa_lookup_framebuffer_dsa(ctx, framebuffer,
+ "glGetFramebufferParameterivEXT");
+ else
+ fb = ctx->WinSysDrawBuffer;
+
+ if (fb) {
+ /* The GL_EXT_direct_state_access says:
+ *
+ * The pname parameter must be one of framebuffer dependent values
+ * listed in either table 4.nnn (namely DRAW_BUFFER, READ_BUFFER,
+ * or DRAW_BUFFER0 through DRAW_BUFFER15).
+ */
+ if (pname == GL_DRAW_BUFFER) {
+ *param = fb->ColorDrawBuffer[0];
+
+ }
+ else if (pname == GL_READ_BUFFER) {
+ *param = fb->ColorReadBuffer;
+ }
+ else if (GL_DRAW_BUFFER0 <= pname && pname <= GL_DRAW_BUFFER15) {
+ *param = fb->ColorDrawBuffer[pname - GL_DRAW_BUFFER0];
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferParameterivEXT(pname)");
+ }
+ }
+}
+
+
void GLAPIENTRY
_mesa_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
GLint *param)
_mesa_lookup_framebuffer_err(struct gl_context *ctx, GLuint id,
const char *func);
+struct gl_framebuffer *
+_mesa_lookup_framebuffer_dsa(struct gl_context *ctx, GLuint id,
+ const char* func);
+
void
_mesa_update_texture_renderbuffer(struct gl_context *ctx,
extern GLenum GLAPIENTRY
_mesa_CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target);
+extern GLenum GLAPIENTRY
+_mesa_CheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target);
+
extern void GLAPIENTRY
_mesa_FramebufferTexture1D_no_error(GLenum target, GLenum attachment,
GLenum textarget, GLuint texture,
_mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
GLuint texture, GLint level);
+extern void GLAPIENTRY
+_mesa_NamedFramebufferRenderbufferEXT(GLuint framebuffer, GLenum attachment,
+ GLenum renderbuffertarget,
+ GLuint renderbuffer);
+
+extern void GLAPIENTRY
+_mesa_NamedFramebufferTexture1DEXT(GLuint framebuffer, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level);
+
+extern void GLAPIENTRY
+_mesa_NamedFramebufferTexture2DEXT(GLuint framebuffer, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level);
+
+extern void GLAPIENTRY
+_mesa_NamedFramebufferTexture3DEXT(GLuint framebuffer, GLenum attachment,
+ GLenum textarget, GLuint texture,
+ GLint level, GLint zoffset);
+
void GLAPIENTRY
_mesa_FramebufferRenderbuffer_no_error(GLenum target, GLenum attachment,
GLenum renderbuffertarget,
extern void GLAPIENTRY
_mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
- GLenum pname, GLint *params);
+ GLenum pname, GLint *params);
+
extern void GLAPIENTRY
_mesa_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
GLenum attachment,
GLenum pname, GLint *params);
+extern void GLAPIENTRY
+_mesa_GetNamedFramebufferAttachmentParameterivEXT(GLuint framebuffer,
+ GLenum attachment,
+ GLenum pname, GLint *params);
+
extern void GLAPIENTRY
_mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
GLint param);
+extern void GLAPIENTRY
+_mesa_GetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname,
+ GLint *param);
+
extern void GLAPIENTRY
_mesa_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
GLint *param);
//{ "glNamedRenderbufferStorageEXT", 30, -1 },
//{ "glGetNamedRenderbufferParameterivEXT", 30, -1 },
//{ "glNamedRenderbufferStorageMultisampleEXT", 30, -1 },
- //{ "glCheckNamedFramebufferStatusEXT", 30, -1 },
- //{ "glNamedFramebufferTexture1DEXT", 30, -1 },
- //{ "glNamedFramebufferTexture2DEXT", 30, -1 },
- //{ "glNamedFramebufferTexture3DEXT", 30, -1 },
- //{ "glNamedFramebufferRenderbufferEXT", 30, -1 },
- //{ "glGetNamedFramebufferAttachmentParameterivEXT", 30, -1 },
+ { "glCheckNamedFramebufferStatusEXT", 30, -1 },
+ { "glNamedFramebufferTexture1DEXT", 30, -1 },
+ { "glNamedFramebufferTexture2DEXT", 30, -1 },
+ { "glNamedFramebufferTexture3DEXT", 30, -1 },
+ { "glNamedFramebufferRenderbufferEXT", 30, -1 },
+ { "glGetNamedFramebufferAttachmentParameterivEXT", 30, -1 },
//{ "glGenerateTextureMipmapEXT", 30, -1 },
//{ "glGenerateMultiTexMipmapEXT", 30, -1 },
- //{ "glFramebufferDrawBufferEXT", 30, -1 },
- //{ "glFramebufferDrawBuffersEXT", 30, -1 },
- //{ "glFramebufferReadBufferEXT", 30, -1 },
- //{ "glGetFramebufferParameterivEXT", 30, -1 },
+ { "glFramebufferDrawBufferEXT", 30, -1 },
+ { "glFramebufferDrawBuffersEXT", 30, -1 },
+ { "glFramebufferReadBufferEXT", 30, -1 },
+ { "glGetFramebufferParameterivEXT", 30, -1 },
//{ "glNamedCopyBufferSubDataEXT", 30, -1 },
//{ "glVertexArrayVertexOffsetEXT", 30, -1 },
//{ "glVertexArrayColorOffsetEXT", 30, -1 },