Re: [Mesa-dev] [PATCH] mesa: Remove GL_ARB_sampler_object depth compare error checking.

2015-10-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Am 2015-10-06 um 21:01 schrieb Brian Paul:
> Thanks for reposting.  Look OK to me.  I'll commit it later.
I see it is in. Thanks for taking care of this!

Cheers,
Stefan


-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWGAY+AAoJEN0/YqbEcdMwEmkP/0VgZsmvcug9g/ELhSCFZMJr
QFiEMT4J2mOFmfYfuprTGdA6to7FuUKsR2EC+8KKGH4S6tLuxQk3UV1um9dKCQRW
R6m50lLJRTCB4+BoAqfjiwBD2rgczNycuP8bp5q/947zfSsZGN3UyX8AbvdOLXZc
EBNksGi9sNgVl0PsK/klYpyhAqItFbMez6Vi1fLSYHa1fNuRdhlITvR8B+0HT88j
l/XLsqVL3TyrHwdvug6KsUIS69ykgnkJXcvjP7JfjsQ/We3jtwEHRGF+58xRN5yJ
YLMwMnYJSQ5CcXlfhFDvfF47PL0uzfa+51H2HnWyevNt25hphAjqNaTIs0T7daPN
+WE44G8cByiWNgzUusfNNENaBP8uNTEwlQdNNfJUg21RFtQJsWtwBLXcNmeuTFeC
mYfbVcaqgutiZyZnGYuIZpCw+B07/mUZvc3WxYjf+PPhJGmWRNAnRE7J6gM236xS
vVJZLz4PLFrJoPxH9Ef8+nVv/QEvw2/BYdQ1ssMprsFA0CGbePjpfUHAM4dlzeu0
3fFtS+2g1Qt/tMLCQHyihifhkVCfDcXQHnmB77aT1B+h+5yM4daQVENLhxsXjIZw
fi6z7rRb9lZnazpzZEJ21TvGjgGC44evZVJaqxyn0CEyKSC8dA/UmFDQ4utiTAAR
zpHHB2VSP/K1jpeg/lFJ
=WBfb
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: Remove GL_ARB_sampler_object depth compare error checking.

2015-10-05 Thread Stefan Dösinger
Version 3: Simplify the code comment, word wrap commit description.

Version 2: Return GL_FALSE if ARB_shadow is unsupported instead of
pretending to store the value as suggested by Brian Paul.

This fixes a GL error warning on r200 in Wine.

The GL_ARB_sampler_objects extension does not specify a dependency on
GL_ARB_shadow or GL_ARB_depth_texture for setting the depth texture
compare mode and function. Silently ignore attempts to change these
settings. They won't matter without a depth texture being assigned
anyway.
---
 src/mesa/main/samplerobj.c | 28 ++--
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 9bcba60..676dd36 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -621,8 +621,12 @@ static GLuint
 set_sampler_compare_mode(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
+/* If GL_ARB_shadow is not supported, don't report an error.  The
+ * sampler object extension spec isn't clear on this extension interaction.
+ * Silences errors with Wine on older GPUs such as R200.
+ */
if (!ctx->Extensions.ARB_shadow)
-  return INVALID_PNAME;
+  return GL_FALSE;
 
if (samp->CompareMode == param)
   return GL_FALSE;
@@ -642,8 +646,12 @@ static GLuint
 set_sampler_compare_func(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
+/* If GL_ARB_shadow is not supported, don't report an error.  The
+ * sampler object extension spec isn't clear on this extension interaction.
+ * Silences errors with Wine on older GPUs such as R200.
+ */
if (!ctx->Extensions.ARB_shadow)
-  return INVALID_PNAME;
+  return GL_FALSE;
 
if (samp->CompareFunc == param)
   return GL_FALSE;
@@ -1329,13 +1337,9 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = IROUND(sampObj->LodBias);
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj->CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj->CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1418,13 +1422,9 @@ _mesa_GetSamplerParameterfv(GLuint sampler, GLenum 
pname, GLfloat *params)
   *params = sampObj->LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj->CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj->CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1497,13 +1497,9 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = (GLint) sampObj->LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj->CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj->CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1576,13 +1572,9 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum 
pname, GLuint *params)
   *params = (GLuint) sampObj->LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj->CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx->Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj->CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
-- 
2.4.9

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


Re: [Mesa-dev] [PATCH] Allow setting GL_TEXTURE_COMPARE_MODE on a sampler object without ARB_shadow support (v2).

2015-07-30 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Thanks for the quick feedback! I'll resend the patch with the
requested fixes shortly.

Stefan

Am 2015-07-30 um 15:30 schrieb Brian Paul:
 Can you try to shorten the subject line to 75 chars or less?  It
 should also start with mesa:.  Perhaps:
 
 mesa: disable texture compare mode error checking for Wine
 
 
 On 07/30/2015 07:04 AM, Stefan Dösinger wrote:
 Version 2: Return GL_FALSE if ARB_shadow is unsupported instead
 of pretending to store the value as
 
 Please word wrap that line to 75 chars or less.
 
 suggested by Brian Paul.
 
 This fixes a GL error warning on r200 in Wine.
 
 The GL_ARB_sampler_objects extension does not specify a
 dependency on GL_ARB_shadow or GL_ARB_depth_texture for this
 value. Just set the value and don't do anything else. It won't
 matter without a depth texture being assigned anyway.
 
 This comment doesn't reflect what the code is really doing.  The
 code is not setting any values.
 
 
 --- src/mesa/main/samplerobj.c | 28 ++-- 
 1 file changed, 10 insertions(+), 18 deletions(-)
 
 diff --git a/src/mesa/main/samplerobj.c
 b/src/mesa/main/samplerobj.c index 32180fb1..f5d2077 100644 ---
 a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@
 -634,8 +634,12 @@ static GLuint set_sampler_compare_mode(struct
 gl_context *ctx, struct gl_sampler_object *samp, GLint param) { +
 /* No state change, no error. GL_ARB_sampler_objects does not +
 * have a dependency on GL_ARB_shadow for these settings. They +
 * don't have any effect without shadow textures anyway. +*
 This matters for Wine on old GPUs, e.g. r200. */
 
 Please put closing */ on next line.  Actually, the comment could
 be simplified:
 
 /* If GL_ARB_shadow is not supported, don't report an error.  The *
 sampler object extension spec isn't clear on this extension
 interaction. * Silences errors with Wine on older GPUs such as
 R200. */
 
 
 if (!ctx-Extensions.ARB_shadow) -  return INVALID_PNAME; +
 return GL_FALSE;
 
 if (samp-CompareMode == param) return GL_FALSE; @@ -655,8
 +659,12 @@ static GLuint set_sampler_compare_func(struct
 gl_context *ctx, struct gl_sampler_object *samp, GLint param) { +
 /* No state change, no error. GL_ARB_sampler_objects does not +
 * have a dependency on GL_ARB_shadow for these settings. They +
 * don't have any effect without shadow textures anyway. +*
 This matters for Wine on old GPUs, e.g. r200. */ if
 (!ctx-Extensions.ARB_shadow) -  return INVALID_PNAME; +
 return GL_FALSE;
 
 if (samp-CompareFunc == param) return GL_FALSE; @@ -1342,13
 +1350,9 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum
 pname, GLint *params) *params = IROUND(sampObj-LodBias); break; 
 case GL_TEXTURE_COMPARE_MODE: -  if
 (!ctx-Extensions.ARB_shadow) - goto invalid_pname; 
 *params = sampObj-CompareMode; break; case
 GL_TEXTURE_COMPARE_FUNC: -  if (!ctx-Extensions.ARB_shadow) 
 - goto invalid_pname; *params = sampObj-CompareFunc; 
 break; case GL_TEXTURE_MAX_ANISOTROPY_EXT: @@ -1431,13 +1435,9 @@
 _mesa_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat
 *params) *params = sampObj-LodBias; break; case
 GL_TEXTURE_COMPARE_MODE: -  if (!ctx-Extensions.ARB_shadow) 
 - goto invalid_pname; *params = (GLfloat)
 sampObj-CompareMode; break; case GL_TEXTURE_COMPARE_FUNC: -
 if (!ctx-Extensions.ARB_shadow) - goto invalid_pname; 
 *params = (GLfloat) sampObj-CompareFunc; break; case
 GL_TEXTURE_MAX_ANISOTROPY_EXT: @@ -1510,13 +1510,9 @@
 _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint
 *params) *params = (GLint) sampObj-LodBias; break; case
 GL_TEXTURE_COMPARE_MODE: -  if (!ctx-Extensions.ARB_shadow) 
 - goto invalid_pname; *params = sampObj-CompareMode; 
 break; case GL_TEXTURE_COMPARE_FUNC: -  if
 (!ctx-Extensions.ARB_shadow) - goto invalid_pname; 
 *params = sampObj-CompareFunc; break; case
 GL_TEXTURE_MAX_ANISOTROPY_EXT: @@ -1589,13 +1585,9 @@
 _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum pname,
 GLuint *params) *params = (GLuint) sampObj-LodBias; break; case
 GL_TEXTURE_COMPARE_MODE: -  if (!ctx-Extensions.ARB_shadow) 
 - goto invalid_pname; *params = sampObj-CompareMode; 
 break; case GL_TEXTURE_COMPARE_FUNC: -  if
 (!ctx-Extensions.ARB_shadow) - goto invalid_pname; 
 *params = sampObj-CompareFunc; break; case
 GL_TEXTURE_MAX_ANISOTROPY_EXT:
 
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBAgAGBQJVuisUAAoJEN0/YqbEcdMwwl4P/Awl2F5yQyO0gmxzwwTOj4Cx
3yReuJmJj++rJkP8ZnYOD4ATOSwqfVFvwRvV5i2s/UhtqO5DDmS65IJ92qVLbgzH
As7QnUdoIFGlSB5vZv9KljQJhRFhrllod6xKYWGY8VtE4f8imri6vs6/2TperDHv
tkLF50UJX/JWo96aQDD+PuMPF02EcvpN1AJIvbqhswtm30T5a2QNRiiXFcEdoecQ
KbKKhKdoivLZ57ltyeeI2aCBVWm/EfyqX+wS4aRYLWlj8e2dQVHfPqeVcw8vfNPB
lIF8qDjzuX5kgy6KrtKbKKcMLMIVyzs+pWJAuCBkOlbvxEIm8zldlyh5ClGquU/o
BBa45KtKotzHnddmKdDl7MQBh9J1zSygGGbiHCUi64JbtAi6Kco4qmI7RRKl0dVa
aAzU

[Mesa-dev] [PATCH] Allow setting GL_TEXTURE_COMPARE_MODE on a sampler object without ARB_shadow support (v2).

2015-07-30 Thread Stefan Dösinger
Version 2: Return GL_FALSE if ARB_shadow is unsupported instead of pretending 
to store the value as
suggested by Brian Paul.

This fixes a GL error warning on r200 in Wine.

The GL_ARB_sampler_objects extension does not specify a dependency on
GL_ARB_shadow or GL_ARB_depth_texture for this value. Just set the value
and don't do anything else. It won't matter without a depth texture
being assigned anyway.
---
 src/mesa/main/samplerobj.c | 28 ++--
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 32180fb1..f5d2077 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -634,8 +634,12 @@ static GLuint
 set_sampler_compare_mode(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
+   /* No state change, no error. GL_ARB_sampler_objects does not
+* have a dependency on GL_ARB_shadow for these settings. They
+* don't have any effect without shadow textures anyway.
+* This matters for Wine on old GPUs, e.g. r200. */
if (!ctx-Extensions.ARB_shadow)
-  return INVALID_PNAME;
+  return GL_FALSE;
 
if (samp-CompareMode == param)
   return GL_FALSE;
@@ -655,8 +659,12 @@ static GLuint
 set_sampler_compare_func(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
+   /* No state change, no error. GL_ARB_sampler_objects does not
+* have a dependency on GL_ARB_shadow for these settings. They
+* don't have any effect without shadow textures anyway.
+* This matters for Wine on old GPUs, e.g. r200. */
if (!ctx-Extensions.ARB_shadow)
-  return INVALID_PNAME;
+  return GL_FALSE;
 
if (samp-CompareFunc == param)
   return GL_FALSE;
@@ -1342,13 +1350,9 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = IROUND(sampObj-LodBias);
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1431,13 +1435,9 @@ _mesa_GetSamplerParameterfv(GLuint sampler, GLenum 
pname, GLfloat *params)
   *params = sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1510,13 +1510,9 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = (GLint) sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1589,13 +1585,9 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum 
pname, GLuint *params)
   *params = (GLuint) sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
-- 
2.3.6

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


[Mesa-dev] [PATCH] mesa: Remove GL_ARB_sampler_object depth compare error checking.

2015-07-30 Thread Stefan Dösinger
Version 3: Simplify the code comment, word wrap commit description.

Version 2: Return GL_FALSE if ARB_shadow is unsupported instead of
pretending to store the value as suggested by Brian Paul.

This fixes a GL error warning on r200 in Wine.

The GL_ARB_sampler_objects extension does not specify a dependency on
GL_ARB_shadow or GL_ARB_depth_texture for setting the depth texture
compare mode and function. Silently ignore attempts to change these
settings. They won't matter without a depth texture being assigned
anyway.
---
 src/mesa/main/samplerobj.c | 28 ++--
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 32180fb1..01cf584 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -634,8 +634,12 @@ static GLuint
 set_sampler_compare_mode(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
+/* If GL_ARB_shadow is not supported, don't report an error.  The
+ * sampler object extension spec isn't clear on this extension interaction.
+ * Silences errors with Wine on older GPUs such as R200.
+ */
if (!ctx-Extensions.ARB_shadow)
-  return INVALID_PNAME;
+  return GL_FALSE;
 
if (samp-CompareMode == param)
   return GL_FALSE;
@@ -655,8 +659,12 @@ static GLuint
 set_sampler_compare_func(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
+/* If GL_ARB_shadow is not supported, don't report an error.  The
+ * sampler object extension spec isn't clear on this extension interaction.
+ * Silences errors with Wine on older GPUs such as R200.
+ */
if (!ctx-Extensions.ARB_shadow)
-  return INVALID_PNAME;
+  return GL_FALSE;
 
if (samp-CompareFunc == param)
   return GL_FALSE;
@@ -1342,13 +1350,9 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = IROUND(sampObj-LodBias);
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1431,13 +1435,9 @@ _mesa_GetSamplerParameterfv(GLuint sampler, GLenum 
pname, GLfloat *params)
   *params = sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1510,13 +1510,9 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = (GLint) sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1589,13 +1585,9 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum 
pname, GLuint *params)
   *params = (GLuint) sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
-- 
2.3.6

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


[Mesa-dev] [PATCH] Allow setting GL_TEXTURE_COMPARE_MODE on a sampler object without ARB_shadow support.

2015-03-23 Thread Stefan Dösinger
This fixes a GL error warning on r200 in Wine.

The GL_ARB_sampler_objects extension does not specify a dependency on
GL_ARB_shadow or GL_ARB_depth_texture for this value. Just set the value
and don't do anything else. It won't matter without a depth texture
being assigned anyway.
---
 src/mesa/main/samplerobj.c | 35 +--
 1 file changed, 13 insertions(+), 22 deletions(-)

diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index d66b0b5..6095efd 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -621,12 +621,18 @@ static GLuint
 set_sampler_compare_mode(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
-   if (!ctx-Extensions.ARB_shadow)
-  return INVALID_PNAME;
-
if (samp-CompareMode == param)
   return GL_FALSE;
 
+   if (!ctx-Extensions.ARB_shadow) {
+  if (param == GL_NONE ||
+  param == GL_COMPARE_R_TO_TEXTURE_ARB) {
+ samp-CompareMode = param;
+ return GL_FALSE;
+  }
+  return INVALID_PARAM;
+   }
+
if (param == GL_NONE ||
param == GL_COMPARE_R_TO_TEXTURE_ARB) {
   flush(ctx);
@@ -642,9 +648,6 @@ static GLuint
 set_sampler_compare_func(struct gl_context *ctx,
  struct gl_sampler_object *samp, GLint param)
 {
-   if (!ctx-Extensions.ARB_shadow)
-  return INVALID_PNAME;
-
if (samp-CompareFunc == param)
   return GL_FALSE;
 
@@ -657,6 +660,10 @@ set_sampler_compare_func(struct gl_context *ctx,
case GL_GREATER:
case GL_ALWAYS:
case GL_NEVER:
+  if(!ctx-Extensions.ARB_shadow) {
+ samp-CompareFunc = param;
+ return GL_FALSE;
+  }
   flush(ctx);
   samp-CompareFunc = param;
   return GL_TRUE;
@@ -1329,13 +1336,9 @@ _mesa_GetSamplerParameteriv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = IROUND(sampObj-LodBias);
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1418,13 +1421,9 @@ _mesa_GetSamplerParameterfv(GLuint sampler, GLenum 
pname, GLfloat *params)
   *params = sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = (GLfloat) sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1497,13 +1496,9 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum 
pname, GLint *params)
   *params = (GLint) sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
@@ -1576,13 +1571,9 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum 
pname, GLuint *params)
   *params = (GLuint) sampObj-LodBias;
   break;
case GL_TEXTURE_COMPARE_MODE:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareMode;
   break;
case GL_TEXTURE_COMPARE_FUNC:
-  if (!ctx-Extensions.ARB_shadow)
- goto invalid_pname;
   *params = sampObj-CompareFunc;
   break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
-- 
2.3.3

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


[Mesa-dev] [PATCH] r300g: Fix the ATI1N swizzle.

2015-03-09 Thread Stefan Dösinger
This fixes the GL_COMPRESSED_RED_RGTC1 part of piglit's rgtc-teximage-01
test as well as the precision part of Wine's 3dc format test (fd.o bug
89156).

The Z component seems to contain a lower precision version of the
result, probably a temporary value from the decompression computation.
The Y and W component contain different data that depends on the input
values as well, but I could not make sense of them (Not that I tried
very hard).

GL_COMPRESSED_SIGNED_RED_RGTC1 still seems to have precision problems in
piglit, and both formats are affected by a compiler bug if they're
sampled by the shader with a swizzle other than .xyzw. Wine uses .,
which returns random garbage.
---
 src/gallium/drivers/r300/r300_texture.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r300/r300_texture.c 
b/src/gallium/drivers/r300/r300_texture.c
index ffe8c00..340b8fc 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -176,7 +176,9 @@ uint32_t r300_translate_texformat(enum pipe_format format,
 format != PIPE_FORMAT_RGTC2_UNORM 
 format != PIPE_FORMAT_RGTC2_SNORM 
 format != PIPE_FORMAT_LATC2_UNORM 
-format != PIPE_FORMAT_LATC2_SNORM) {
+format != PIPE_FORMAT_LATC2_SNORM 
+format != PIPE_FORMAT_RGTC1_UNORM 
+format != PIPE_FORMAT_LATC1_UNORM) {
 result |= r300_get_swizzle_combined(desc-swizzle, swizzle_view,
 TRUE);
 } else {
-- 
2.0.5

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


Re: [Mesa-dev] [PATCH] r300g: Fix the ATI1N swizzle.

2015-03-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Thanks for the quick feedback!

Am 2015-03-09 um 16:20 schrieb Ilia Mirkin:
 I don't suppose you've tried adding RGTC1_SNORM/LATC1_SNORM into
 that condition?
No, because the codepath isn't entered for them at all. There's an
if(format != RGTC1_SNORM  format != LATC1_SNORM) around this block.

I did test if LATC_UNORM and LATC_SNORM still work after my fix.
LATC_SNORM is unchanged (broken in the same way as RGTC_SNORM) and
LATC_UNORM now has the proper precision like RGTC_UNORM.

Stefan

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBAgAGBQJU/cHrAAoJEN0/YqbEcdMwhHcP/0AZDFeAMMK9SGNMoEvmykk/
uDP0Yvlcx1PkRqIhLj1ZXpt4t2rWGEsuYIdaWryIk6qt3na/gl00Arp2TdPWaAEn
ab7uFFw4h4SjPg8qdE+3Vfr8WYSyMZmol9eggsHN+OrL5YIf7N1eeYwNXPZKBTZY
fRCHT3DTGQeT8y9rgdOkoJjJ2az6ydJjrgcfMjuDuJwfxWO/Blj5X3nshBEF4bLF
5xKgHgx5qGsTlO2zkcCqCfEd0K3rDZhUkfR1MswUbyeFsohaTf1TRJ+LRHEYPY4W
bG2raSn8vLuvmD9rSILLlshElrjQN85nMPAbgErIyC8THF54ZJPA0eRO96x19/t+
l/wC8AlXCrSH5aLR7Y2S6HeY805ed5x8lrqKF97lvSEYbg6OnK28YuBnE/qEDskD
5L07M46auyJr78BYV/ifJ1gBO16Jt43sOODT57cYUq570b7nyqNLbOcuJeGKEY4m
egZpfvRqJktge0qunRDqU87WT/B0fV+hx3n/qpT17LUIa9v2cSWmT9acEtyaS/Y+
wCpGOFOID6xA+OO1XnoNkPXeJyBggBscbFtnSvHKAJPaDmTUo7TGmKw400nUJYZ9
d6q685116QxL+PuxvHN0z9bjl0rWJmKax3ZsZ09PnPGxjPlSI27q25+nGjgHFf4v
i4jqOtDz55aOPeEsnfQ1
=fMPD
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] r300g: Fix the ATI1N swizzle.

2015-03-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2015-03-09 um 17:19 schrieb Ilia Mirkin:
 It also has the additional problem that it doesn't do the swizzle 
 workaround which apparently is necessary even for single-component 
 textures.
Do you mean the change I made in my patch? That part works just fine
for the signed one component value. It seemed that a workaround for
S3TC values was incorrectly applied to RGTC values, but I could not
find information about that in the GPU docs. Maybe the if condition I
changed should be modified to whitelist formats rather than blacklist.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBAgAGBQJU/cm9AAoJEN0/YqbEcdMwBrcP/j+hTku7yI7rzCs8VAt0utRv
nJvDpcO39ydpIEY7NedzVs5mwPbOqfRHHCqmSkumiuhGFnhYEte3Ywwez9RgHvKG
ZzJmlGTiL9WESB3CyBWU7xYiKPlgu7xpP8X6OhtZas86RylCOHb1ahCitQ8JujoX
+26u2K9QP4jH9Xkym73mLlwGCSb6Ymnw0IQOsuUick2kCmCBxWOaXIczwNagILyb
wz+VSwPRUXVXh2eFl/bEgxktB46pxZ5EQx+1P5reb5RQZ/373raqS1yKeB+u5/EM
6h1Jn24xkm5kQV+fqRzAmypG1WIkW6a4u2owmkaviFta6qWqffP9Z4Pjm7sgjpOu
u7G1w30/GNuyb2fuku1SlHBo8CFJPybnacIhASsQGG01OT6z+BxH8CiM/N/d7945
vYpDmV49iBeMpmXDd06H6WKA+8xDO9GDt17+LWBa9qzto8rA2ib1rxkNos9BUhZ8
7xkIxEkRBWBIWTH5ejPZaEvz1Ott/BBffMtb43L7UJFaLdnimKCU0c2s19zuw/ht
NaYoBlqEkW3tdPPqIsF5rnkvO91eONZhdnvFLpbZ/Fj4zAyHkyzPMRRISjvllpJV
XiqldFUlLyfiH1dt6ruDnQVNAKx3CGrMjjuQBW37+gIAthbRuX56mxQHvg+QrGDo
PY6qCecacHJorDMSY/kw
=gsHw
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] r300g: Fix the ATI1N swizzle.

2015-03-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2015-03-09 um 16:53 schrieb Stefan Dösinger:
 I did test if LATC_UNORM and LATC_SNORM still work after my fix. 
 LATC_SNORM is unchanged (broken in the same way as RGTC_SNORM) and 
 LATC_UNORM now has the proper precision like RGTC_UNORM.
I think the reason why _SNORM is broken is that the way the driver
tries to emulate them is conceptually broken. It handles them like the
_UNORM variant, but afterwards does a red = red  0.5 ? red * 2 - 2 :
red * 2.

That may work for an uncompressed signed format, but it doesn't take
into account the block decompression of RGTC1. For example consider a
block that has red1 = 0x7f and red2 = 0x80. As an unsigned value, red2
is the bigger value(127 vs 128). If it is a signed value, red1 is
bigger (127 vs -128). The only way this will work is if the driver
adds +128 to red1 and red2 for each block before loading (sucks if
it's in a PBO) and after sampling does red = red * 2.0 - 1.0. And I'm
not even sure if that will work. It will at least break exact zeros.

Note that I don't care about the signed RGTC formats. Wine on this
card will only ever need the unsigned ones, as they match ATI1N and
ATI2N in d3d.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBAgAGBQJU/cYcAAoJEN0/YqbEcdMwdygQAIlgA+nSg42o/7xAOogeOHeq
IUf/3WKz0GVAhlA+wbli4UoxZgALUHf5PxWgshBvEZZgpzoEYAqpfTVLQm3cUXDd
p3eQkDyGucttgnt1zC5q1jNjkP2io114XRqcTwbMHmMJRfZavzNRK805UBuy1Jd4
sOuxsRT7cTnI+iCkbfqHBdyHo2OSegJ0FDpj35aGzpsc3cDQH9oW/jchryoQJo6V
luf3KvdyP5QQlmglp8I2V28n7uBypwVZywAxKg4jR00IalZXCXt/vj2SFBojDQal
z2Xr9xSz0ccoV+yFutbRwe8wuoUwTBpOFrpnZnx1PQ1RoG34plpgdLg5AVn/t8+A
5UJv5Op51y0KmWqDGadlGV+8RlpdDWCCV6dOdDsOJbrS1/gOJj3Z+VI8rdrrb4Tt
n/eY45OWoF3E0v73aMRLdr220wjgFWcgv7Je16xiER4oSemkCfSsl3kKD7RNy8rS
oNhd6VL18UcefgrssVLptWYI/M7M1Zs6tbtPmh6WIFjFFpikzIjX51UBrIppCIxr
YKZQ0HtML5PJ9JtdHJR6kjqCFKpNO5ZMZtY5HFOuSD+SAu0jnYpTqe/X0etrCy9r
PAKwuCLaOqciqANkhYQBq9quwvv9HwDa9huI0GxSk5xkEd5J4eTqxeKPAURkGx4Y
SBzv2N9WDEDhnGuzYgs9
=8Wzg
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 0/9] Gallium Nine

2014-11-19 Thread Stefan Dösinger

Am 18.11.2014 um 23:31 schrieb Emil Velikov emil.l.veli...@gmail.com:
 Hmm the binaries do not seem to match the source. Am I missing something ?
Not sure. As you can see I've last touched them in January. It is possible that 
I have changed some things in the code and not updated the binaries on the 
server. I recommend to rebuild them yourself anyway, just for the sake of 
paranoia. I use Visual Studio on Windows, and you need the last DirectX SDK for 
the d3dx9 headers and libs, but I guess you can also use mingw with the right 
include and lib paths.

 On of the points in my earlier rant was - if wine is interested solely
 on improvements of the current code, and there is no interest/intensive
 to include an alternative solution it makes no sense to keep on
 pestering you guys.
We're solely interested on the current code until there's conclusive proof that 
running a performant d3d implementation on top of OpenGL is not possible by 
design. So far I have not seen any hard facts to support this claim. Yes, 
nine/st is faster on some drivers/games, but wined3d is faster on others. 
Wined3d with my (not yet upstreamed) CSMT patches beats Windows in a big number 
of games, although it still has performance problems in other games. On the 
Nvidia blob most performance problems with CSMT are not 3D-related any more, 
but are caused by expensive IPC that runs through wineserver.

The factoids so far suggest that the major problems with OpenGL is the 
on-demand shader compilation. That's something we can fix in Wine for the 
average case, although there will still be some corner cases where we have to 
generate a new shader on the fly (e.g. a texture type mismatch, or a flag 
change in Pixel Shader 1.x). Some games don't create the D3D shaders until they 
actually use them. Nvidia has an on-disk shader cache to improve the situation, 
but that's an ugly hack.

The other known problem is uniform updating in GLSL. UBOs may help here. The 
ARB-style environment constants work better for d3d's purposes than GLSL's 
per-shader uniforms.

I expect that there are more problems, most of them limited in nature and 
affecting only some games. That could be things like D3D shader instruction X 
is handled inefficiently by GLSL, or IDirect3DDevice9::ColorFill is slow 
because we have to build a full FBO in GL. Those are just guesses - hard facts 
are needed. nine/st is a good tool to extract such small performance problems 
from real-world games.



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v3 0/9] Gallium Nine

2014-11-18 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2014-11-18 19:36, schrieb Henri Verbeet:
 To clarify, that's not what I said. It's mostly just that I'd like
 to see some actual evidence for the (implicit) claim that the
 performance difference is largely due to inherent OpenGL API
 overhead.
I have some microbenchmarks to measure API overhead of d3d and GL here:


https://stefandoesinger.ddns.net/~git/perftest/
(self-signed cert)
Binaries are here:
https://stefandoesinger.ddns.net/~stefan/pts/

I had a chat with mannerov (I guess he's Axel Davy, according to
/whois) on IRC, and he ran the drawprim and clear tests with gallium
nine, wined3d and GL. His results show pretty much the same result in
gallium nine and wined3d, and the GL result handily beats both of them.

Mannerov says his system doesn't show a big difference in real games
between wined3d and nine, so it would be nice to have more test
results from other people who see a big difference in real-world games.

Those benchmarks would be a first step in pointing out overhead
differences between nine and wined3d and give some hints where they
are. The GL result should show if the difference is due to overhead
inside wined3d or the Mesa GL frontend.

Obviously more tests are needed. The tests so far just cover plain
draws, stream source changes, clears and vertex buffer uploads. I
suspect that a major source of overhead are shader changes and / or
shader constant / uniform changes. And so far all of those tests only
cover CPU-side performance problems.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJUa7hjAAoJEN0/YqbEcdMwdoAP/1F9PL1VFbQcRnhBcv6sb1tp
6+R0Yx63U1f3OVfDmQ2qtgIq0Tj27G4KyfDRrNeHYygYxMGiWJm4ksHmb1E25WND
7TXLvcOdb5ZyFX9I1JPLR/fmA112DB/OzxYdvfCeLn2dS7zk7pvZ73Bz/NfugI6/
+k4GpP3/X9oGvcdy6JAMZ5SX7/7i3aFom0Ak2C+4vhKtdN/gslxitweH6DbkIT6g
ogKTakj+sHV+dYHXwzpCMa3w1ZRK3A4VDRrVbJ/dXUOr+li774dlQaMQE3t7tjDK
3ax2sH7VcF4kCQnc3eocHDKAH8tjAffRWxLxW5F94AlPb14p9BAUCkvYGkb+KEfR
DH4JIX5aJXSvNPLHLjQwDhvhbC2cEr8iMTCerHJllVJjROeXEbvsukj0rkMPAgjP
aicp0fMQyS84GTKj0mwJ2fWZ/ja/UeZwOQv+4rj5adpv7X+pDm9C89dL0mOPWRn/
o73ObJkiAVR0XMqnUfAK5CEziLA985Hg8Fen1hGC221GVpwj+QMQp4dMRJkrLR17
BZgjv18TR40yQLPKGeNv+JbJVdbvZ4XzE0tAWuFpaefBOp2txt26P0KCz2iS58+H
zOa6FxYDC5nMRIWqI4zCF4sKDz5JD0ymn8aYIgWubFEevwyzt7Ql2EACq62S4aYD
N4Xb+Rjk0fu3ihPJiTuz
=qxzo
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Direct3D 9 state tracker

2013-07-22 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2013-07-22 15:39, schrieb Jose Fonseca:
 It seems to me that this would be more useful if the state tracker
 targeted not the D3D9 API, but the WDDM D3D9 DDI [2].  Targeting
 the DDI would allow, e.g., to share more code with rest of WINE
 (the API-DDI runtime layer);
Fwiw, Wine does not use Microsoft's DDI in any way. We use our own
interface to abstract between d3d versions, which is a mix of d3d9 and
d3d10, with some ddraw-specific extras.

Our main d3d module (wined3d.dll) has some internal abstraction layers
for shader translation and fixed function pipeline implementations.
Right now we have implementations based on GLSL, ARB_program,
ATI_fragment_shader, NV_texture_shader and ARB_texture_env_combine, as
well as code to handle OpenGL fixed function vertex processing. Adding
a gallium-based backend should be a relatively easy challenge. The
bigger problem would be resource creation and loading (buffers,
textures) because there's no abstraction for that yet.

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJR7WJyAAoJEN0/YqbEcdMwjVcP/ihUVZd66dRr2X8f49j23muX
biuF1KbcFsB1+LeTtH50iuDn8gdnPiTJWdrwju3wfs4IRsmA8IfQSxeBElIuEyEZ
o+2keEmsR9/aDZvI4uilfzVmtcaNzCZWnzKkVOctDHaxVaW52fH2OaB01weQXL/r
gT5dMFhkVc8vN6BFiawrnvZDArewIFa8XDBhdyz7tWpamel8UF922otBzrVDoK0o
pFQqcZLrdvtCSVq5uHVzKqc/jRP2FuNCVlvKrrwTrjWIO/q3F5oB0SJDUXd8xp1K
zJRSVB1U4MzVRE5jf5X+s+nMrsLEME0DBQCNYtsh3veLFDS98UCkoWDAGC7IPgrX
0zfeXITeq6dm0CvN7cGUFCmm+GO+vlwRTsFiAmAp5tvhOBIcyUTPO36LBcxMxtQQ
p+KubboWMCDTPWnidPh3LpbXE+y2JVfsfpviVykRdNAgxiI28lcVuHMSkyLahQ9s
fbLGc4fR+WbGwBVAkWE9HZ3y9kr3O+aUK+m70d7mwYEwV0ZhJEGRZibLnK2JHHNf
B0NJJ9YmU64LmDOfUGzHU4rhbQfURk6SSh+ys3+iNPUSL2iCNGRf4QS01qAeoW0/
RITNPENBWlzQJWgkED2yLp28q/ZB3YCGn92/TpU7IHucd1eZzF+IPY5M+MKRPWXm
JZ1TJlKvmP12YUAXgBNV
=JxrZ
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/6] Eliminating unused built-in varyings

2013-06-20 Thread Stefan Dösinger
Hi,

Am 19.06.2013 um 13:22 schrieb Marek Olšák mar...@gmail.com:

 Could somebody please review this series?
I don't really know the code well enough to give a meaningful review, but I've 
tested the patches with Wine on r300g and they work as advertised :-) . 
Rendering is OK, and 3DMark2000 performance is improved from 4000 3dmarks to 
7200. (The GL fixed function pipeline gets 8000, but that may be our bug)

Cheers,
Stefan

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


Re: [Mesa-dev] [PATCH] mesa syncobj: don't store a pointer to the set_entry

2012-12-11 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2012-12-11 00:47, schrieb Ian Romanick:
 [  760.187261] [drm:radeon_cs_ib_chunk] *ERROR* Invalid command
 stream ! [  760.192898] radeon :01:00.0: 
 evergreen_cs_track_validate_stencil:602 stencil read bo base 
 4148500480 not aligned with 16384 [  760.192901] radeon
 :01:00.0: evergreen_packet3_check:2098 invalid cmd stream
 2440
 
 It sounds like you should rebase Jordan's original patches out and 
 bisect.  It would be nice to know when things started going wrong.
 That usually makes the fix obvious.

It was a case of PEBKAC - I had an outdated libdrm and inadvertently
made configure accept it.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJQxyP3AAoJEN0/YqbEcdMwjLcP/RwyNoCRKFFFVM46P+AwTFNP
0bQ3paJ0IluZUoeLe1Ihpl1PlmkoD//ZUFPlNamUKK85bNpE3gdDbJ7VbUJagW/b
Xc0xYfssBbL6AGWxKO/+vvPH1T2pTEeFWB7Dw24truL0ORl7bx7Ovr7cCuX4SGnC
TOvtyaX9FSSwbBnr6eyanEahlszTa5tIbtMumX9OJT+MDlNLxkgQjE5LL2zqXRZi
7moSBUNyELVKa4i0Yb9A9Tp0GXJBoZ328z5iBP7I5LKOZek245zzVWPkFQ11eTmV
Hz5HVXvoVeDfhxY4pJSi73DjPcwEUHu3YJ8iDSjvpTe+N0Uj9Wud7by75y9WE2MI
NI3nB4G0dP05dvps9MZXJnlvbejEMKinIb6jqCJ85wT+5H75CRyKUyXrZVfD5vfb
F5UXJZEaMLt5fGV+T5NnZRMjC+PjMamovsaV5aT+pyfdZg+2U3cTCJQxEDCVkBpb
hxolLm+PyR3o/fYED/82SiWkmY1wpAPCrOdp5AiPfheq6+anm+In0jThv7xygG0u
isge3WQEKu8UxwZhFo4wPQkfHoSac1VX/wO036YvWQTnLpxTvGDRWGu225KPqVCx
gxVj0Qzi90YjaiFSlHnPje+pSrvVyRUiGBIjDc/VRtLHlmy+0hrryGBGwp04U7M2
83AMyMmi/FRzB+GsVpoJ
=sulN
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] mesa syncobj: don't store a pointer to the set_entry

2012-12-09 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 2012-12-08 22:24, schrieb Jordan Justen:
 This likely will fix 
 https://bugs.freedesktop.org/show_bug.cgi?id=58012 (Regression
 since 56e95d3c)
The crashes are gone on r300g and r600g.

This is most likely unrelated, but on r600g I get broken rendering in
Half Life 2 (just random garbage on the screen). I'm sure it doesn't
crash though because I don't see the debugger kicking in, and hl2
terminates properly after the timedemo. There are complaints about
commands rejected by the kernel:


[  760.187261] [drm:radeon_cs_ib_chunk] *ERROR* Invalid command stream !
[  760.192898] radeon :01:00.0:
evergreen_cs_track_validate_stencil:602 stencil read bo base
4148500480 not aligned with 16384
[  760.192901] radeon :01:00.0: evergreen_packet3_check:2098
invalid cmd stream 2440

Note that I don't know when this started - I haven't updated Mesa on
that box for weeks.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJQxM6bAAoJEN0/YqbEcdMw58oP/RVTIfaNufKv+//AuUcoUSLt
2huxKsU3DoQojrGgMdMIP6MZBRwmbQ0i3IVMGNPrDNBpy0c5FgJRP6XIKUl8mF5t
CC4u8NWV1q6zf3F6eMlNCp4EfRVLPViUVA8rZjSSbHshhenio2ftoZgQDxTPyPnX
FOkVNerBUMhE6yqa5QLu+qGuciJprzq/AUH8IiHlFIOgHfs/mAaTcrWlY6c4ZNaH
op5/PxsXrXlmu32x6tjOMQYz+i8FEb6enClMdz81v8ek1bv2IzSLaT5i6La2flKI
TApuonDYfIYmC7u8q+uumPVK5PcwrpVEYGhTjCSM8bvREgRXDIEn3ekmCyiHxAFt
zGY1sO4Wmf4Po5VD/GMNOYPDMNcdgCk5oZwcJzzRXPn71eiJimQkGNao0Dnmd0dq
bxLbz+KJxAQJaX6rNjO1/uCey0xfQ8IVf9IIoCCxINW1vZRV5p76L3cD1HqQt8wU
YrADeNf9wB1qSAtH0Ybhlf+VPA/7kJbatwSpSuNKEohZVLfZal/1YEQj1An5POj+
FSg07RDuyJVBE8HQksnqQie2K58wGvrTKvwCr9/P98z2sD2xjEen8o1fGWYN7+p+
1327o97Yc7umnz1BbbG6fd/YSVQ7E5wpcrUpgTLHTAcr+B2cPLB5TTGMGcuL52M2
hKknDGGOMWZZLxvN7e92
=+BNj
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] r300: Don't disable destination read if the src blend factor needs it

2012-12-07 Thread Stefan Dösinger
The read can remain disabled if the src alpha factor needs it because
the result would still be zero.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57984

NOTE: This is a candidate for stable release branches.
---
 src/gallium/drivers/r300/r300_state.c |   12 ++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index fba2d35..050c8f4 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -288,7 +288,11 @@ static void* r300_create_blend_state(struct pipe_context* 
pipe,
  dstRGB == PIPE_BLENDFACTOR_ZERO) 
 (dstA == PIPE_BLENDFACTOR_SRC_COLOR ||
  dstA == PIPE_BLENDFACTOR_SRC_ALPHA ||
- dstA == PIPE_BLENDFACTOR_ZERO)) {
+ dstA == PIPE_BLENDFACTOR_ZERO) 
+(srcRGB != PIPE_BLENDFACTOR_DST_COLOR 
+ srcRGB != PIPE_BLENDFACTOR_DST_ALPHA 
+ srcRGB != PIPE_BLENDFACTOR_INV_DST_COLOR 
+ srcRGB != PIPE_BLENDFACTOR_INV_DST_ALPHA)) {
  blend_control |= R500_SRC_ALPHA_0_NO_READ;
 }
 
@@ -297,7 +301,11 @@ static void* r300_create_blend_state(struct pipe_context* 
pipe,
  dstRGB == PIPE_BLENDFACTOR_ZERO) 
 (dstA == PIPE_BLENDFACTOR_INV_SRC_COLOR ||
  dstA == PIPE_BLENDFACTOR_INV_SRC_ALPHA ||
- dstA == PIPE_BLENDFACTOR_ZERO)) {
+ dstA == PIPE_BLENDFACTOR_ZERO) 
+(srcRGB != PIPE_BLENDFACTOR_DST_COLOR 
+ srcRGB != PIPE_BLENDFACTOR_DST_ALPHA 
+ srcRGB != PIPE_BLENDFACTOR_INV_DST_COLOR 
+ srcRGB != PIPE_BLENDFACTOR_INV_DST_ALPHA)) {
  blend_control |= R500_SRC_ALPHA_1_NO_READ;
 }
 }
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 1/4] r200: Initialize swrast before setting limits

2012-12-06 Thread Stefan Dösinger
Otherwise the driver announces 4096 vertex shader constants and other
way too high limits.

NOTE: This is a candidate for stable release branches.
---
 src/mesa/drivers/dri/r200/r200_context.c |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_context.c 
b/src/mesa/drivers/dri/r200/r200_context.c
index 360ba72..54cf33e 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -289,13 +289,20 @@ GLboolean r200CreateContext( gl_api api,
rmesa-radeon.swtcl.RenderIndex = ~0;
rmesa-radeon.hw.all_dirty = 1;
 
+   ctx = rmesa-radeon.glCtx;
+   /* Initialize the software rasterizer and helper modules.
+*/
+   _swrast_CreateContext( ctx );
+   _vbo_CreateContext( ctx );
+   _tnl_CreateContext( ctx );
+   _swsetup_CreateContext( ctx );
+   _ae_create_context( ctx );
+
/* Set the maximum texture size small enough that we can guarentee that
 * all texture units can bind a maximal texture and have all of them in
 * texturable memory at once. Depending on the allow_large_textures driconf
 * setting allow larger textures.
 */
-
-   ctx = rmesa-radeon.glCtx;
ctx-Const.MaxTextureUnits = driQueryOptioni (rmesa-radeon.optionCache,
 texture_units);
ctx-Const.MaxTextureImageUnits = ctx-Const.MaxTextureUnits;
@@ -345,14 +352,6 @@ GLboolean r200CreateContext( gl_api api,
 
_mesa_set_mvp_with_dp4( ctx, GL_TRUE );
 
-   /* Initialize the software rasterizer and helper modules.
-*/
-   _swrast_CreateContext( ctx );
-   _vbo_CreateContext( ctx );
-   _tnl_CreateContext( ctx );
-   _swsetup_CreateContext( ctx );
-   _ae_create_context( ctx );
-
/* Install the customized pipeline:
 */
_tnl_destroy_pipeline( ctx );
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 2/4] radeon: Initialize swrast before setting limits

2012-12-06 Thread Stefan Dösinger
NOTE: This is a candidate for stable release branches.
---
 src/mesa/drivers/dri/radeon/radeon_context.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c 
b/src/mesa/drivers/dri/radeon/radeon_context.c
index 1e0da0b..d29e146 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -251,13 +251,21 @@ r100CreateContext( gl_api api,
rmesa-radeon.swtcl.RenderIndex = ~0;
rmesa-radeon.hw.all_dirty = GL_TRUE;
 
+   ctx = rmesa-radeon.glCtx;
+   /* Initialize the software rasterizer and helper modules.
+*/
+   _swrast_CreateContext( ctx );
+   _vbo_CreateContext( ctx );
+   _tnl_CreateContext( ctx );
+   _swsetup_CreateContext( ctx );
+   _ae_create_context( ctx );
+
/* Set the maximum texture size small enough that we can guarentee that
 * all texture units can bind a maximal texture and have all of them in
 * texturable memory at once. Depending on the allow_large_textures driconf
 * setting allow larger textures.
 */
 
-   ctx = rmesa-radeon.glCtx;
ctx-Const.MaxTextureUnits = driQueryOptioni (rmesa-radeon.optionCache,
 texture_units);
ctx-Const.MaxTextureImageUnits = ctx-Const.MaxTextureUnits;
@@ -307,14 +315,6 @@ r100CreateContext( gl_api api,
 
_mesa_set_mvp_with_dp4( ctx, GL_TRUE );
 
-   /* Initialize the software rasterizer and helper modules.
-*/
-   _swrast_CreateContext( ctx );
-   _vbo_CreateContext( ctx );
-   _tnl_CreateContext( ctx );
-   _swsetup_CreateContext( ctx );
-   _ae_create_context( ctx );
-
/* Install the customized pipeline:
 */
_tnl_destroy_pipeline( ctx );
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 3/4] meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER

2012-12-06 Thread Stefan Dösinger
Fixes clears in Wine on r200.

NOTE: This is a candidate for stable release branches.
---
 src/mesa/drivers/common/meta.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index d5e8af3..ad21fa8 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -133,6 +133,7 @@ struct save_state
struct gl_vertex_program *VertexProgram;
GLboolean FragmentProgramEnabled;
struct gl_fragment_program *FragmentProgram;
+   GLboolean ATIFragmentShaderEnabled;
struct gl_shader_program *VertexShader;
struct gl_shader_program *GeometryShader;
struct gl_shader_program *FragmentShader;
@@ -594,6 +595,11 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
  _mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_FALSE);
   }
 
+  if (ctx-API == API_OPENGL_COMPAT  
ctx-Extensions.ATI_fragment_shader) {
+ save-ATIFragmentShaderEnabled = ctx-ATIFragmentShader.Enabled;
+ _mesa_set_enable(ctx, GL_FRAGMENT_SHADER_ATI, GL_FALSE);
+  }
+
   if (ctx-Extensions.ARB_shader_objects) {
 _mesa_reference_shader_program(ctx, save-VertexShader,
ctx-Shader.CurrentVertexProgram);
@@ -914,6 +920,11 @@ _mesa_meta_end(struct gl_context *ctx)
 _mesa_reference_fragprog(ctx, save-FragmentProgram, NULL);
   }
 
+  if (ctx-API == API_OPENGL_COMPAT  
ctx-Extensions.ATI_fragment_shader) {
+ _mesa_set_enable(ctx, GL_FRAGMENT_SHADER_ATI,
+  save-ATIFragmentShaderEnabled);
+  }
+
   if (ctx-Extensions.ARB_vertex_shader)
 _mesa_use_shader_program(ctx, GL_VERTEX_SHADER, save-VertexShader);
 
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 4/4] r300g: Remove an incorrect comment

2012-12-06 Thread Stefan Dösinger
This occurred because I started this patch by reverting another patch and
forgot to remove it.
---
 src/gallium/drivers/r300/r300_screen.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_screen.c 
b/src/gallium/drivers/r300/r300_screen.c
index de5e4a1..8cb1406 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -105,7 +105,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum 
pipe_cap param)
 case PIPE_CAP_VERTEX_COLOR_CLAMPED:
 case PIPE_CAP_USER_INDEX_BUFFERS:
 case PIPE_CAP_USER_CONSTANT_BUFFERS:
-case PIPE_CAP_DEPTH_CLIP_DISABLE: /* XXX implemented, but breaks 
Regnum Online */
+case PIPE_CAP_DEPTH_CLIP_DISABLE:
 return 1;
 
 case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 1/2] meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER

2012-12-05 Thread Stefan Dösinger

From b882d9e08932198e243b9cbb534d01d547661f86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= stefandoesin...@gmx.at
Date: Mon, 3 Dec 2012 11:03:26 +0100
Subject: [PATCH 1/4] meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER

Fixes clears in Wine on r200.
---
 src/mesa/drivers/common/meta.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index d5e8af3..ad21fa8 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -133,6 +133,7 @@ struct save_state
struct gl_vertex_program *VertexProgram;
GLboolean FragmentProgramEnabled;
struct gl_fragment_program *FragmentProgram;
+   GLboolean ATIFragmentShaderEnabled;
struct gl_shader_program *VertexShader;
struct gl_shader_program *GeometryShader;
struct gl_shader_program *FragmentShader;
@@ -594,6 +595,11 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
  _mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_FALSE);
   }
 
+  if (ctx-API == API_OPENGL_COMPAT  ctx-Extensions.ATI_fragment_shader) {
+ save-ATIFragmentShaderEnabled = ctx-ATIFragmentShader.Enabled;
+ _mesa_set_enable(ctx, GL_FRAGMENT_SHADER_ATI, GL_FALSE);
+  }
+
   if (ctx-Extensions.ARB_shader_objects) {
 	 _mesa_reference_shader_program(ctx, save-VertexShader,
 	ctx-Shader.CurrentVertexProgram);
@@ -914,6 +920,11 @@ _mesa_meta_end(struct gl_context *ctx)
 	 _mesa_reference_fragprog(ctx, save-FragmentProgram, NULL);
   }
 
+  if (ctx-API == API_OPENGL_COMPAT  ctx-Extensions.ATI_fragment_shader) {
+ _mesa_set_enable(ctx, GL_FRAGMENT_SHADER_ATI,
+  save-ATIFragmentShaderEnabled);
+  }
+
   if (ctx-Extensions.ARB_vertex_shader)
 	 _mesa_use_shader_program(ctx, GL_VERTEX_SHADER, save-VertexShader);
 
-- 
1.7.8.6

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


[Mesa-dev] [PATCH 2/2] r200: Initialize swrast before setting limits

2012-12-05 Thread Stefan Dösinger

From f572545ee0e2e17322554f03409237e40c732d1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= stefandoesin...@gmx.at
Date: Mon, 3 Dec 2012 14:31:23 +0100
Subject: [PATCH 2/4] r200: Initialize swrast before setting limits

Otherwise the driver announces 4096 vertex shader constants and other
way too high limits.
---
 src/mesa/drivers/dri/r200/r200_context.c |   19 +--
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 360ba72..54cf33e 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -289,13 +289,20 @@ GLboolean r200CreateContext( gl_api api,
rmesa-radeon.swtcl.RenderIndex = ~0;
rmesa-radeon.hw.all_dirty = 1;
 
+   ctx = rmesa-radeon.glCtx;
+   /* Initialize the software rasterizer and helper modules.
+*/
+   _swrast_CreateContext( ctx );
+   _vbo_CreateContext( ctx );
+   _tnl_CreateContext( ctx );
+   _swsetup_CreateContext( ctx );
+   _ae_create_context( ctx );
+
/* Set the maximum texture size small enough that we can guarentee that
 * all texture units can bind a maximal texture and have all of them in
 * texturable memory at once. Depending on the allow_large_textures driconf
 * setting allow larger textures.
 */
-
-   ctx = rmesa-radeon.glCtx;
ctx-Const.MaxTextureUnits = driQueryOptioni (rmesa-radeon.optionCache,
 		 texture_units);
ctx-Const.MaxTextureImageUnits = ctx-Const.MaxTextureUnits;
@@ -345,14 +352,6 @@ GLboolean r200CreateContext( gl_api api,
 
_mesa_set_mvp_with_dp4( ctx, GL_TRUE );
 
-   /* Initialize the software rasterizer and helper modules.
-*/
-   _swrast_CreateContext( ctx );
-   _vbo_CreateContext( ctx );
-   _tnl_CreateContext( ctx );
-   _swsetup_CreateContext( ctx );
-   _ae_create_context( ctx );
-
/* Install the customized pipeline:
 */
_tnl_destroy_pipeline( ctx );
-- 
1.7.8.6

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


Re: [Mesa-dev] [PATCH 2/2] r200: Initialize swrast before setting limits

2012-12-05 Thread Stefan Dösinger
On 12/05/12 15:23, Alex Deucher wrote:
 Also, should probably also make a note to apply this to the stable
 branches.  While you are at it can you also check and see if radeon
 needs a similar fix?
From the code it looks like it needs a similar fix. I don't have a
pre-r250 card though so I can't test to be sure.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev