Re: [Mesa-dev] [PATCH] mesa: only check sample count if we actually wanted multisampling

2013-03-26 Thread Kenneth Graunke

On 03/25/2013 03:48 AM, Chris Forbes wrote:

Fixes various test fallout from 90b5a2425a on Pineview, which claims to
support ARB_internalformat_query but doesn't actually provide the
driverfunc.

That driver is still broken [GetInternalformativ will still segfault!]
but it was silly to be going through the sample count logic in the
nonmultisampling case at all.

Signed-off-by: Chris Forbes chr...@ijw.co.nz
---
  src/mesa/main/fbobject.c | 19 ++-
  1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 3fdf626..c1f5299 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1537,15 +1537,16 @@ renderbuffer_storage(GLenum target, GLenum 
internalFormat,
/* NumSamples == 0 indicates non-multisampling */
samples = 0;
 }
-
-   /* check the sample count;
-* note: driver may choose to use more samples than what's requested
-*/
-   sample_count_error = _mesa_check_sample_count(ctx, target,
- internalFormat, samples);
-   if (sample_count_error != GL_NO_ERROR) {
-  _mesa_error(ctx, sample_count_error, %s(samples), func);
-  return;
+   else {
+  /* check the sample count;
+   * note: driver may choose to use more samples than what's requested
+   */
+  sample_count_error = _mesa_check_sample_count(ctx, target,
+internalFormat, samples);
+  if (sample_count_error != GL_NO_ERROR) {
+ _mesa_error(ctx, sample_count_error, %s(samples), func);
+ return;
+  }
 }

 rb = ctx-CurrentRenderbuffer;


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


[Mesa-dev] [PATCH] mesa: only check sample count if we actually wanted multisampling

2013-03-25 Thread Chris Forbes
Fixes various test fallout from 90b5a2425a on Pineview, which claims to
support ARB_internalformat_query but doesn't actually provide the
driverfunc.

That driver is still broken [GetInternalformativ will still segfault!]
but it was silly to be going through the sample count logic in the
nonmultisampling case at all.

Signed-off-by: Chris Forbes chr...@ijw.co.nz
---
 src/mesa/main/fbobject.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 3fdf626..c1f5299 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1537,15 +1537,16 @@ renderbuffer_storage(GLenum target, GLenum 
internalFormat,
   /* NumSamples == 0 indicates non-multisampling */
   samples = 0;
}
-
-   /* check the sample count;
-* note: driver may choose to use more samples than what's requested
-*/
-   sample_count_error = _mesa_check_sample_count(ctx, target,
- internalFormat, samples);
-   if (sample_count_error != GL_NO_ERROR) {
-  _mesa_error(ctx, sample_count_error, %s(samples), func);
-  return;
+   else {
+  /* check the sample count;
+   * note: driver may choose to use more samples than what's requested
+   */
+  sample_count_error = _mesa_check_sample_count(ctx, target,
+internalFormat, samples);
+  if (sample_count_error != GL_NO_ERROR) {
+ _mesa_error(ctx, sample_count_error, %s(samples), func);
+ return;
+  }
}
 
rb = ctx-CurrentRenderbuffer;
-- 
1.8.2

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