Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-03-19 Thread Martin Peres
Bump. I would really like to push this series ASAP and I only have a few 
patches without R-b.


On 16/02/15 16:13, Martin Peres wrote:

Maybe this should be the job of the dispatch layer.

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  src/mesa/main/multisample.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 1f3fa0c..a0a659b 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -150,6 +150,15 @@ GLenum
  _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
   GLenum internalFormat, GLsizei samples)
  {
+   /* From the OpenGL core 3.0 spec, section 2.5:


The comment has been fixed locally to read:

Section 2.5 (GL Errors) of OpenGL 3.0 specification, page 16:

http://cgit.freedesktop.org/~mperes/mesa/commit/?h=dsaid=faa9ef63d801f11a96f444aee083d9fac95a039d


+*
+* If a negative number is provided where an argument of type sizei or
+* sizeiptr is specified, the error INVALID VALUE is generated.
+*/
+   if (samples  0) {
+  return GL_INVALID_VALUE;
+   }
+
 /* If ARB_internalformat_query is supported, then treat its highest
  * returned sample count as the absolute maximum for this format; it is
  * allowed to exceed MAX_SAMPLES.


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


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-23 Thread Jason Ekstrand
On Mon, Feb 23, 2015 at 12:51 AM, Martin Peres martin.pe...@linux.intel.com
 wrote:

 On 20/02/15 20:38, Laura Ekstrand wrote:

 Please provide a page number and a section title in your spec comment.


 I'm not very fond of giving the page number as Khronos updates the pdf
 quite often
 and the page number may change. Since I see so little people write the pdf
 page
 number, is there a policy in place?

 Anyway, I updated the commit locally and I'll be updating all the other
 patches.


People do tend to use page numbers from what I've seen.  Yes, it has the
potential to get out-of-sync but probably never by more than a page or
two.  I don't thnk spec updates are all that substantial, especially in
older versions.  You could also give a section number (down to the
subsection) but that isn't quite as nice especially when the subsections
are large.  The big point is not to say Here's a quote from *somewhere* in
this 300 page PDF document.  Go fish! :-)
--Jason



 Thanks.

 On Mon, Feb 16, 2015 at 6:13 AM, Martin Peres 
 martin.pe...@linux.intel.com mailto:martin.pe...@linux.intel.com
 wrote:

 Maybe this should be the job of the dispatch layer.

 Signed-off-by: Martin Peres martin.pe...@linux.intel.com
 mailto:martin.pe...@linux.intel.com

 ---
  src/mesa/main/multisample.c | 9 +
  1 file changed, 9 insertions(+)

 diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
 index 1f3fa0c..a0a659b 100644
 --- a/src/mesa/main/multisample.c
 +++ b/src/mesa/main/multisample.c
 @@ -150,6 +150,15 @@ GLenum
  _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
   GLenum internalFormat, GLsizei samples)
  {
 +   /* From the OpenGL core 3.0 spec, section 2.5:
 +*
 +* If a negative number is provided where an argument of type
 sizei or
 +* sizeiptr is specified, the error INVALID VALUE is generated.
 +*/
 +   if (samples  0) {
 +  return GL_INVALID_VALUE;
 +   }
 +
 /* If ARB_internalformat_query is supported, then treat its
 highest
  * returned sample count as the absolute maximum for this
 format; it is
  * allowed to exceed MAX_SAMPLES.
 --
 2.3.0

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



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

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


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-23 Thread Martin Peres

On 20/02/15 20:57, Ilia Mirkin wrote:

On Mon, Feb 16, 2015 at 9:13 AM, Martin Peres
martin.pe...@linux.intel.com wrote:

Maybe this should be the job of the dispatch layer.

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
  src/mesa/main/multisample.c | 9 +
  1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 1f3fa0c..a0a659b 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -150,6 +150,15 @@ GLenum
  _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
   GLenum internalFormat, GLsizei samples)
  {
+   /* From the OpenGL core 3.0 spec, section 2.5:

I think this is a bit of a contradiction... there is no OpenGL 3.0
core spec. Core didn't become a thing until 3.1 afaik.

Indeed, the comment was about GL 4.5 and I updated to 3.0 without
getting rid of core.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-23 Thread Martin Peres

On 20/02/15 20:38, Laura Ekstrand wrote:

Please provide a page number and a section title in your spec comment.


I'm not very fond of giving the page number as Khronos updates the pdf 
quite often
and the page number may change. Since I see so little people write the 
pdf page

number, is there a policy in place?

Anyway, I updated the commit locally and I'll be updating all the other 
patches.




Thanks.

On Mon, Feb 16, 2015 at 6:13 AM, Martin Peres 
martin.pe...@linux.intel.com mailto:martin.pe...@linux.intel.com 
wrote:


Maybe this should be the job of the dispatch layer.

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
mailto:martin.pe...@linux.intel.com
---
 src/mesa/main/multisample.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 1f3fa0c..a0a659b 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -150,6 +150,15 @@ GLenum
 _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
  GLenum internalFormat, GLsizei samples)
 {
+   /* From the OpenGL core 3.0 spec, section 2.5:
+*
+* If a negative number is provided where an argument of type
sizei or
+* sizeiptr is specified, the error INVALID VALUE is generated.
+*/
+   if (samples  0) {
+  return GL_INVALID_VALUE;
+   }
+
/* If ARB_internalformat_query is supported, then treat its
highest
 * returned sample count as the absolute maximum for this
format; it is
 * allowed to exceed MAX_SAMPLES.
--
2.3.0

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




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


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-23 Thread Martin Peres

On 23/02/15 17:35, Jason Ekstrand wrote:
People do tend to use page numbers from what I've seen.  Yes, it has 
the potential to get out-of-sync but probably never by more than a 
page or two.  I don't thnk spec updates are all that substantial, 
especially in older versions.  You could also give a section number 
(down to the subsection) but that isn't quite as nice especially when 
the subsections are large.  The big point is not to say Here's a 
quote from *somewhere* in this 300 page PDF document.  Go fish! :-)


ACK. Thanks for the info :)
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-20 Thread Laura Ekstrand
Please provide a page number and a section title in your spec comment.

Thanks.

On Mon, Feb 16, 2015 at 6:13 AM, Martin Peres martin.pe...@linux.intel.com
wrote:

 Maybe this should be the job of the dispatch layer.

 Signed-off-by: Martin Peres martin.pe...@linux.intel.com
 ---
  src/mesa/main/multisample.c | 9 +
  1 file changed, 9 insertions(+)

 diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
 index 1f3fa0c..a0a659b 100644
 --- a/src/mesa/main/multisample.c
 +++ b/src/mesa/main/multisample.c
 @@ -150,6 +150,15 @@ GLenum
  _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
   GLenum internalFormat, GLsizei samples)
  {
 +   /* From the OpenGL core 3.0 spec, section 2.5:
 +*
 +* If a negative number is provided where an argument of type sizei or
 +* sizeiptr is specified, the error INVALID VALUE is generated.
 +*/
 +   if (samples  0) {
 +  return GL_INVALID_VALUE;
 +   }
 +
 /* If ARB_internalformat_query is supported, then treat its highest
  * returned sample count as the absolute maximum for this format; it is
  * allowed to exceed MAX_SAMPLES.
 --
 2.3.0

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

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


Re: [Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-20 Thread Ilia Mirkin
On Mon, Feb 16, 2015 at 9:13 AM, Martin Peres
martin.pe...@linux.intel.com wrote:
 Maybe this should be the job of the dispatch layer.

 Signed-off-by: Martin Peres martin.pe...@linux.intel.com
 ---
  src/mesa/main/multisample.c | 9 +
  1 file changed, 9 insertions(+)

 diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
 index 1f3fa0c..a0a659b 100644
 --- a/src/mesa/main/multisample.c
 +++ b/src/mesa/main/multisample.c
 @@ -150,6 +150,15 @@ GLenum
  _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
   GLenum internalFormat, GLsizei samples)
  {
 +   /* From the OpenGL core 3.0 spec, section 2.5:

I think this is a bit of a contradiction... there is no OpenGL 3.0
core spec. Core didn't become a thing until 3.1 afaik.

 +*
 +* If a negative number is provided where an argument of type sizei or
 +* sizeiptr is specified, the error INVALID VALUE is generated.
 +*/
 +   if (samples  0) {
 +  return GL_INVALID_VALUE;
 +   }
 +
 /* If ARB_internalformat_query is supported, then treat its highest
  * returned sample count as the absolute maximum for this format; it is
  * allowed to exceed MAX_SAMPLES.
 --
 2.3.0

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


[Mesa-dev] [PATCH 03/16] main: fix the validation of the number of samples

2015-02-16 Thread Martin Peres
Maybe this should be the job of the dispatch layer.

Signed-off-by: Martin Peres martin.pe...@linux.intel.com
---
 src/mesa/main/multisample.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/multisample.c b/src/mesa/main/multisample.c
index 1f3fa0c..a0a659b 100644
--- a/src/mesa/main/multisample.c
+++ b/src/mesa/main/multisample.c
@@ -150,6 +150,15 @@ GLenum
 _mesa_check_sample_count(struct gl_context *ctx, GLenum target,
  GLenum internalFormat, GLsizei samples)
 {
+   /* From the OpenGL core 3.0 spec, section 2.5:
+*
+* If a negative number is provided where an argument of type sizei or
+* sizeiptr is specified, the error INVALID VALUE is generated.
+*/
+   if (samples  0) {
+  return GL_INVALID_VALUE;
+   }
+
/* If ARB_internalformat_query is supported, then treat its highest
 * returned sample count as the absolute maximum for this format; it is
 * allowed to exceed MAX_SAMPLES.
-- 
2.3.0

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