summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clear.c
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2015-05-10 20:48:11 +0200
committerFredrik Höglund <[email protected]>2015-05-14 15:48:17 +0200
commit6ad0b7e07a0445e9e0f368e079c4f7b8a6757bb3 (patch)
tree2731fe750e7319b56c712baff1ae0f468d77a756 /src/mesa/main/clear.c
parent339ed0984d4f54fca91235a1df2ce3a850f6123f (diff)
mesa: Add ARB_direct_state_access checks in FBO functions
Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/mesa/main/clear.c')
-rw-r--r--src/mesa/main/clear.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
index 426caea4709..c6999f7fdb6 100644
--- a/src/mesa/main/clear.c
+++ b/src/mesa/main/clear.c
@@ -412,6 +412,14 @@ _mesa_ClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer,
{
GLint oldfb;
+ GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.ARB_direct_state_access) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glClearNamedFramebufferiv(GL_ARB_direct_state_access "
+ "is not supported)");
+ return;
+ }
+
_mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
_mesa_ClearBufferiv(buffer, drawbuffer, value);
@@ -502,6 +510,14 @@ _mesa_ClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer,
{
GLint oldfb;
+ GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.ARB_direct_state_access) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glClearNamedFramebufferuiv(GL_ARB_direct_state_access "
+ "is not supported)");
+ return;
+ }
+
_mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
_mesa_ClearBufferuiv(buffer, drawbuffer, value);
@@ -613,6 +629,14 @@ _mesa_ClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer,
{
GLint oldfb;
+ GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.ARB_direct_state_access) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glClearNamedFramebufferfv(GL_ARB_direct_state_access "
+ "is not supported)");
+ return;
+ }
+
_mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
_mesa_ClearBufferfv(buffer, drawbuffer, value);
@@ -695,6 +719,14 @@ _mesa_ClearNamedFramebufferfi(GLuint framebuffer, GLenum buffer,
{
GLint oldfb;
+ GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.ARB_direct_state_access) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glClearNamedFramebufferfi(GL_ARB_direct_state_access "
+ "is not supported)");
+ return;
+ }
+
_mesa_GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfb);
_mesa_BindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);
_mesa_ClearBufferfi(buffer, 0, depth, stencil);