Re: [Mesa-dev] [PATCH 1/2] mesa: add missing error check for linear blit of integer colors

2012-01-07 Thread Kenneth Graunke

On 01/07/2012 01:13 PM, Brian Paul wrote:

On 01/06/2012 05:36 PM, Eric Anholt wrote:

On Fri, 6 Jan 2012 15:34:47 -0700, Brian Paul wrote:

---
src/mesa/main/fbobject.c | 12 
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 912170a..aa35ba7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2742,6 +2742,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint
srcY0, GLint srcX1, GLint srcY1,
}
}

+ if (filter == GL_LINEAR&& (mask& GL_COLOR_BUFFER_BIT)) {
+ /* "Calling BlitFramebuffer will result in an INVALID_OPERATION error
+ * if filter is LINEAR and read buffer contains integer data."


I couldn't find this piece of text (though I would have hoped it
existed). Care to cite which spec in the comment?


3.1 spec, 3rd paragraph of page 199. Or
http://www.opengl.org/sdk/docs/man3/xhtml/glBlitFramebuffer.xml in the
errors section.

It's not in the 3.0 spec, but I'm sure that was an oversight.

Same story for the buffer datatype check I posted in a later patch.

-Brian


Sounds good to me, then.  Might update the comments with the reference.

Both patches are:
Reviewed-by: Kenneth Graunke 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] mesa: add missing error check for linear blit of integer colors

2012-01-07 Thread Brian Paul

On 01/06/2012 05:36 PM, Eric Anholt wrote:

On Fri,  6 Jan 2012 15:34:47 -0700, Brian Paul  wrote:

---
  src/mesa/main/fbobject.c |   12 
  1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 912170a..aa35ba7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2742,6 +2742,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
}
 }

+   if (filter == GL_LINEAR&&  (mask&  GL_COLOR_BUFFER_BIT)) {
+  /* "Calling BlitFramebuffer will result in an INVALID_OPERATION error
+   * if filter is LINEAR and read buffer contains integer data."


I couldn't find this piece of text (though I would have hoped it
existed).  Care to cite which spec in the comment?


3.1 spec, 3rd paragraph of page 199.  Or 
http://www.opengl.org/sdk/docs/man3/xhtml/glBlitFramebuffer.xml in the 
errors section.


It's not in the 3.0 spec, but I'm sure that was an oversight.

Same story for the buffer datatype check I posted in a later patch.

-Brian
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] mesa: add missing error check for linear blit of integer colors

2012-01-06 Thread Eric Anholt
On Fri,  6 Jan 2012 15:34:47 -0700, Brian Paul  wrote:
> ---
>  src/mesa/main/fbobject.c |   12 
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 912170a..aa35ba7 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2742,6 +2742,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, 
> GLint srcX1, GLint srcY1,
>}
> }
>  
> +   if (filter == GL_LINEAR && (mask & GL_COLOR_BUFFER_BIT)) {
> +  /* "Calling BlitFramebuffer will result in an INVALID_OPERATION error
> +   * if filter is LINEAR and read buffer contains integer data."

I couldn't find this piece of text (though I would have hoped it
existed).  Care to cite which spec in the comment?


pgpqlbyOkHekG.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 1/2] mesa: add missing error check for linear blit of integer colors

2012-01-06 Thread Brian Paul
---
 src/mesa/main/fbobject.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 912170a..aa35ba7 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2742,6 +2742,18 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint 
srcX1, GLint srcY1,
   }
}
 
+   if (filter == GL_LINEAR && (mask & GL_COLOR_BUFFER_BIT)) {
+  /* "Calling BlitFramebuffer will result in an INVALID_OPERATION error
+   * if filter is LINEAR and read buffer contains integer data."
+   */
+  GLenum type = _mesa_get_format_datatype(colorReadRb->Format);
+  if (type == GL_INT || type == GL_UNSIGNED_INT) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBlitFramebufferEXT(integer color type)");
+ return;
+  }
+   }
+
if (!ctx->Extensions.EXT_framebuffer_blit) {
   _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT");
   return;
-- 
1.7.3.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev