[Mesa-dev] [PATCH] util: Only use open coded snprintf for MSVC.

2012-11-14 Thread Vinson Lee
MinGW has snprintf.

The patch fixes these warnings with the MinGW SCons build.

src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype 
for ‘util_vsnprintf’ [-Wmissing-prototypes]
src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype 
for ‘util_snprintf’ [-Wmissing-prototypes]

Signed-off-by: Vinson Lee 
---
 src/gallium/auxiliary/util/u_snprintf.c |2 +-
 src/gallium/auxiliary/util/u_string.h   |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_snprintf.c 
b/src/gallium/auxiliary/util/u_snprintf.c
index e16f103..a24b6ff 100644
--- a/src/gallium/auxiliary/util/u_snprintf.c
+++ b/src/gallium/auxiliary/util/u_snprintf.c
@@ -167,7 +167,7 @@
 #if HAVE_CONFIG_H
 #include 
 #else
-#ifdef _WIN32
+#ifdef _MSC_VER
 #define vsnprintf util_vsnprintf
 #define snprintf util_snprintf
 #define HAVE_VSNPRINTF 0
diff --git a/src/gallium/auxiliary/util/u_string.h 
b/src/gallium/auxiliary/util/u_string.h
index 15630ad..3d5aba5 100644
--- a/src/gallium/auxiliary/util/u_string.h
+++ b/src/gallium/auxiliary/util/u_string.h
@@ -35,7 +35,7 @@
 #ifndef U_STRING_H_
 #define U_STRING_H_
 
-#if !defined(_WIN32) && !defined(XF86_LIBC_H)
+#if !defined(_MSC_VER)
 #include 
 #endif
 #include 
@@ -64,7 +64,7 @@ util_strchrnul(const char *s, char c)
 
 #endif
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 
 int util_vsnprintf(char *, size_t, const char *, va_list);
 int util_snprintf(char *str, size_t size, const char *format, ...);
-- 
1.7.10.4

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


[Mesa-dev] [PATCH] i965/fs: Properly patch special values during VGRF compaction.

2012-11-14 Thread Kenneth Graunke
In addition to registers used by instructions, fs_visitor maintains
direct references to certain "special" values used for inputs/outputs.

When I added VGRF compaction, I overlooked these, believing that these
direct references weren't used once instructions were generated.  That
was wrong.  For example, pixel_x/y are used in virtual_grf_interferes(),
which is called by optimization passes and register allocation.

This patch treats all of them as used and patches them after compacting.
While it's not strictly necessary to patch all of them (as some aren't
used after emitting code), it seems safer to simply fix them all.

Fixes oglconform's textureswizzle/advanced.shader.targets, piglit's
glsl-fs-lots-of-tex, and glean's texCombine on pre-Gen6 hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56790
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index dc2e5a6..fb772bc 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1130,6 +1130,27 @@ fs_visitor::compact_virtual_grfs()
   }
}
 
+   /* In addition to registers used in instructions, fs_visitor keeps
+* direct references to certain special values which must be patched:
+*/
+   fs_reg *special[] = {
+  &frag_depth, &pixel_x, &pixel_y, &pixel_w, &wpos_w, &dual_src_output,
+  &outputs[0], &outputs[1], &outputs[2], &outputs[3],
+  &outputs[4], &outputs[5], &outputs[6], &outputs[7],
+  &delta_x[0], &delta_x[1], &delta_x[2],
+  &delta_x[3], &delta_x[4], &delta_x[5],
+  &delta_y[0], &delta_y[1], &delta_y[2],
+  &delta_y[3], &delta_y[4], &delta_y[5],
+   };
+   STATIC_ASSERT(BRW_WM_BARYCENTRIC_INTERP_MODE_COUNT == 6);
+   STATIC_ASSERT(BRW_MAX_DRAW_BUFFERS == 8);
+
+   /* Treat all special values as used, to be conservative */
+   for (unsigned i = 0; i < ARRAY_SIZE(special); i++) {
+  if (special[i]->file == GRF)
+remap_table[special[i]->reg] = 0;
+   }
+
/* Compact the GRF arrays. */
int new_index = 0;
for (int i = 0; i < this->virtual_grf_count; i++) {
@@ -1158,6 +1179,12 @@ fs_visitor::compact_virtual_grfs()
 inst->src[i].reg = remap_table[inst->src[i].reg];
   }
}
+
+   /* Patch all the references to special values */
+   for (unsigned i = 0; i < ARRAY_SIZE(special); i++) {
+  if (special[i]->file == GRF && remap_table[special[i]->reg] != -1)
+special[i]->reg = remap_table[special[i]->reg];
+   }
 }
 
 bool
-- 
1.8.0

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


[Mesa-dev] [PATCH 2/2] glx/dri2: implement new extension for throttling and asynchronous flushing

2012-11-14 Thread Marek Olšák
and allow thread offloading for dri2SwapBuffers.

The extension takes care of throttling, drawable flushing and
GL context flushing (no need to do glFlush), and allows thread offloading
xcb_dri2_swap_buffers. The driver has to implement the offloading, libGL
only gives it the pointer to the swap function.
---
 include/GL/internal/dri_interface.h |   62 ++
 src/glx/dri2_glx.c  |  234 +++
 2 files changed, 243 insertions(+), 53 deletions(-)

diff --git a/include/GL/internal/dri_interface.h 
b/include/GL/internal/dri_interface.h
index 1e0f1d0..3667a1a 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -85,6 +85,7 @@ typedef struct __DRIdri2ExtensionRec  
__DRIdri2Extension;
 typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
 typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
 typedef struct __DRI2throttleExtensionRec  __DRI2throttleExtension;
+typedef struct __DRI2asyncFlushExtensionRec__DRI2asyncFlushExtension;
 
 /*@}*/
 
@@ -305,6 +306,67 @@ struct __DRI2throttleExtensionRec {
enum __DRI2throttleReason reason);
 };
 
+
+/**
+ * Optional feature for drivers that implement DRI2
+ */
+#define __DRI2_ASYNC_FLUSH "DRI2_AsyncFlush"
+#define __DRI2_ASYNC_FLUSH_VERSION 1
+
+#define __DRI2_FLUSH_DRAWABLE (1 << 0) /* the drawable should be flushed. */
+#define __DRI2_FLUSH_CONTEXT  (1 << 1) /* glFlush should be called */
+#define __DRI2_FLUSH_ASYNC(1 << 2) /* thread offloading is allowed */
+
+struct __DRI2asyncFlushExtensionRec {
+__DRIextension base;
+
+/**
+ * Initiate a synchronous or asynchronous drawable+context flush
+ * and throttle the rendering.
+ *
+ * This function is also recommended for synchronous flushing, because
+ * it helps reduce the number of flushes in the driver by combining
+ * several operations into one call.
+ *
+ * The flag __DRI2_FLUSH_ASYNC tells the driver it can offload the flush
+ * to some other thread and return immediately.
+ *
+ * Rules for thread offloading:
+ * - The throttling shouldn't offloaded.
+ * - For each context, there can only be one flush in-progress at a time.
+ *   Any new flush must wait until the previous one is finished, so that
+ *   the flushes are executed in order.
+ * - If any GL rendering commands are flushed, the context must wait until
+ *   the previous flush is finished.
+ *
+ * The 'finish' parameter allows to set a callback function, that is
+ * executed after the flush is finished (e.g. SwapBuffers).
+ *
+ * \param context   the context
+ * \param drawable  the drawable to flush
+ * \param flags a combination of _DRI2_FLUSH_xxx flags
+ * \param throttle_reason   the reason for throttling, 0 = no throttling
+ * \param finishthe function to call after the offloaded work
+ *  is done, it can be NULL if nothing needs to
+ *  be done, used with __DRI2_FLUSH_ASYNC
+ * \param finish_ptrthe parameter to the finish function
+ */
+void (*flush)(__DRIcontext *ctx,
+  __DRIdrawable *drawable,
+  unsigned flags,
+  enum __DRI2throttleReason throttle_reason,
+  void (*finish)(void *user_ptr),
+  void *finish_ptr);
+
+/**
+ * If the last flush was asynchronous, wait until the flush is finished.
+ *
+ * \param ctx  the context
+ */
+void (*sync)(__DRIcontext *ctx);
+};
+
+
 /**
  * XML document describing the configuration options supported by the
  * driver.
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index f469431..1f5807f 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -87,6 +87,7 @@ struct dri2_screen {
const __DRIcoreExtension *core;
 
const __DRI2flushExtension *f;
+   const __DRI2asyncFlushExtension *async_flush;
const __DRI2configQueryExtension *config;
const __DRItexBufferExtension *texBuffer;
const __DRI2throttleExtension *throttle;
@@ -96,6 +97,10 @@ struct dri2_screen {
int fd;
 
Bool show_fps;
+   Bool no_async_flush;
+
+   Display *second_dpy; /* for thread offloading */
+   pthread_mutex_t second_dpy_mutex;
 };
 
 struct dri2_context
@@ -143,6 +148,11 @@ dri2_destroy_context(struct glx_context *context)
struct dri2_context *pcp = (struct dri2_context *) context;
struct dri2_screen *psc = (struct dri2_screen *) context->psc;
 
+   /* Synchronize the flushing before destroying the drawables. */
+   if (psc->async_flush) {
+  psc->async_flush->sync(pcp->driContext);
+   }
+
driReleaseDrawables(&pcp->base);
 
free((char *) context->extensions);
@@ -509,6 +519,15 @@ dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t 
target_sbc, int64_t *ust,
return 1;
 }
 
+static __DRIcontext *
+dri2GetCurr

[Mesa-dev] [PATCH 1/2] glx: move the glFlush call one layer down

2012-11-14 Thread Marek Olšák
---
 src/glx/dri2_glx.c  |6 +-
 src/glx/dri_glx.c   |6 +-
 src/glx/drisw_glx.c |7 ++-
 src/glx/glxclient.h |2 +-
 src/glx/glxcmds.c   |8 +++-
 5 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 12b3026..f469431 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -731,7 +731,7 @@ static void show_fps(struct dri2_drawable *draw)
 
 static int64_t
 dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
-   int64_t remainder)
+   int64_t remainder, Bool flush)
 {
 struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
 struct glx_display *dpyPriv = __glXInitialize(priv->base.psc->dpy);
@@ -740,6 +740,10 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t 
target_msc, int64_t divisor,
(struct dri2_display *)dpyPriv->dri2Display;
 CARD64 ret = 0;
 
+if (flush) {
+   glFlush();
+}
+
 /* Check we have the right attachments */
 if (!priv->have_back)
return ret;
diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c
index de777fb..07f9a00 100644
--- a/src/glx/dri_glx.c
+++ b/src/glx/dri_glx.c
@@ -684,11 +684,15 @@ driCreateDrawable(struct glx_screen *base,
 
 static int64_t
 driSwapBuffers(__GLXDRIdrawable * pdraw, int64_t unused1, int64_t unused2,
-  int64_t unused3)
+  int64_t unused3, Bool flush)
 {
struct dri_screen *psc = (struct dri_screen *) pdraw->psc;
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
 
+   if (flush) {
+  glFlush();
+   }
+
(*psc->core->swapBuffers) (pdp->driDrawable);
return 0;
 }
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 014296b..832e964 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -551,7 +551,8 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
 
 static int64_t
 driswSwapBuffers(__GLXDRIdrawable * pdraw,
- int64_t target_msc, int64_t divisor, int64_t remainder)
+ int64_t target_msc, int64_t divisor, int64_t remainder,
+ Bool flush)
 {
struct drisw_drawable *pdp = (struct drisw_drawable *) pdraw;
struct drisw_screen *psc = (struct drisw_screen *) pdp->base.psc;
@@ -560,6 +561,10 @@ driswSwapBuffers(__GLXDRIdrawable * pdraw,
(void) divisor;
(void) remainder;
 
+   if (flush) {
+  glFlush();
+   }
+
(*psc->core->swapBuffers) (pdp->driDrawable);
 
return 0;
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index e4adedd..a238749 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -113,7 +113,7 @@ struct __GLXDRIscreenRec {
   struct glx_config *config);
 
int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc,
- int64_t divisor, int64_t remainder);
+ int64_t divisor, int64_t remainder, Bool flush);
void (*copySubBuffer)(__GLXDRIdrawable *pdraw,
 int x, int y, int width, int height);
int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 394bf59..265a9a8 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -781,11 +781,9 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
   __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
 
   if (pdraw != NULL) {
- if (gc && drawable == gc->currentDrawable) {
-glFlush();
- }
+ Bool flush = gc && drawable == gc->currentDrawable;
 
- (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0);
+ (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0, flush);
  return;
   }
}
@@ -2171,7 +2169,7 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable 
drawable,
 #ifdef GLX_DIRECT_RENDERING
if (psc->driScreen && psc->driScreen->swapBuffers)
   return (*psc->driScreen->swapBuffers)(pdraw, target_msc, divisor,
-   remainder);
+   remainder, False);
 #endif
 
return -1;
-- 
1.7.9.5

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


[Mesa-dev] [PATCH 0/2] First attempt at asynchronous SwapBuffers

2012-11-14 Thread Marek Olšák
Hi,

this series adds a new DRI2 extension to the libGL-Mesa interface, which 
consolidates the 3 flushes (glFlush, drawable flush, throttling) into one flush 
call like my previous patch series did, but it also allows thread offloading of 
SwapBuffers.

The motivation for the thread offloading is that it increases performance for 
some CPU-bound games (e.g. openarena) and the fact that the radeon gallium 
driver can already offload a context flush, which hides *a lot* of kernel 
overhead and is the main reason behind all this (the swap must be done in the 
driver thread for the offloading to work). Last but not least, we can use the 
extension for better thread offloading of OpenGL or Gallium (or both).

The idea is that the swap is performed in the driver-private thread. libGL only 
tells the driver it can offload the flush and sets a callback function, which 
swaps buffers and is called in the driver-private thread after flushing is 
finished. By the time the buffers are swapped, some GL commands for the next 
frame might have already been executed. The driver has to make sure that any 
new rendering won't get ahead of the swapping.

For the asynchronous SwapBuffers to work, there must be a separate X 
connection, because Xlib isn't thread-safe at all.

Now the bad news. The DRI invalidate events may be received too late. We can't 
wait for the events in glXSwapBuffers, because that would defeat the whole 
purpose of thread offloading. For normal apps, that only happens when the 
window is resized, so only the next rendered frame is likely to contain garbage.

Compositors don't work very well with this. I think it's because of the 
invalidate events not being received in time. As a temporary solution, I turn 
off asynchronous SwapBuffers if dri2_bind_tex_image is called, which should 
cover all compositors that either directly or indirectly use GLX.

I am open to suggestions how to resolve the last issue in a cleaner way. There 
are no piglit regressions and all apps seem to work. I'll send patches for 
gallium if we agree that this is a good idea.

Please review.

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


[Mesa-dev] [PATCH] i965/fs: Don't calculate_live_intervals() in opt_algebraic().

2012-11-14 Thread Kenneth Graunke
There's no point: opt_algebraic() doesn't use any liveness information.

Signed-off-by: Kenneth Graunke 
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp 
b/src/mesa/drivers/dri/i965/brw_fs.cpp
index dc2e5a6..f25fd16 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1311,8 +1311,6 @@ fs_visitor::opt_algebraic()
 {
bool progress = false;
 
-   calculate_live_intervals();
-
foreach_list(node, &this->instructions) {
   fs_inst *inst = (fs_inst *)node;
 
-- 
1.8.0

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


Re: [Mesa-dev] [PATCH] glcpp: Don't define macros for extensions that aren't in ES

2012-11-14 Thread Matt Turner
On Wed, Nov 14, 2012 at 4:45 PM, Kenneth Graunke  wrote:
> On 11/14/2012 10:34 AM, Matt Turner wrote:
>>
>> Fixes 54 gles3conform tests.
>> ---
>>   src/glsl/glcpp/glcpp-parse.y |   59
>> +
>>   1 files changed, 30 insertions(+), 29 deletions(-)
>>
>> The changes in whitespace make this patch hard to read. Here it is
>> without whitespace changes:
>>
>> --- a/src/glsl/glcpp/glcpp-parse.y
>> +++ b/src/glsl/glcpp/glcpp-parse.y
>> @@ -1138,13 +1138,13 @@ glcpp_parser_create (const struct gl_extensions
>> *extensions, int api)
>> parser->has_new_source_number = 0;
>> parser->new_source_number = 0;
>>
>> +   if (api == API_OPENGLES2)
>> +   add_builtin_define(parser, "GL_ES", 1);
>> +   else {
>> /* Add pre-defined macros. */
>> add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
>> add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
>>
>> -   if (api == API_OPENGLES2)
>> -   add_builtin_define(parser, "GL_ES", 1);
>> -
>> if (extensions != NULL) {
>>if (extensions->EXT_texture_array) {
>>   add_builtin_define(parser, "GL_EXT_texture_array", 1);
>> @@ -1180,6 +1180,7 @@ glcpp_parser_create (const struct gl_extensions
>> *extensions, int api)
>>if (extensions->ARB_texture_cube_map_array)
>>   add_builtin_define(parser, "GL_ARB_texture_cube_map_array",
>> 1);
>> }
>> +   }
>>
>> language_version = 110;
>> add_builtin_define(parser, "__VERSION__", language_version);
>> --
>>
>> diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
>> index d487521..72308e0 100644
>> --- a/src/glsl/glcpp/glcpp-parse.y
>> +++ b/src/glsl/glcpp/glcpp-parse.y
>> @@ -1138,47 +1138,48 @@ glcpp_parser_create (const struct gl_extensions
>> *extensions, int api)
>> parser->has_new_source_number = 0;
>> parser->new_source_number = 0;
>>
>> -   /* Add pre-defined macros. */
>> -   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
>> -   add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
>> -
>> if (api == API_OPENGLES2)
>> add_builtin_define(parser, "GL_ES", 1);
>> +   else {
>> +  /* Add pre-defined macros. */
>> +  add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
>> +  add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
>
>
> Nitpick: Could you leave the /* Add pre-defined macros. */ comment before
> the new if statement?   Both branches do that...it's just that the set of
> pre-defined macros depends on your API.

Oh, yeah. I'd interpreted that comment as being applicable to only the
ARB_draw_buffers and ARB_texture_rectangle, but I suppose it's not.

> Assuming you fix the OES_image_external bit,
> Reviewed-by: Kenneth Graunke 

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


Re: [Mesa-dev] [PATCH] glcpp: Don't define macros for extensions that aren't in ES

2012-11-14 Thread Kenneth Graunke

On 11/14/2012 10:34 AM, Matt Turner wrote:

Fixes 54 gles3conform tests.
---
  src/glsl/glcpp/glcpp-parse.y |   59 +
  1 files changed, 30 insertions(+), 29 deletions(-)

The changes in whitespace make this patch hard to read. Here it is
without whitespace changes:

--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1138,13 +1138,13 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
parser->has_new_source_number = 0;
parser->new_source_number = 0;

+   if (api == API_OPENGLES2)
+   add_builtin_define(parser, "GL_ES", 1);
+   else {
/* Add pre-defined macros. */
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);

-   if (api == API_OPENGLES2)
-   add_builtin_define(parser, "GL_ES", 1);
-
if (extensions != NULL) {
   if (extensions->EXT_texture_array) {
  add_builtin_define(parser, "GL_EXT_texture_array", 1);
@@ -1180,6 +1180,7 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
   if (extensions->ARB_texture_cube_map_array)
  add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
}
+   }

language_version = 110;
add_builtin_define(parser, "__VERSION__", language_version);
--

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index d487521..72308e0 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1138,47 +1138,48 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
parser->has_new_source_number = 0;
parser->new_source_number = 0;

-   /* Add pre-defined macros. */
-   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
-   add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
-
if (api == API_OPENGLES2)
add_builtin_define(parser, "GL_ES", 1);
+   else {
+  /* Add pre-defined macros. */
+  add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
+  add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);


Nitpick: Could you leave the /* Add pre-defined macros. */ comment 
before the new if statement?   Both branches do that...it's just that 
the set of pre-defined macros depends on your API.


Assuming you fix the OES_image_external bit,
Reviewed-by: Kenneth Graunke 


-   if (extensions != NULL) {
-  if (extensions->EXT_texture_array) {
- add_builtin_define(parser, "GL_EXT_texture_array", 1);
-  }
+  if (extensions != NULL) {
+ if (extensions->EXT_texture_array) {
+add_builtin_define(parser, "GL_EXT_texture_array", 1);
+ }

-  if (extensions->ARB_fragment_coord_conventions)
- add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
-1);
+ if (extensions->ARB_fragment_coord_conventions)
+add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
+   1);

-  if (extensions->ARB_explicit_attrib_location)
- add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
+ if (extensions->ARB_explicit_attrib_location)
+add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 
1);

-  if (extensions->ARB_shader_texture_lod)
- add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
+ if (extensions->ARB_shader_texture_lod)
+add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);

-  if (extensions->ARB_draw_instanced)
- add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
+ if (extensions->ARB_draw_instanced)
+add_builtin_define(parser, "GL_ARB_draw_instanced", 1);

-  if (extensions->ARB_conservative_depth) {
- add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
- add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
-  }
+ if (extensions->ARB_conservative_depth) {
+add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
+add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
+ }

-  if (extensions->OES_EGL_image_external)
- add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
+ if (extensions->OES_EGL_image_external)
+add_builtin_define(parser, "GL_OES_EGL_image_external", 1);

-  if (extensions->ARB_shader_bit_encoding)
- add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);
+ if (extensions->ARB_shader_bit_encoding)
+add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);

-  if (extensions->ARB_uniform_buffer_object)
-  

Re: [Mesa-dev] [PATCH] i965/gen4-5: Respect the VERTEX_PROGRAM_TWO_SIDE vertex program/shader flag.

2012-11-14 Thread Kenneth Graunke

On 11/14/2012 03:56 PM, Eric Anholt wrote:

Fixes piglit "vertex-program-two-side enabled front back" and 4 others
on my ironlake system.
---

This is a slight variation on a hunk in Olivier Galibert's series,
adding in the required state flags.

  src/mesa/drivers/dri/i965/brw_sf.c |7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_sf.c 
b/src/mesa/drivers/dri/i965/brw_sf.c
index 23a874a..eb361a9 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -190,9 +190,10 @@ brw_upload_sf_prog(struct brw_context *brw)
 if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) != render_to_fbo)
key.sprite_origin_lower_left = true;

-   /* _NEW_LIGHT */
+   /* _NEW_LIGHT | _NEW_PROGRAM */
 key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
-   key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
+   key.do_twoside_color = ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
+   ctx->VertexProgram._TwoSideEnabled);

 /* _NEW_POLYGON */
 if (key.do_twoside_color) {
@@ -214,7 +215,7 @@ brw_upload_sf_prog(struct brw_context *brw)
  const struct brw_tracked_state brw_sf_prog = {
 .dirty = {
.mesa  = (_NEW_HINT | _NEW_LIGHT | _NEW_POLYGON | _NEW_POINT |
-_NEW_TRANSFORM | _NEW_BUFFERS),
+_NEW_TRANSFORM | _NEW_BUFFERS | _NEW_PROGRAM),
.brw   = (BRW_NEW_REDUCED_PRIMITIVE),
.cache = CACHE_NEW_VS_PROG
 },


Looks good to me.

Reviewed-by: Kenneth Graunke 

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


[Mesa-dev] [PATCH 8/5] i965: Remove duplicate brw_opcodes table in favor of opcode_descs.

2012-11-14 Thread Kenneth Graunke
brw_optimize.c's brw_opcodes table was a copy of brw_disasm.c's
opcode_descs table, but with an additional field: is_arith.  Now that
I've deleted that, the two are identical.  Keep the one in brw_disasm.c.
---
 src/mesa/drivers/dri/i965/brw_context.h |  7 
 src/mesa/drivers/dri/i965/brw_fs_emit.cpp   |  4 +--
 src/mesa/drivers/dri/i965/brw_optimize.c| 54 -
 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp |  4 +--
 4 files changed, 4 insertions(+), 65 deletions(-)

 I hear 8/5!  8/5!  Going once...going twice!  Sold, to the man with astute
 observations!  This is getting ridiculous :)  9/5 anyone?

diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index e9c8003..4863c40 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1076,13 +1076,6 @@ struct brw_context
int basevertex;
 };
 
-struct brw_instruction_info {
-char*name;
-intnsrc;
-intndst;
-};
-extern const struct brw_instruction_info brw_opcodes[128];
-
 /*==
  * brw_vtbl.c
  */
diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
index 54e614f..29c73cf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
@@ -1006,9 +1006,9 @@ fs_visitor::generate_code()
  break;
 
   default:
-if (inst->opcode < (int)ARRAY_SIZE(brw_opcodes)) {
+if (inst->opcode < (int) ARRAY_SIZE(opcode_descs)) {
_mesa_problem(ctx, "Unsupported opcode `%s' in FS",
- brw_opcodes[inst->opcode].name);
+ opcode_descs[inst->opcode].name);
 } else {
_mesa_problem(ctx, "Unsupported opcode %d in FS", inst->opcode);
 }
diff --git a/src/mesa/drivers/dri/i965/brw_optimize.c 
b/src/mesa/drivers/dri/i965/brw_optimize.c
index 58c9827..4526440 100644
--- a/src/mesa/drivers/dri/i965/brw_optimize.c
+++ b/src/mesa/drivers/dri/i965/brw_optimize.c
@@ -32,60 +32,6 @@
 #include "brw_defines.h"
 #include "brw_eu.h"
 
-const struct brw_instruction_info brw_opcodes[128] = {
-[BRW_OPCODE_MOV] = { .name = "mov", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_FRC] = { .name = "frc", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_RNDU] = { .name = "rndu", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_RNDD] = { .name = "rndd", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_RNDE] = { .name = "rnde", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_RNDZ] = { .name = "rndz", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_NOT] = { .name = "not", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_LZD] = { .name = "lzd", .nsrc = 1, .ndst = 1 },
-
-[BRW_OPCODE_MUL] = { .name = "mul", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_MAC] = { .name = "mac", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_MACH] = { .name = "mach", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_LINE] = { .name = "line", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_PLN] = { .name = "pln", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_SAD2] = { .name = "sad2", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_SADA2] = { .name = "sada2", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_DP4] = { .name = "dp4", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_DPH] = { .name = "dph", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_DP3] = { .name = "dp3", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_DP2] = { .name = "dp2", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_MATH] = { .name = "math", .nsrc = 2, .ndst = 1 },
-
-[BRW_OPCODE_AVG] = { .name = "avg", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_ADD] = { .name = "add", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_SEL] = { .name = "sel", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_AND] = { .name = "and", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_OR] = { .name = "or", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_XOR] = { .name = "xor", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_SHR] = { .name = "shr", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_SHL] = { .name = "shl", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_ASR] = { .name = "asr", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_CMP] = { .name = "cmp", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_CMPN] = { .name = "cmpn", .nsrc = 2, .ndst = 1 },
-
-[BRW_OPCODE_SEND] = { .name = "send", .nsrc = 1, .ndst = 1 },
-[BRW_OPCODE_NOP] = { .name = "nop", .nsrc = 0, .ndst = 0 },
-[BRW_OPCODE_JMPI] = { .name = "jmpi", .nsrc = 1, .ndst = 0 },
-[BRW_OPCODE_IF] = { .name = "if", .nsrc = 2, .ndst = 0 },
-[BRW_OPCODE_IFF] = { .name = "iff", .nsrc = 2, .ndst = 1 },
-[BRW_OPCODE_WHILE] = { .name = "while", .nsrc = 2, .ndst = 0 },
-[BRW_OPCODE_ELSE] = { .name = "else", .nsrc = 2, .ndst = 0 },
-[BRW_OPCODE_BREAK] = { .name = "break", .nsrc = 2, .ndst = 0 },
-[BRW_OPCODE_CONTINUE] = { .name = "cont", .nsrc = 1, .ndst = 0 },
-[BRW_OPCODE_HALT] = { .name = "halt", .nsrc = 1, .ndst = 0 },
-[BRW_OPCODE_MSAVE] = { .

[Mesa-dev] [PATCH] i965/gen4-5: Respect the VERTEX_PROGRAM_TWO_SIDE vertex program/shader flag.

2012-11-14 Thread Eric Anholt
Fixes piglit "vertex-program-two-side enabled front back" and 4 others
on my ironlake system.
---

This is a slight variation on a hunk in Olivier Galibert's series,
adding in the required state flags.

 src/mesa/drivers/dri/i965/brw_sf.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_sf.c 
b/src/mesa/drivers/dri/i965/brw_sf.c
index 23a874a..eb361a9 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -190,9 +190,10 @@ brw_upload_sf_prog(struct brw_context *brw)
if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) != render_to_fbo)
   key.sprite_origin_lower_left = true;
 
-   /* _NEW_LIGHT */
+   /* _NEW_LIGHT | _NEW_PROGRAM */
key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
-   key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide);
+   key.do_twoside_color = ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
+   ctx->VertexProgram._TwoSideEnabled);
 
/* _NEW_POLYGON */
if (key.do_twoside_color) {
@@ -214,7 +215,7 @@ brw_upload_sf_prog(struct brw_context *brw)
 const struct brw_tracked_state brw_sf_prog = {
.dirty = {
   .mesa  = (_NEW_HINT | _NEW_LIGHT | _NEW_POLYGON | _NEW_POINT |
-_NEW_TRANSFORM | _NEW_BUFFERS),
+_NEW_TRANSFORM | _NEW_BUFFERS | _NEW_PROGRAM),
   .brw   = (BRW_NEW_REDUCED_PRIMITIVE),
   .cache = CACHE_NEW_VS_PROG
},
-- 
1.7.10.4

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


Re: [Mesa-dev] [PATCH 1/3] build: add config.sub and config.guess to tarballs target

2012-11-14 Thread Matt Turner
On Wed, Nov 14, 2012 at 1:49 PM, Andreas Boll
 wrote:
> fixes errors ./configure was complaining about
>
> NOTE: This is a candidate for the 9.0 branch.
>
> Cc: Matt Turner 
> ---
> If you want I can squash all three patches before pushing.
> Only tested on 9.0 branch.
>
>  Makefile.am |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 5e0071c..7f32bc2 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -61,6 +61,8 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
>  EXTRA_FILES = \
> aclocal.m4  \
> configure   \
> +   bin/config.sub  \
> +   bin/config.guess\
> bin/install-sh  \
> src/glsl/glsl_parser.cc \
> src/glsl/glsl_parser.h  \
> --
> 1.7.4.1
>

Series is Reviewed-by: Matt Turner 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] build: add missing files to tarballs target

2012-11-14 Thread Andreas Boll
fixes errors ./configure and make was complaining about

NOTE: This is a candidate for the 9.0 branch.

Cc: Matt Turner 
---
 Makefile.am |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 96ab449..a5708a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,9 +61,15 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 EXTRA_FILES = \
aclocal.m4  \
configure   \
+   bin/ar-lib  \
+   bin/compile \
bin/config.sub  \
bin/config.guess\
+   bin/depcomp \
bin/install-sh  \
+   bin/ltmain.sh   \
+   bin/missing \
+   bin/ylwrap  \
src/glsl/glsl_parser.cc \
src/glsl/glsl_parser.h  \
src/glsl/glsl_lexer.cc  \
-- 
1.7.4.1

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


[Mesa-dev] [PATCH 2/3] build: add missing Makefile.in files to tarballs target

2012-11-14 Thread Andreas Boll
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Cc: Matt Turner 
---
 Makefile.am |   51 ++-
 1 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7f32bc2..96ab449 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,7 +78,56 @@ EXTRA_FILES = \
src/mesa/main/api_exec_es2_remap_helper.h   \
src/mesa/program/lex.yy.c   \
src/mesa/program/program_parse.tab.c\
-   src/mesa/program/program_parse.tab.h
+   src/mesa/program/program_parse.tab.h\
+   src/gallium/drivers/r600/Makefile.in\
+   src/gallium/drivers/r300/Makefile.in\
+   src/gallium/drivers/Makefile.in \
+   src/gallium/Makefile.in \
+   src/gallium/auxiliary/pipe-loader/Makefile.in   \
+   src/gallium/targets/opencl/Makefile.in  \
+   src/gallium/state_trackers/clover/Makefile.in   \
+   src/mapi/glapi/tests/Makefile.in\
+   src/mapi/glapi/Makefile.in  \
+   src/mapi/glapi/gen/Makefile.in  \
+   src/mapi/es1api/Makefile.in \
+   src/mapi/shared-glapi/tests/Makefile.in \
+   src/mapi/shared-glapi/Makefile.in   \
+   src/mapi/vgapi/Makefile.in  \
+   src/mapi/es2api/Makefile.in \
+   src/glsl/tests/Makefile.in  \
+   src/glsl/glcpp/Makefile.in  \
+   src/glsl/Makefile.in\
+   src/gtest/Makefile.in   \
+   src/egl/drivers/Makefile.in \
+   src/egl/drivers/glx/Makefile.in \
+   src/egl/drivers/dri2/Makefile.in\
+   src/egl/Makefile.in \
+   src/egl/main/Makefile.in\
+   src/egl/wayland/Makefile.in \
+   src/egl/wayland/wayland-drm/Makefile.in \
+   src/egl/wayland/wayland-egl/Makefile.in \
+   src/Makefile.in \
+   src/glx/tests/Makefile.in   \
+   src/glx/Makefile.in \
+   src/gbm/Makefile.in \
+   src/mesa/drivers/Makefile.in\
+   src/mesa/drivers/dri/common/Makefile.in \
+   src/mesa/drivers/dri/i965/Makefile.in   \
+   src/mesa/drivers/dri/r200/Makefile.in   \
+   src/mesa/drivers/dri/Makefile.in\
+   src/mesa/drivers/dri/radeon/Makefile.in \
+   src/mesa/drivers/dri/swrast/Makefile.in \
+   src/mesa/drivers/dri/nouveau/Makefile.in\
+   src/mesa/drivers/dri/i915/Makefile.in   \
+   src/mesa/drivers/osmesa/Makefile.in \
+   src/mesa/drivers/x11/Makefile.in\
+   src/mesa/Makefile.in\
+   src/mesa/libdricore/Makefile.in \
+   src/mesa/x86-64/Makefile.in \
+   src/mesa/main/tests/Makefile.in \
+   src/mesa/x86/Makefile.in\
+   Makefile.in
+
 
 IGNORE_FILES = \
-x autogen.sh
-- 
1.7.4.1

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


[Mesa-dev] [PATCH 1/3] build: add config.sub and config.guess to tarballs target

2012-11-14 Thread Andreas Boll
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Cc: Matt Turner 
---
If you want I can squash all three patches before pushing.
Only tested on 9.0 branch.

 Makefile.am |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5e0071c..7f32bc2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,6 +61,8 @@ PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
 EXTRA_FILES = \
aclocal.m4  \
configure   \
+   bin/config.sub  \
+   bin/config.guess\
bin/install-sh  \
src/glsl/glsl_parser.cc \
src/glsl/glsl_parser.h  \
-- 
1.7.4.1

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


Re: [Mesa-dev] [PATCH 2/3] radeonsi: return_INVALID if the color buffer is invalid

2012-11-14 Thread Marek Olšák
I think this just hides a bug elsewhere. If a colorbuffer format is
unsupported, it should never appear in set_framebuffer_state. We
should add assert(format != ~0U) everywhere we use the return value of
si_translate_colorformat and fix any issue that leads to an assertion failure.

Marek

On Wed, Nov 14, 2012 at 8:14 PM,   wrote:
> From: Alex Deucher 
>
> setting the CB format to Z_INVALID disables the color buffer.
>
> Signed-off-by: Alex Deucher 
> ---
>  src/gallium/drivers/radeonsi/si_state.c |4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state.c 
> b/src/gallium/drivers/radeonsi/si_state.c
> index 1f76788..a41bcf0 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -831,7 +831,7 @@ static uint32_t si_translate_colorformat(enum pipe_format 
> format)
> case PIPE_FORMAT_R4A4_UNORM:
> case PIPE_FORMAT_A4R4_UNORM:
> default:
> -   return ~0U; /* Unsupported. */
> +   return V_028C70_COLOR_INVALID; /* Unsupported. */
> }
>  }
>
> @@ -1432,7 +1432,7 @@ static bool si_is_vertex_format_supported(struct 
> pipe_screen *screen, enum pipe_
>
>  static bool si_is_colorbuffer_format_supported(enum pipe_format format)
>  {
> -   return si_translate_colorformat(format) != ~0U &&
> +   return si_translate_colorformat(format) != V_028C70_COLOR_INVALID &&
> si_translate_colorswap(format) != ~0U;
>  }
>
> --
> 1.7.7.5
>
> ___
> 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] [Bug 52034] [llvmpipe] piglit depthstencil-default_fb-blit regression

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=52034

--- Comment #4 from Pavel Ondračka  ---
(In reply to comment #3)
> Piglit depthstencil-default_fb-blit passes for me on llvmpipe, softpipe and
> r600g
> 
> mesa: ca5840afb0eae56f86668d0b5562c6d82fe8ad4b
> 
> @Vinson, Pavel: Could you confirm that the issue is fixed?

Yes, this is also fixed with r300g.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] radeonsi: return Z_INVALID if the Z buffer is invalid

2012-11-14 Thread Christian König

On 14.11.2012 20:14, alexdeuc...@gmail.com wrote:

From: Alex Deucher 

setting the DB format to Z_INVALID disables the depth buffer.

Signed-off-by: Alex Deucher 


For this series:

Reviewed-by: Christian König 


---
  src/gallium/drivers/radeonsi/si_state.c |   10 +++---
  1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index e7a4005..1f76788 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1109,7 +1109,7 @@ static uint32_t si_translate_dbformat(enum pipe_format 
format)
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
return V_028040_Z_32_FLOAT;
default:
-   return ~0U;
+   return V_028040_Z_INVALID;
}
  }
  
@@ -1438,7 +1438,7 @@ static bool si_is_colorbuffer_format_supported(enum pipe_format format)
  
  static bool si_is_zs_format_supported(enum pipe_format format)

  {
-   return si_translate_dbformat(format) != ~0U;
+   return si_translate_dbformat(format) != V_028040_Z_INVALID;
  }
  
  boolean si_is_format_supported(struct pipe_screen *screen,

@@ -1739,12 +1739,8 @@ static void si_db(struct r600_context *rctx, struct 
si_pm4_state *pm4,
   S_028008_SLICE_MAX(state->zsbuf->u.tex.last_layer));
  
  	si_pm4_set_reg(pm4, R_02803C_DB_DEPTH_INFO, 0x1);

-   if (format != ~0U) {
-   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, z_info);
  
-	} else {

-   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, 0);
-   }
+   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, z_info);
  
  	if (rtex->surface.flags & RADEON_SURF_SBUFFER) {

si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, s_info);


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


[Mesa-dev] [PATCH] gallium: Some function headers comment fixes in p_context.h

2012-11-14 Thread Dmitry Cherkassov
Signed-off-by: Dmitry Cherkassov 
---
 src/gallium/include/pipe/p_context.h |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/include/pipe/p_context.h 
b/src/gallium/include/pipe/p_context.h
index 88e12b2..c5dcae5 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -230,21 +230,21 @@ struct pipe_context {
 
void (*set_compute_sampler_views)(struct pipe_context *,
  unsigned start_slot, unsigned num_views,
  struct pipe_sampler_view **);
 
/**
 * Bind an array of shader resources that will be used by the
 * graphics pipeline.  Any resources that were previously bound to
 * the specified range will be unbound after this call.
 *
-* \param first  first resource to bind.
+* \param start  first resource to bind.
 * \param count  number of consecutive resources to bind.
 * \param resources  array of pointers to the resources to bind, it
 *   should contain at least \a count elements
 *   unless it's NULL, in which case no new
 *   resources will be bound.
 */
void (*set_shader_resources)(struct pipe_context *,
 unsigned start, unsigned count,
 struct pipe_surface **resources);
 
@@ -359,21 +359,20 @@ struct pipe_context {
  struct pipe_resource 
*texture,
  const struct 
pipe_sampler_view *templat);
 
void (*sampler_view_destroy)(struct pipe_context *ctx,
 struct pipe_sampler_view *view);
 
 
/**
 * Get a surface which is a "view" into a resource, used by
 * render target / depth stencil stages.
-* \param usage  bitmaks of PIPE_BIND_* flags
 */
struct pipe_surface *(*create_surface)(struct pipe_context *ctx,
   struct pipe_resource *resource,
   const struct pipe_surface *templat);
 
void (*surface_destroy)(struct pipe_context *ctx,
struct pipe_surface *);
 
/**
 * Map a resource.
@@ -447,21 +446,21 @@ struct pipe_context {
void *(*create_compute_state)(struct pipe_context *context,
 const struct pipe_compute_state *);
void (*bind_compute_state)(struct pipe_context *, void *);
void (*delete_compute_state)(struct pipe_context *, void *);
 
/**
 * Bind an array of shader resources that will be used by the
 * compute program.  Any resources that were previously bound to
 * the specified range will be unbound after this call.
 *
-* \param first  first resource to bind.
+* \param start  first resource to bind.
 * \param count  number of consecutive resources to bind.
 * \param resources  array of pointers to the resources to bind, it
 *   should contain at least \a count elements
 *   unless it's NULL, in which case no new
 *   resources will be bound.
 */
void (*set_compute_resources)(struct pipe_context *,
  unsigned start, unsigned count,
  struct pipe_surface **resources);
 
-- 
1.7.10.4

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


Re: [Mesa-dev] [PATCH] glcpp: Don't define macros for extensions that aren't in ES

2012-11-14 Thread Ian Romanick

On 11/14/2012 10:34 AM, Matt Turner wrote:

Fixes 54 gles3conform tests.
---
  src/glsl/glcpp/glcpp-parse.y |   59 +
  1 files changed, 30 insertions(+), 29 deletions(-)

The changes in whitespace make this patch hard to read. Here it is
without whitespace changes:

--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1138,13 +1138,13 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
parser->has_new_source_number = 0;
parser->new_source_number = 0;

+   if (api == API_OPENGLES2)
+   add_builtin_define(parser, "GL_ES", 1);
+   else {
/* Add pre-defined macros. */
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);

-   if (api == API_OPENGLES2)
-   add_builtin_define(parser, "GL_ES", 1);
-
if (extensions != NULL) {
   if (extensions->EXT_texture_array) {
  add_builtin_define(parser, "GL_EXT_texture_array", 1);
@@ -1180,6 +1180,7 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
   if (extensions->ARB_texture_cube_map_array)
  add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
}
+   }

language_version = 110;
add_builtin_define(parser, "__VERSION__", language_version);
--

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index d487521..72308e0 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1138,47 +1138,48 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
parser->has_new_source_number = 0;
parser->new_source_number = 0;

-   /* Add pre-defined macros. */
-   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
-   add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
-
if (api == API_OPENGLES2)
add_builtin_define(parser, "GL_ES", 1);
+   else {
+  /* Add pre-defined macros. */
+  add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
+  add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);

-   if (extensions != NULL) {
-  if (extensions->EXT_texture_array) {
- add_builtin_define(parser, "GL_EXT_texture_array", 1);
-  }
+  if (extensions != NULL) {
+ if (extensions->EXT_texture_array) {
+add_builtin_define(parser, "GL_EXT_texture_array", 1);
+ }

-  if (extensions->ARB_fragment_coord_conventions)
- add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
-1);
+ if (extensions->ARB_fragment_coord_conventions)
+add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
+   1);

-  if (extensions->ARB_explicit_attrib_location)
- add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
+ if (extensions->ARB_explicit_attrib_location)
+add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 
1);

-  if (extensions->ARB_shader_texture_lod)
- add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
+ if (extensions->ARB_shader_texture_lod)
+add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);

-  if (extensions->ARB_draw_instanced)
- add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
+ if (extensions->ARB_draw_instanced)
+add_builtin_define(parser, "GL_ARB_draw_instanced", 1);

-  if (extensions->ARB_conservative_depth) {
- add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
- add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
-  }
+ if (extensions->ARB_conservative_depth) {
+add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
+add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
+ }

-  if (extensions->OES_EGL_image_external)
- add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
+ if (extensions->OES_EGL_image_external)
+add_builtin_define(parser, "GL_OES_EGL_image_external", 1);


This extension exists in both ES and desktop.



-  if (extensions->ARB_shader_bit_encoding)
- add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);
+ if (extensions->ARB_shader_bit_encoding)
+add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);

-  if (extensions->ARB_uniform_buffer_object)
- add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);
+ if (extensions->ARB_uniform_buffer_object)
+add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);

-  if (e

Re: [Mesa-dev] [PATCH] mesa: add initial .cherry-ignore file for the 9.0 branch

2012-11-14 Thread Ian Romanick

Reviewed-by: Ian Romanick 

On 11/09/2012 02:19 AM, Andreas Boll wrote:

---

Note: For the 9.0 branch only

  bin/.cherry-ignore |   10 ++
  1 files changed, 10 insertions(+), 0 deletions(-)
  create mode 100644 bin/.cherry-ignore

diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
new file mode 100644
index 000..35f6e1d
--- /dev/null
+++ b/bin/.cherry-ignore
@@ -0,0 +1,10 @@
+# These commits were cherry picked without using -x.
+# TBD
+
+# Causes too many regressions...
+413c4914129cd26ca87960852d8c0264c0fb29e7 intel: Improve teximage perf for 
Google Chrome paint rects (v3)
+b1d0fe022dc4826dadce014ab8fe062a82f75a16 intel: Fix segfault in 
intel_texsubimage_tiled_memcpy
+b5891286202987dfc2606ac716050c0ee426de11 intel: Fix yet-another-bug in 
intel_texsubimage_tiled_memcpy
+
+# Introduces performance regressions for other games... don't cherry-pick for 
now
+fa58644855e44830e0b91dc627703c236fa6712a r600g: fix abysmal performance in 
Reaction Quake



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


Re: [Mesa-dev] [PATCH 1/3] mesa: add initial .cherry-ignore file for the 8.0 branch

2012-11-14 Thread Ian Romanick

This series is

Reviewed-by: Ian Romanick 

On 11/09/2012 02:18 AM, Andreas Boll wrote:

From: Ian Romanick 

---

Note: For the 8.0 branch only

  bin/.cherry-ignore |   68 
  1 files changed, 68 insertions(+), 0 deletions(-)
  create mode 100644 bin/.cherry-ignore

diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
new file mode 100644
index 000..cab2d46
--- /dev/null
+++ b/bin/.cherry-ignore
@@ -0,0 +1,68 @@
+# These commits were cherry picked without using -x.
+bca6cd2d71ad944031edeacd129eb0031a89c08e scons: Remove Haiku one-offs for 
gallium drivers
+efd73f72d8f34a40d6a1cd279fffa48dc13b6e5b mapi/glapi: Never use a generic no-op 
entry-point on Windows.
+ab1195cf1127781909d5158c7de68f8732458d75 swrast: Fix implicit declaration 
warnings
+e2dce7f7ee3e7da9cbb0bb33307ecd79e824426d intel: Fix rendering from textures 
after RenderTexture().
+b4082f492b4b55df4c636445e47b97d1f1e4b5b2 r600g: add support for TN (trinity) 
APUs
+
+# There's no blorp in the 8.0 branch.
+32c7b2769cbe80ff56d1c73c4f9b62f13f577c8d i965/blorp: Clarify why width/height 
must be adjusted for Gen6 IMS surfaces.
+e14b1288ef5b5b6091facaecd42e86f0a8157f28 i965/blorp: Change gl_renderbuffer* 
params to intel_renderbuffer*.
+09b0fa8499d8035fa31ccb2b550056305fbd149b i965/blorp: store surface 
width/height in brw_blorp_mip_info.
+c130ce7b2b26b4b67d4bf2b6dd1044a200efe25d i965/blorp: store x and y offsets in 
brw_blorp_mip_info.
+3123f0621561549c4566248100661ef77cab2834 i965/blorp: Thread level and layer 
through brw_blorp_blit_miptrees().
+f04f219906e40a6647a10fd9c1928509fe25fb84 i965/blorp: Account for offsets when 
emitting SURFACE_STATE.
+1a75063d5f829547b75b60ae64bddf3905b4cb8f i965/blorp: don't reduce stencil 
alignment restrictions when multisampling.
+5fd67fac14d7f35c311eb5c671be8d4ae9b2ea37 i965/blorp: Reduce alignment 
restrictions for stencil blits.
+1a5d4f7cb2367c7863b28efbd78e9169114baf42 i965/blorp: Fix offsets and 
width/height for stencil blits.
+a33ce665a5827c598b85bb04d94b33e6a5e41c28 i965/blorp: Increase Y alignment for 
multisampled stencil blits.
+124b214f094fa63ff1ddb7e9f0a1c2e0ba8214fb i965/blorp: Fix sRGB MSAA resolves.
+e2249e8c4d06a85d6389ba1689e15d7e29aa4dff i965/blorp: Add support for blits 
between SRGB and linear formats.
+
+# The old generated ES1/ES2 disptach code is still used in 8.0.
+aa129b0833052f613a6ec570aef092733769ee0e mesa: Don't set dispatch pointer for 
glPointSize in ES2
+850412b8ab272b9616da9a0df29e424b07bddde9 mesa: Don't set dispatch pointer for 
glGetDoublev in ES2
+11927bfc4a43aefbac5af35aae34d5cdf5d9e6bb mesa: Don't set dispatch pointer for 
glGetBufferSubData in ES2
+2a3a68e4c7b15860ac9398c5a56c0d6762573633 mesa: Don't set dispatch pointers for 
glClearDepth or glDepthRange in ES2
+1c0a44aaf5c095ca261d1ce11bb8a67dbbce54a2 mesa: Don't set dispatch pointers for 
glPointParameter[if][v] in ES2
+a83b01371e60356d2ed69c131bf9e0a0daba59a4 mesa: Don't set dispatch pointer for 
glResizeBuffersMESA in ES2
+7f7268d385cc1435264b8d3111e1596b2dae9183 mesa: Don't set dispatch pointer for 
glGetProgramivARB in ES2
+ee77061277b640d78befb43c26a3ffbe227e9244 mesa: Don't set dispatch pointer for 
glTexStorage in ES2
+3ef9e43865f38e9c8c5681768645513ce26e0488 mesa: Pass GL context to 
_mesa_create_save_table
+a13c07f7528c74fc433a722351110087b89d mesa: Don't set loopback dispatch 
pointers for most things in ES2 or core
+aa0f588e2d4c160879699180f0e7f4d3e52b55b9 mesa: Don't set vtxfmt dispatch 
pointers for many things in ES2 or core
+be66cf950e01d217b5341f8e56676dc5bf81ca47 mesa: Don't set shaderapi dispatch 
pointers for many things in ES2 or core
+6c01a0e770432eda0e29dbd7278a94efc688a6d3 mesa: Don't set uniform dispatch 
pointers for many things in ES2 or core
+8f0b81bf7ddcdf5715a3e00af67395b91f27a243 mesa: don't enable glVertexPointer() 
when using API_OPENGLES2.
+51b069e7aa81cdc8f38db71554ae3dd12ce0a6c4 meta: Don't save and restore fog 
state when there is no fog state
+
+# The GLSL GenerateMipmaps does not exist in 8.0.
+299acac849eb8506de9760c94c6e8e8b1046d909 _mesa_meta_GenerateMipmap: Support 
all texture targets by generating shaders at runtime
+15bf3103b48a5928321fe56fbb3ed28a0f314418 _mesa_meta_GenerateMipmap: Generate 
separate shaders for glsl 120 / 130
+679c93ff89c71cbd3b1d24e88abd38f00b8c1f02 meta: Don't _mesa_set_enable() 
invalid targets in ES 1.
+ab097dde0c958dd8b1c06a07ef8913512753760c meta: Remove unsafe global mem_ctx 
pointer
+3308c079bd00e9b9aa546f5214ce197a904d059b meta: Rearrange shader creation in 
setup_glsl_generate_mipmap
+0242381f06edb09dcf0eaacd6d26ccd8584700cc meta: Don't use GLSL 1.30 shader on 
OpenGL ES 2
+eb1d87fb945783448cc40ad43c9cd4d98002d424 meta: Add on demand compilation of 
per target shader programs
+
+# There's no dual-source blending in 8.0.
+354f2cb5c7330a7d43cf0b177daf758d2aa31e0a glsl: Generate compile errors for explicit 
blend indices < 0 or > 1.
+ea0d08872724b5e31e9e32db2338e15fdfdcc4de intel/i965: Disable

[Mesa-dev] [Bug 57127] New: "make dist" fails with "No rule to make target `glapi_gentable.c', needed by `distdir'."

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=57127

  Priority: high
Bug ID: 57127
CC: matts...@gmail.com
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: "make dist" fails with "No rule to make target
`glapi_gentable.c', needed by `distdir'."
  Severity: normal
Classification: Unclassified
OS: All
  Reporter: i...@freedesktop.org
  Hardware: All
Status: NEW
   Version: git
 Component: Mesa core
   Product: Mesa

This happens on both master and the 9.0 branch.  It is currently blocking the
9.0.1 release because I can't make the tarballs. :)

gmake[2]: Entering directory
`/home/idr/devel/graphics/Mesa/SOURCE/Mesa-9.0.1/src/mapi/glapi'
gmake[2]: *** No rule to make target `glapi_gentable.c', needed by `distdir'. 
Stop.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 3/3] radeonsi: cleanup si_db()

2012-11-14 Thread alexdeucher
From: Alex Deucher 

Clean up a few magic numbers and rework the code a bit.

Signed-off-by: Alex Deucher 
---
 src/gallium/drivers/radeonsi/si_state.c |   22 ++
 src/gallium/drivers/radeonsi/sid.h  |2 ++
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index a41bcf0..dd5af52 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1676,8 +1676,8 @@ static void si_db(struct r600_context *rctx, struct 
si_pm4_state *pm4,
uint64_t z_offs, s_offs;
 
if (state->zsbuf == NULL) {
-   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, 0);
-   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, 0);
+   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, 
S_028040_FORMAT(V_028040_Z_INVALID));
+   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, 
S_028044_FORMAT(V_028044_STENCIL_INVALID));
return;
}
 
@@ -1704,7 +1704,10 @@ static void si_db(struct r600_context *rctx, struct 
si_pm4_state *pm4,
}
 
z_info = S_028040_FORMAT(format);
-   s_info = S_028044_FORMAT(1);
+   if (rtex->surface.flags & RADEON_SURF_SBUFFER)
+   s_info = S_028044_FORMAT(V_028044_STENCIL_8);
+   else
+   s_info = S_028044_FORMAT(V_028044_STENCIL_INVALID);
 
if (rtex->surface.level[level].mode == RADEON_SURF_MODE_1D) {
z_info |= S_028040_TILE_MODE_INDEX(4);
@@ -1729,8 +1732,8 @@ static void si_db(struct r600_context *rctx, struct 
si_pm4_state *pm4,
} else {
R600_ERR("Invalid DB tiling mode %d!\n",
 rtex->surface.level[level].mode);
-   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, 0);
-   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, 0);
+   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, 
S_028040_FORMAT(V_028040_Z_INVALID));
+   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, 
S_028044_FORMAT(V_028044_STENCIL_INVALID));
return;
}
 
@@ -1738,15 +1741,10 @@ static void si_db(struct r600_context *rctx, struct 
si_pm4_state *pm4,
   S_028008_SLICE_START(state->zsbuf->u.tex.first_layer) |
   S_028008_SLICE_MAX(state->zsbuf->u.tex.last_layer));
 
-   si_pm4_set_reg(pm4, R_02803C_DB_DEPTH_INFO, 0x1);
+   si_pm4_set_reg(pm4, R_02803C_DB_DEPTH_INFO, 
S_02803C_ADDR5_SWIZZLE_MASK(1));
 
si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, z_info);
-
-   if (rtex->surface.flags & RADEON_SURF_SBUFFER) {
-   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, s_info);
-   } else {
-   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, 0);
-   }
+   si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, s_info);
 
si_pm4_add_bo(pm4, &rtex->resource, RADEON_USAGE_READWRITE);
si_pm4_set_reg(pm4, R_028048_DB_Z_READ_BASE, z_offs);
diff --git a/src/gallium/drivers/radeonsi/sid.h 
b/src/gallium/drivers/radeonsi/sid.h
index bc5fcda..57553a6 100644
--- a/src/gallium/drivers/radeonsi/sid.h
+++ b/src/gallium/drivers/radeonsi/sid.h
@@ -4645,6 +4645,8 @@
 #define   S_028044_FORMAT(x)  (((x) & 
0x1) << 0)
 #define   G_028044_FORMAT(x)  (((x) >> 
0) & 0x1)
 #define   C_028044_FORMAT 
0xFFFE
+#define V_028044_STENCIL_INVALID0x00
+#define V_028044_STENCIL_8  0x01
 #define   S_028044_TILE_MODE_INDEX(x) (((x) & 
0x07) << 20)
 #define   G_028044_TILE_MODE_INDEX(x) (((x) >> 
20) & 0x07)
 #define   C_028044_TILE_MODE_INDEX
0xFF8F
-- 
1.7.7.5

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


[Mesa-dev] [PATCH 2/3] radeonsi: return_INVALID if the color buffer is invalid

2012-11-14 Thread alexdeucher
From: Alex Deucher 

setting the CB format to Z_INVALID disables the color buffer.

Signed-off-by: Alex Deucher 
---
 src/gallium/drivers/radeonsi/si_state.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 1f76788..a41bcf0 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -831,7 +831,7 @@ static uint32_t si_translate_colorformat(enum pipe_format 
format)
case PIPE_FORMAT_R4A4_UNORM:
case PIPE_FORMAT_A4R4_UNORM:
default:
-   return ~0U; /* Unsupported. */
+   return V_028C70_COLOR_INVALID; /* Unsupported. */
}
 }
 
@@ -1432,7 +1432,7 @@ static bool si_is_vertex_format_supported(struct 
pipe_screen *screen, enum pipe_
 
 static bool si_is_colorbuffer_format_supported(enum pipe_format format)
 {
-   return si_translate_colorformat(format) != ~0U &&
+   return si_translate_colorformat(format) != V_028C70_COLOR_INVALID &&
si_translate_colorswap(format) != ~0U;
 }
 
-- 
1.7.7.5

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


[Mesa-dev] [PATCH 1/3] radeonsi: return Z_INVALID if the Z buffer is invalid

2012-11-14 Thread alexdeucher
From: Alex Deucher 

setting the DB format to Z_INVALID disables the depth buffer.

Signed-off-by: Alex Deucher 
---
 src/gallium/drivers/radeonsi/si_state.c |   10 +++---
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index e7a4005..1f76788 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1109,7 +1109,7 @@ static uint32_t si_translate_dbformat(enum pipe_format 
format)
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
return V_028040_Z_32_FLOAT;
default:
-   return ~0U;
+   return V_028040_Z_INVALID;
}
 }
 
@@ -1438,7 +1438,7 @@ static bool si_is_colorbuffer_format_supported(enum 
pipe_format format)
 
 static bool si_is_zs_format_supported(enum pipe_format format)
 {
-   return si_translate_dbformat(format) != ~0U;
+   return si_translate_dbformat(format) != V_028040_Z_INVALID;
 }
 
 boolean si_is_format_supported(struct pipe_screen *screen,
@@ -1739,12 +1739,8 @@ static void si_db(struct r600_context *rctx, struct 
si_pm4_state *pm4,
   S_028008_SLICE_MAX(state->zsbuf->u.tex.last_layer));
 
si_pm4_set_reg(pm4, R_02803C_DB_DEPTH_INFO, 0x1);
-   if (format != ~0U) {
-   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, z_info);
 
-   } else {
-   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, 0);
-   }
+   si_pm4_set_reg(pm4, R_028040_DB_Z_INFO, z_info);
 
if (rtex->surface.flags & RADEON_SURF_SBUFFER) {
si_pm4_set_reg(pm4, R_028044_DB_STENCIL_INFO, s_info);
-- 
1.7.7.5

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


[Mesa-dev] [PATCH] i965/gen4: Fix LOD bias texturing since my fixed reg classes change.

2012-11-14 Thread Eric Anholt
We have a special case where non-shadow comparison with LOD requires using a
SIMD16 vec4 in an 8-wide shader, which appears in the register allocator as a
size 8 vgrf.

Fixes assertions in various piglit tests and webgl conformance.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56521
---
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp |   28 +
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index f87cbbc..e83193e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -90,14 +90,15 @@ brw_alloc_reg_set(struct brw_context *brw, int reg_width)
 * less some day.
 *
 * Additionally, on gen5 we need aligned pairs of registers for the PLN
-* instruction.
+* instruction, and on gen4 we need 8 contiguous regs for workaround simd16
+* texturing.
 *
-* So we have a need for classes for 1, 2, and 4 registers currently, and
-* we add in '3' to make indexing the array easier (since we'll probably
-* want it for texturing later).
+* So we have a need for classes for 1, 2, 4, and 8 registers currently,
+* and we add in '3' to make indexing the array easier for the common case
+* (since we'll probably want it for texturing later).
 */
-   const int class_sizes[4] = {1, 2, 3, 4};
-   const int class_count = 4;
+   const int class_count = 5;
+   const int class_sizes[class_count] = {1, 2, 3, 4, 8};
 
/* Compute the total number of registers across all classes. */
int ra_reg_count = 0;
@@ -410,10 +411,17 @@ fs_visitor::assign_regs()
 node_count);
 
for (int i = 0; i < this->virtual_grf_count; i++) {
-  assert(this->virtual_grf_sizes[i] >= 1 &&
- this->virtual_grf_sizes[i] <= 4 &&
- "Register allocation relies on split_virtual_grfs()");
-  int c = brw->wm.reg_sets[rsi].classes[this->virtual_grf_sizes[i] - 1];
+  int size = this->virtual_grf_sizes[i];
+  int c;
+
+  if (size == 8) {
+ c = 4;
+  } else {
+ assert(size >= 1 &&
+size <= 4 &&
+"Register allocation relies on split_virtual_grfs()");
+ c = brw->wm.reg_sets[rsi].classes[size - 1];
+  }
 
   /* Special case: on pre-GEN6 hardware that supports PLN, the
* second operand of a PLN instruction needs to be an
-- 
1.7.10.4

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


Re: [Mesa-dev] [PATCH] glcpp: Don't define macros for extensions that aren't in ES

2012-11-14 Thread Matt Turner
On Wed, Nov 14, 2012 at 10:34 AM, Matt Turner  wrote:
> -  if (extensions->OES_EGL_image_external)
> - add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
> + if (extensions->OES_EGL_image_external)
> +add_builtin_define(parser, "GL_OES_EGL_image_external", 1);

This one is exposed in ES1+2, but I missed it since it's not exposed
on i965. I'll fix that.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 51531] `make distclean` fails in wayland-drm/

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=51531

Andreas Boll  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #2 from Andreas Boll  ---
@nobled: Could you confirm that the issue is fixed?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [RFC 4/4] mesa: compute version in _mesa_initialize_context

2012-11-14 Thread Jordan Justen
In _mesa_initialize_context:
* Call Driver.InitializeVersionFeatures to allow the driver to
  enable features which are significant to computing the versions
* Call _mesa_compute_version. It is important that this is done
  before _mesa_create_exec_table is called.

In _mesa_make_current:
* Assert if the version wasn't previously set

Signed-off-by: Jordan Justen 
---
 src/mesa/drivers/dri/intel/intel_context.c |2 --
 src/mesa/drivers/dri/swrast/swrast.c   |2 --
 src/mesa/main/context.c|   13 -
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index 113af90..dffbdb6 100755
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -749,8 +749,6 @@ intelInitContext(struct intel_context *intel,
 
intel->RenderIndex = ~0;
 
-   ctx->Driver.InitializeVersionFeatures(ctx);
-
INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
if (INTEL_DEBUG & DEBUG_BUFMGR)
   dri_bufmgr_set_debug(intel->bufmgr, true);
diff --git a/src/mesa/drivers/dri/swrast/swrast.c 
b/src/mesa/drivers/dri/swrast/swrast.c
index b2f2a34..0da2e98 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -792,8 +792,6 @@ dri_create_context(gl_api api,
 
 _mesa_meta_init(mesaCtx);
 
-mesaCtx->Driver.InitializeVersionFeatures(mesaCtx);
-
 *error = __DRI_CTX_ERROR_SUCCESS;
 return GL_TRUE;
 
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 0508378..24adba4 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -935,6 +935,17 @@ _mesa_initialize_context(struct gl_context *ctx,
   return GL_FALSE;
}
 
+   /* Allow the driver to initialize features which are important for
+* calculating the context version.
+*/
+   assert(ctx->Driver.InitializeVersionFeatures != NULL);
+   ctx->Driver.InitializeVersionFeatures(ctx);
+
+   /* Compute context's supported version. Initialization past this
+* point may use ctx->Version.
+*/
+   _mesa_compute_version(ctx);
+
/* setup the API dispatch tables */
ctx->Exec = _mesa_create_exec_table(ctx);
 
@@ -1462,7 +1473,7 @@ _mesa_make_current( struct gl_context *newCtx,
   }
 
   if (newCtx->FirstTimeCurrent) {
- _mesa_compute_version(newCtx);
+ assert(newCtx->Version > 0);
 
  newCtx->Extensions.String = _mesa_make_extension_string(newCtx);
 
-- 
1.7.9.5

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


[Mesa-dev] [RFC 3/4] intel/i965: add InitializeVersionFeatures driver function

2012-11-14 Thread Jordan Justen
Signed-off-by: Jordan Justen 
---
 src/mesa/drivers/dri/i965/brw_context.c|   23 ++-
 src/mesa/drivers/dri/intel/intel_context.c |   18 +-
 src/mesa/drivers/dri/intel/intel_context.h |3 +++
 3 files changed, 34 insertions(+), 10 deletions(-)
 mode change 100644 => 100755 src/mesa/drivers/dri/intel/intel_context.c

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index 1448965..3aea256 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -55,6 +55,9 @@
  * Mesa's Driver Functions
  ***/
 
+static void
+brwInitializeVersionFeatures(struct gl_context * ctx);
+
 static void brwInitDriverFunctions(struct intel_screen *screen,
   struct dd_function_table *functions)
 {
@@ -63,6 +66,8 @@ static void brwInitDriverFunctions(struct intel_screen 
*screen,
brwInitFragProgFuncs( functions );
brw_init_queryobj_functions(functions);
 
+   functions->InitializeVersionFeatures = brwInitializeVersionFeatures;
+
functions->BeginTransformFeedback = brw_begin_transform_feedback;
 
if (screen->gen >= 7)
@@ -214,11 +219,6 @@ brwCreateContext(int api,
ctx->Const.MaxTransformFeedbackSeparateComponents =
   BRW_MAX_SOL_BINDINGS / BRW_MAX_SOL_BUFFERS;
 
-   if (intel->gen == 6)
-  ctx->Const.MaxSamples = 4;
-   else if (intel->gen >= 7)
-  ctx->Const.MaxSamples = 8;
-
/* if conformance mode is set, swrast can handle any size AA point */
ctx->Const.MaxPointSizeAA = 255.0;
 
@@ -394,3 +394,16 @@ brwCreateContext(int api,
return true;
 }
 
+static void
+brwInitializeVersionFeatures(struct gl_context * ctx)
+{
+   struct intel_context *intel = intel_context(ctx);
+
+   intelInitializeVersionFeatures(ctx);
+
+   if (intel->gen == 6)
+  ctx->Const.MaxSamples = 4;
+   else if (intel->gen >= 7)
+  ctx->Const.MaxSamples = 8;
+
+}
diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
old mode 100644
new mode 100755
index 204609e..113af90
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -495,6 +495,12 @@ static const struct dri_debug_control debug_control[] = {
 };
 
 
+void
+intelInitializeVersionFeatures(struct gl_context * ctx)
+{
+   intelInitExtensions(ctx);
+}
+
 static void
 intelInvalidateState(struct gl_context * ctx, GLuint new_state)
 {
@@ -561,6 +567,7 @@ intelInitDriverFunctions(struct dd_function_table 
*functions)
 {
_mesa_init_driver_functions(functions);
 
+   functions->InitializeVersionFeatures = intelInitializeVersionFeatures;
functions->Flush = intel_glFlush;
functions->Finish = intelFinish;
functions->GetString = intelGetString;
@@ -607,6 +614,11 @@ intelInitContext(struct intel_context *intel,
   mesaVis = &visual;
}
 
+   intel->bufmgr = intelScreen->bufmgr;
+
+   driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
+   sPriv->myNum, (intel->gen >= 4) ? "i965" : "i915");
+
if (!_mesa_initialize_context(&intel->ctx, api, mesaVis, shareCtx,
  functions)) {
   printf("%s: failed to init mesa context\n", __FUNCTION__);
@@ -649,15 +661,11 @@ intelInitContext(struct intel_context *intel,
memset(&ctx->TextureFormatSupported,
  0, sizeof(ctx->TextureFormatSupported));
 
-   driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
-   sPriv->myNum, (intel->gen >= 4) ? "i965" : "i915");
if (intel->gen < 4)
   intel->maxBatchSize = 4096;
else
   intel->maxBatchSize = sizeof(intel->batch.map);
 
-   intel->bufmgr = intelScreen->bufmgr;
-
bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse");
switch (bo_reuse_mode) {
case DRI_CONF_BO_REUSE_DISABLED:
@@ -741,7 +749,7 @@ intelInitContext(struct intel_context *intel,
 
intel->RenderIndex = ~0;
 
-   intelInitExtensions(ctx);
+   ctx->Driver.InitializeVersionFeatures(ctx);
 
INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
if (INTEL_DEBUG & DEBUG_BUFMGR)
diff --git a/src/mesa/drivers/dri/intel/intel_context.h 
b/src/mesa/drivers/dri/intel/intel_context.h
index eeefadf..218c6fc 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -519,6 +519,9 @@ extern bool intelInitContext(struct intel_context *intel,
   void *sharedContextPrivate,
   struct dd_function_table *functions);
 
+extern void
+intelInitializeVersionFeatures(struct gl_context * ctx);
+
 extern void intelFinish(struct gl_context * ctx);
 extern void intel_flush_rendering_to_batch(struct gl_context *ctx);
 extern void _intel_flush(struct gl_context * ctx, const char *file, int line);
-- 
1.7.9.5

___
m

[Mesa-dev] [RFC 2/4] swrast: add InitializeVersionFeatures driver function

2012-11-14 Thread Jordan Justen
Signed-off-by: Jordan Justen 
---
 src/mesa/drivers/dri/swrast/swrast.c |   74 +++---
 1 file changed, 41 insertions(+), 33 deletions(-)

diff --git a/src/mesa/drivers/dri/swrast/swrast.c 
b/src/mesa/drivers/dri/swrast/swrast.c
index 45ef3c2..b2f2a34 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -632,18 +632,6 @@ static gl_format swrastChooseTextureFormat(struct 
gl_context * ctx,
 return _mesa_choose_tex_format(ctx, target, internalFormat, format, type);
 }
 
-static void
-swrast_init_driver_functions(struct dd_function_table *driver)
-{
-driver->GetString = get_string;
-driver->UpdateState = update_state;
-driver->GetBufferSize = NULL;
-driver->Viewport = viewport;
-driver->ChooseTextureFormat = swrastChooseTextureFormat;
-driver->MapRenderbuffer = swrast_map_renderbuffer;
-driver->UnmapRenderbuffer = swrast_unmap_renderbuffer;
-}
-
 static const char *es2_extensions[] = {
/* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */
"GL_EXT_blend_func_separate",
@@ -679,6 +667,46 @@ InitExtensionsES2(struct gl_context *ctx)
   _mesa_enable_extension(ctx, es2_extensions[i]);
 }
 
+static void
+initialize_version_features(struct gl_context * ctx)
+{
+_mesa_enable_sw_extensions(ctx);
+
+switch (ctx->API) {
+case API_OPENGL_CORE:
+/* XXX fix me, fall-through for now */
+case API_OPENGL:
+_mesa_enable_1_3_extensions(ctx);
+_mesa_enable_1_4_extensions(ctx);
+_mesa_enable_1_5_extensions(ctx);
+_mesa_enable_2_0_extensions(ctx);
+_mesa_enable_2_1_extensions(ctx);
+break;
+case API_OPENGLES:
+_mesa_enable_1_3_extensions(ctx);
+_mesa_enable_1_4_extensions(ctx);
+_mesa_enable_1_5_extensions(ctx);
+
+break;
+case API_OPENGLES2:
+InitExtensionsES2(ctx);
+break;
+}
+}
+
+static void
+swrast_init_driver_functions(struct dd_function_table *driver)
+{
+driver->InitializeVersionFeatures = initialize_version_features;
+driver->GetString = get_string;
+driver->UpdateState = update_state;
+driver->GetBufferSize = NULL;
+driver->Viewport = viewport;
+driver->ChooseTextureFormat = swrastChooseTextureFormat;
+driver->MapRenderbuffer = swrast_map_renderbuffer;
+driver->UnmapRenderbuffer = swrast_unmap_renderbuffer;
+}
+
 /**
  * Context-related functions.
  */
@@ -763,28 +791,8 @@ dri_create_context(gl_api api,
 }
 
 _mesa_meta_init(mesaCtx);
-_mesa_enable_sw_extensions(mesaCtx);
-
-switch (api) {
-case API_OPENGL_CORE:
-/* XXX fix me, fall-through for now */
-case API_OPENGL:
-_mesa_enable_1_3_extensions(mesaCtx);
-_mesa_enable_1_4_extensions(mesaCtx);
-_mesa_enable_1_5_extensions(mesaCtx);
-_mesa_enable_2_0_extensions(mesaCtx);
-_mesa_enable_2_1_extensions(mesaCtx);
-break;
-case API_OPENGLES:
-_mesa_enable_1_3_extensions(mesaCtx);
-_mesa_enable_1_4_extensions(mesaCtx);
-_mesa_enable_1_5_extensions(mesaCtx);
 
-break;
-case API_OPENGLES2:
-InitExtensionsES2( mesaCtx);
-break;
-}
+mesaCtx->Driver.InitializeVersionFeatures(mesaCtx);
 
 *error = __DRI_CTX_ERROR_SUCCESS;
 return GL_TRUE;
-- 
1.7.9.5

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


[Mesa-dev] [RFC 1/4] mesa: add driver callback "InitializeVersionFeatures"

2012-11-14 Thread Jordan Justen
During context initialization, this callback allows the driver
to configure features of the context so the correct GL/GLES
version will be calculated.

Signed-off-by: Jordan Justen 
---
 src/mesa/drivers/common/driverfuncs.c |1 +
 src/mesa/main/dd.h|6 ++
 2 files changed, 7 insertions(+)

diff --git a/src/mesa/drivers/common/driverfuncs.c 
b/src/mesa/drivers/common/driverfuncs.c
index 93fa3c7..2f6384c 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -71,6 +71,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
 {
memset(driver, 0, sizeof(*driver));
 
+   driver->InitializeVersionFeatures = NULL;  /* REQUIRED! */
driver->GetString = NULL;  /* REQUIRED! */
driver->UpdateState = NULL;  /* REQUIRED! */
driver->GetBufferSize = NULL;  /* REQUIRED! */
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 70c5324..60122bb 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -78,6 +78,12 @@ struct gl_texture_object;
  */
 struct dd_function_table {
/**
+* During context creation, this function allows the driver to initialize
+* context features (ctx->Extensions, ctx->Const...)
+*/
+   void (*InitializeVersionFeatures)( struct gl_context *ctx );
+
+   /**
 * Return a string as needed by glGetString().
 * Only the GL_RENDERER query must be implemented.  Otherwise, NULL can be
 * returned.
-- 
1.7.9.5

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


[Mesa-dev] [RFC 0/4] Compute version during _mesa_initialize_context

2012-11-14 Thread Jordan Justen
Within _mesa_initialize_context the call to _mesa_create_exec_table
now depends on ctx->Version being set. (For GLES3 support.)

This series adds a driver callback function that allows each driver
to enable features that are significant for computing to version.

Now _mesa_initialize_context will:
 * basic context init
 * call driver.InitializeVersionFeatures
 * compute version
 * initialize dispatch tables, etc.

v1:
 * Implement support for swrast & i965 drivers

Jordan Justen (4):
  mesa: add driver callback "InitializeVersionFeatures"
  swrast: add InitializeVersionFeatures driver function
  intel/i965: add InitializeVersionFeatures driver function
  mesa: compute version in _mesa_initialize_context

 src/mesa/drivers/common/driverfuncs.c  |1 +
 src/mesa/drivers/dri/i965/brw_context.c|   23 +++--
 src/mesa/drivers/dri/intel/intel_context.c |   18 ---
 src/mesa/drivers/dri/intel/intel_context.h |3 ++
 src/mesa/drivers/dri/swrast/swrast.c   |   74 +++-
 src/mesa/main/context.c|   13 -
 src/mesa/main/dd.h |6 +++
 7 files changed, 92 insertions(+), 46 deletions(-)
 mode change 100644 => 100755 src/mesa/drivers/dri/intel/intel_context.c

-- 
1.7.9.5

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


[Mesa-dev] [PATCH] glcpp: Don't define macros for extensions that aren't in ES

2012-11-14 Thread Matt Turner
Fixes 54 gles3conform tests.
---
 src/glsl/glcpp/glcpp-parse.y |   59 +
 1 files changed, 30 insertions(+), 29 deletions(-)

The changes in whitespace make this patch hard to read. Here it is
without whitespace changes:

--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1138,13 +1138,13 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
parser->has_new_source_number = 0;
parser->new_source_number = 0;
 
+   if (api == API_OPENGLES2)
+   add_builtin_define(parser, "GL_ES", 1);
+   else {
/* Add pre-defined macros. */
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
 
-   if (api == API_OPENGLES2)
-   add_builtin_define(parser, "GL_ES", 1);
-
if (extensions != NULL) {
   if (extensions->EXT_texture_array) {
  add_builtin_define(parser, "GL_EXT_texture_array", 1);
@@ -1180,6 +1180,7 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
   if (extensions->ARB_texture_cube_map_array)
  add_builtin_define(parser, "GL_ARB_texture_cube_map_array", 1);
}
+   }
 
language_version = 110;
add_builtin_define(parser, "__VERSION__", language_version);
--

diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index d487521..72308e0 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -1138,47 +1138,48 @@ glcpp_parser_create (const struct gl_extensions 
*extensions, int api)
parser->has_new_source_number = 0;
parser->new_source_number = 0;
 
-   /* Add pre-defined macros. */
-   add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
-   add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
-
if (api == API_OPENGLES2)
add_builtin_define(parser, "GL_ES", 1);
+   else {
+  /* Add pre-defined macros. */
+  add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
+  add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
 
-   if (extensions != NULL) {
-  if (extensions->EXT_texture_array) {
- add_builtin_define(parser, "GL_EXT_texture_array", 1);
-  }
+  if (extensions != NULL) {
+ if (extensions->EXT_texture_array) {
+add_builtin_define(parser, "GL_EXT_texture_array", 1);
+ }
 
-  if (extensions->ARB_fragment_coord_conventions)
- add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
-1);
+ if (extensions->ARB_fragment_coord_conventions)
+add_builtin_define(parser, "GL_ARB_fragment_coord_conventions",
+   1);
 
-  if (extensions->ARB_explicit_attrib_location)
- add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 1);
+ if (extensions->ARB_explicit_attrib_location)
+add_builtin_define(parser, "GL_ARB_explicit_attrib_location", 
1);
 
-  if (extensions->ARB_shader_texture_lod)
- add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
+ if (extensions->ARB_shader_texture_lod)
+add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
 
-  if (extensions->ARB_draw_instanced)
- add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
+ if (extensions->ARB_draw_instanced)
+add_builtin_define(parser, "GL_ARB_draw_instanced", 1);
 
-  if (extensions->ARB_conservative_depth) {
- add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
- add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
-  }
+ if (extensions->ARB_conservative_depth) {
+add_builtin_define(parser, "GL_AMD_conservative_depth", 1);
+add_builtin_define(parser, "GL_ARB_conservative_depth", 1);
+ }
 
-  if (extensions->OES_EGL_image_external)
- add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
+ if (extensions->OES_EGL_image_external)
+add_builtin_define(parser, "GL_OES_EGL_image_external", 1);
 
-  if (extensions->ARB_shader_bit_encoding)
- add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);
+ if (extensions->ARB_shader_bit_encoding)
+add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1);
 
-  if (extensions->ARB_uniform_buffer_object)
- add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);
+ if (extensions->ARB_uniform_buffer_object)
+add_builtin_define(parser, "GL_ARB_uniform_buffer_object", 1);
 
-  if (extensions->ARB_texture_cube_map_array)
- add_builtin_define(parser, "GL

[Mesa-dev] [Bug 52034] [llvmpipe] piglit depthstencil-default_fb-blit regression

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=52034

Andreas Boll  changed:

   What|Removed |Added

 Status|NEW |NEEDINFO

--- Comment #3 from Andreas Boll  ---
Piglit depthstencil-default_fb-blit passes for me on llvmpipe, softpipe and
r600g

mesa: ca5840afb0eae56f86668d0b5562c6d82fe8ad4b

@Vinson, Pavel: Could you confirm that the issue is fixed?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 57121] corrupted GLSL built-in function results when using Uniform Buffer contents as arguments

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=57121

--- Comment #2 from Tomasz Kaźmierczak  ---
Created attachment 70080
  --> https://bugs.freedesktop.org/attachment.cgi?id=70080&action=edit
The actual result (the bug)

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 57121] corrupted GLSL built-in function results when using Uniform Buffer contents as arguments

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=57121

--- Comment #1 from Tomasz Kaźmierczak  ---
Created attachment 70079
  --> https://bugs.freedesktop.org/attachment.cgi?id=70079&action=edit
The expected result

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 57121] New: corrupted GLSL built-in function results when using Uniform Buffer contents as arguments

2012-11-14 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=57121

  Priority: medium
Bug ID: 57121
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: corrupted GLSL built-in function results when using
Uniform Buffer contents as arguments
  Severity: normal
Classification: Unclassified
OS: Linux (All)
  Reporter: tome...@wp.eu
  Hardware: All
Status: NEW
   Version: 9.0
 Component: Other
   Product: Mesa

In a shader code when I use, for example, the pow() function with uniforms as
arguments, everything is ok if the uniform resides in the default uniform block
(value passed from the client code using the glUniform() function). However, if
the uniform is a part of a named uniform block (comes from a uniform buffer
object, UBO), the result of the pow() function is corrupted.

Please see the screenshots attached to the report. In my code I use the pow()
function for calclulating specular reflection intensity:
float reflectionIntensity = u_SpecularIntensity * pow(reflectionAngle,
u_SpecularHardness);
(the u_SpecularIntensity is a parameter of the material, just as the
u_SpecularHardness; reflectionAngle a local variable)

When both u_SpecularIntensity and u_SpecularHardness are defined inside a named
uniform block and their contents come from a UBO, the data corruption can be
observed - the result is shown on uniform_from_UBO.png (the undesired effect).
But when the u_SpecularHardness is just a "normal" uniform variable and it's
value is set using a glUniform() function, everything is ok (see the
normal_uniform.png file).

It doesn't matter whether the other uniform variable (u_SpecularIntensity)
comes from UBO or not - it never causes any rendering issues. This means that
the problem is only when a UBO uniform variable is used as an argument of a
built-in function (adding, subtracting and multiplying UBO variables seems to
work fine).

In order to check whether this is only an issue of pow(), I've also checked
normalize(). The easiest way was to normalize a diffuse color (a vec4). The
results were similar as in case of pow() (and again, when normalizing a diffuse
color that is passed to the shader using the glUniform() function, everything
is ok).

I've also found out that when I add some value to the u_SpecularHardness, store
the result in a local variable and use that local variable in pow(), then the
corruption is gone (simply assigning the u_SpecularHardness to a local variable
is not enough - it seems like the compiler optimizes-out the variable in such
case and refers directly to the uniform buffer).


Where it happens?

I've noticed this on a system with Intel HD Graphics 3000 (Sandy Bridge) GPU.
I'm not sure whether this is specific to Mesa in general or to the graphics
driver (lsmod says that the driver in use is the i915), therefore I've selected
"Other" as the Mesa component.

On a system with an AMD GPU and the proprietary fglrx driver the bug doesn't
exist, so I'm sure that it's not a problem with my OpenGL client code. I've
also ruled out the possibility that it could be caused by impropper alignment
of data inside the buffer (this happens even if both the uniform buffer and the
uniform block contain only one floating point variable, and I use the std140
layout for all of my uniform blocks).

In my GLSL code I use the following two directives at the beginning of all
files:
#version 130
#extension GL_ARB_uniform_buffer_object : require

It happens in both vertex and fragment shaders.

Some Mesa information:
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile 
OpenGL version string: 3.0 Mesa 9.0
OpenGL shading language version string: 1.30

As mentioned above, the driver in use is i915.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] SI: further simplify SGPR liveness fix

2012-11-14 Thread Michel Dänzer
On Mit, 2012-11-14 at 15:54 +0100, Christian König wrote: 
> Based on already merged v4 of "fix SGPR liveness"

This change causes the following piglit tests to crash for me:

shaders/glsl-fs-atan-2
shaders/glsl-fs-sqrt-branch
spec/glsl-1.10/execution/built-in-functions/fs-atan-vec2-vec2
spec/glsl-1.10/execution/built-in-functions/fs-atan-vec3-vec3
spec/glsl-1.10/execution/built-in-functions/fs-atan-vec4-vec4
spec/glsl-1.10/execution/built-in-functions/fs-op-selection-bool-bvec2-bvec2
spec/glsl-1.10/execution/built-in-functions/fs-op-selection-bool-bvec3-bvec3
spec/glsl-1.10/execution/built-in-functions/fs-op-selection-bool-bvec4-bvec4
spec/glsl-1.10/execution/built-in-functions/vs-atan-vec2-vec2
spec/glsl-1.10/execution/built-in-functions/vs-atan-vec3-vec3
spec/glsl-1.10/execution/built-in-functions/vs-atan-vec4-vec4
spec/glsl-1.10/execution/built-in-functions/vs-op-selection-bool-bvec2-bvec2
spec/glsl-1.10/execution/built-in-functions/vs-op-selection-bool-bvec3-bvec3
spec/glsl-1.10/execution/built-in-functions/vs-op-selection-bool-bvec4-bvec4


There are two failure modes:

1. Returncode: -11 

Errors:
Stack dump:
0.  Running pass 'Function Pass Manager' on module 'tgsi'.
1.  Running pass 'Simple Register Coalescing' on function '@main'

2.  Returncode: -6

Errors:
shader_runner: 
/home/daenzer/src/llvm-git/llvm/lib/CodeGen/LiveInterval.cpp:581: void 
llvm::LiveInterval::mergeIntervalRanges(const llvm::LiveInterval &, 
llvm::VNInfo *, const llvm::VNInfo *): Assertion `R.start >= LastR.end && 
"Cannot overlap two LiveRanges with differing ValID's"' failed.
Stack dump:
0.  Running pass 'Function Pass Manager' on module 'tgsi'.
1.  Running pass 'Simple Register Coalescing' on function '@main'


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] build: fix --without-glut

2012-11-14 Thread Dan Nicholson
On Nov 13, 2012 11:09 PM, "Ross Burton"  wrote:
>
> The argument --without-glut is transformed to --with-glut=no, which the
logic
> wasn't handling at all so --without-glut didn't work.  Rewrite the logic
to
> handle the case where the value passed to --with-glut is "no".
>
> Signed-off-by: Ross Burton 
> ---
>  configure.ac |   26 +++---
>  1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 8b2c359..fda3e60 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
>  DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
>
>  dnl Check for GLUT
> -GLUT_CFLAGS=""
> -GLUT_LIBS=-lglut
> -glut_enabled=yes
> +glut_enabled=no
>  AC_ARG_WITH([glut],
> [AS_HELP_STRING([--with-glut=DIR],
> [glut install directory])],
> [GLUT_CFLAGS="-I$withval/include"
> -GLUT_LIBS="-L$withval/lib -lglut"])
> -AC_CHECK_HEADER([GL/glut.h],
> -   [],
> -   [glut_enabled=no])
> -AC_CHECK_LIB([glut],
> -   [glutInit],
> -   [],
> -   [glut_enabled=no])
> +GLUT_LIBS="-L$withval/lib -lglut"],
> +   [GLUT_CFLAGS=""
> +GLUT_LIBS="-lglut"]
> +)
> +AS_IF([test "x$with_glut" != xno],
> +  [AC_CHECK_HEADER([GL/glut.h],
> +   [],
> +   [glut_enabled=no])
> +   AC_CHECK_LIB([glut],
> +[glutInit],
> +[],
> +[glut_enabled=no])
> +   glut_enabled=yes
> +])

This looks pretty good except that I think you need to temporarily add
GLUT_CFLAGS to CFLAGS and GLUT_LIBS to LIBS so that the user specified
prefix works for AC_CHECK*. On the other hand, at least mesa glut has a
pkg-config file, so it might be easier to just require a glut with glut.pc.
Not sure about the other gluts though.

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


Re: [Mesa-dev] [PATCH] mesa: Fix linker-assigned varying component counting since 8fb1e4a462

2012-11-14 Thread Brian Paul

On 11/13/2012 04:22 PM, Eric Anholt wrote:

The goal of that change was to skip counting things that aren't actually
outputs from the VS to the FS.  However, explicit_location isn't set in
the case of linker-assigned locations (the common case), so basically
varying component counting got disabled.  At this stage of the linker,
we've already ensured that var->location is set, so we can just look at
it without worrying.

Fixes i965 assertion failure with the new
piglit glsl-max-varyings --exceed-limits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51545
---
  src/glsl/linker.cpp |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 86371b5..3b2ab96 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2010,8 +2010,7 @@ is_varying_var(GLenum shaderType, const ir_variable *var)
  {
 /* Only fragment shaders will take a varying variable as an input */
 if (shaderType == GL_FRAGMENT_SHADER&&
-   var->mode == ir_var_in&&
-   var->explicit_location) {
+   var->mode == ir_var_in) {
switch (var->location) {
case FRAG_ATTRIB_WPOS:
case FRAG_ATTRIB_FACE:


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


Re: [Mesa-dev] [PATCH] util: Only use open coded snprintf for MSVC.

2012-11-14 Thread Brian Paul

On 11/14/2012 12:16 AM, Vinson Lee wrote:

MinGW has snprintf.

The patch fixes these warnings with the MinGW SCons build.

src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype 
for ‘util_vsnprintf’ [-Wmissing-prototypes]
src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype 
for ‘util_snprintf’ [-Wmissing-prototypes]

Signed-off-by: Vinson Lee
---
  src/gallium/auxiliary/util/u_snprintf.c |2 +-
  src/gallium/auxiliary/util/u_string.h   |4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_snprintf.c 
b/src/gallium/auxiliary/util/u_snprintf.c
index e16f103..a24b6ff 100644
--- a/src/gallium/auxiliary/util/u_snprintf.c
+++ b/src/gallium/auxiliary/util/u_snprintf.c
@@ -167,7 +167,7 @@
  #if HAVE_CONFIG_H
  #include
  #else
-#ifdef _WIN32
+#ifdef _MSC_VER
  #define vsnprintf util_vsnprintf
  #define snprintf util_snprintf
  #define HAVE_VSNPRINTF 0
diff --git a/src/gallium/auxiliary/util/u_string.h 
b/src/gallium/auxiliary/util/u_string.h
index 15630ad..3d5aba5 100644
--- a/src/gallium/auxiliary/util/u_string.h
+++ b/src/gallium/auxiliary/util/u_string.h
@@ -35,7 +35,7 @@
  #ifndef U_STRING_H_
  #define U_STRING_H_

-#if !defined(_WIN32)&&  !defined(XF86_LIBC_H)
+#if !defined(_MSC_VER)


Are you sure that shouldn't be:

#if !defined(_MSC_VER) && !defined(XF86_LIBC_H)




  #include
  #endif
  #include
@@ -64,7 +64,7 @@ util_strchrnul(const char *s, char c)

  #endif

-#ifdef _WIN32
+#ifdef _MSC_VER

  int util_vsnprintf(char *, size_t, const char *, va_list);
  int util_snprintf(char *str, size_t size, const char *format, ...);


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


[Mesa-dev] [PATCH] SI: further simplify SGPR liveness fix

2012-11-14 Thread Christian König
Based on already merged v4 of "fix SGPR liveness"

Signed-off-by: Christian König 
---
 lib/Target/AMDGPU/AMDGPU.h|4 +-
 lib/Target/AMDGPU/AMDGPUTargetMachine.cpp |   12 ++-
 lib/Target/AMDGPU/SIFixSGPRLiveness.cpp   |  152 +++--
 3 files changed, 89 insertions(+), 79 deletions(-)

diff --git a/lib/Target/AMDGPU/AMDGPU.h b/lib/Target/AMDGPU/AMDGPU.h
index 2a06ade..b51cc90 100644
--- a/lib/Target/AMDGPU/AMDGPU.h
+++ b/lib/Target/AMDGPU/AMDGPU.h
@@ -28,7 +28,9 @@ FunctionPass *createSIAssignInterpRegsPass(TargetMachine &tm);
 FunctionPass *createSILowerControlFlowPass(TargetMachine &tm);
 FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS);
 FunctionPass *createSILowerLiteralConstantsPass(TargetMachine &tm);
-FunctionPass *createSIFixSGPRLivenessPass(TargetMachine &tm);
+
+void initializeSIFixSGPRLivenessPass(PassRegistry &Registry);
+extern char &SIFixSGPRLivenessID;
 
 // Passes common to R600 and SI
 FunctionPass *createAMDGPUConvertToISAPass(TargetMachine &tm);
diff --git a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp 
b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index 5c4af91..67ea931 100644
--- a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -73,7 +73,14 @@ namespace {
 class AMDGPUPassConfig : public TargetPassConfig {
 public:
   AMDGPUPassConfig(AMDGPUTargetMachine *TM, PassManagerBase &PM)
-: TargetPassConfig(TM, PM) {}
+: TargetPassConfig(TM, PM) {
+
+const AMDGPUSubtarget &ST = TM->getSubtarget();
+if (ST.device()->getGeneration() > AMDGPUDeviceInfo::HD6XXX) {
+  initializeSIFixSGPRLivenessPass(*PassRegistry::getPassRegistry());
+  insertPass(&TwoAddressInstructionPassID, &SIFixSGPRLivenessID);
+}
+  }
 
   AMDGPUTargetMachine &getAMDGPUTargetMachine() const {
 return getTM();
@@ -111,9 +118,6 @@ bool AMDGPUPassConfig::addPreRegAlloc() {
 addPass(createSIAssignInterpRegsPass(*TM));
   }
   addPass(createAMDGPUConvertToISAPass(*TM));
-  if (ST.device()->getGeneration() > AMDGPUDeviceInfo::HD6XXX) {
-addPass(createSIFixSGPRLivenessPass(*TM));
-  }
   return false;
 }
 
diff --git a/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp 
b/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp
index 71641d1..77f58f8 100644
--- a/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp
+++ b/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp
@@ -7,17 +7,18 @@
 //
 
//===--===//
 //
-// SGPRs are not affected by control flow. This pass adjust SGPR liveness in
+// SGPRs are not affected by flow control. This pass adjust SGPR liveness in
 // so that the register allocator can still correctly allocate them.
 //
 
//===--===//
 
 #include "AMDGPU.h"
+#include "llvm/ADT/DepthFirstIterator.h"
+#include "llvm/CodeGen/LiveIntervalAnalysis.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/MachineDominators.h"
 #include "llvm/CodeGen/MachinePostDominators.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
 
 using namespace llvm;
 
@@ -25,12 +26,11 @@ namespace {
 
 class SIFixSGPRLiveness : public MachineFunctionPass {
 private:
-  static char ID;
 
-  const TargetInstrInfo *TII;
   MachineRegisterInfo *MRI;
   MachineDominatorTree *MD;
   MachinePostDominatorTree *MPD;
+  LiveIntervals *LI;
 
   bool isSGPR(const TargetRegisterClass *RegClass)
   {
@@ -41,15 +41,19 @@ private:
RegClass == &AMDGPU::SReg_256RegClass;
   }
 
-  void addKill(MachineBasicBlock::iterator I, unsigned Reg);
-  MachineBasicBlock *handleUses(unsigned VirtReg, MachineBasicBlock *Begin);
-  void handlePreds(MachineBasicBlock *Begin, MachineBasicBlock *End,
-   unsigned VirtReg);
+  void getBegin(unsigned VirtReg, MachineInstr *&BeginDef,
+MachineBasicBlock *&Begin);
+
+  void getEnd(unsigned VirtReg, bool &EndUses,
+  MachineBasicBlock *&End);
 
-  bool handleVirtReg(unsigned VirtReg);
+  void handleVirtReg(unsigned VirtReg);
 
 public:
-  SIFixSGPRLiveness(TargetMachine &tm);
+  static char ID;
+
+  SIFixSGPRLiveness():
+MachineFunctionPass(ID) {}
 
   virtual bool runOnMachineFunction(MachineFunction &MF);
 
@@ -63,35 +67,59 @@ public:
 } // end anonymous namespace
 
 char SIFixSGPRLiveness::ID = 0;
+char &llvm::SIFixSGPRLivenessID = SIFixSGPRLiveness::ID;
 
-SIFixSGPRLiveness::SIFixSGPRLiveness(TargetMachine &tm):
-  MachineFunctionPass(ID),
-  TII(tm.getInstrInfo())
-{
-  initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
-}
+INITIALIZE_PASS(SIFixSGPRLiveness, "sifixsgprliveness",
+"SI fix SGPR liveness pass", false, false)
 
 void SIFixSGPRLiveness::getAnalysisUsage(AnalysisUsage &AU) const
 {
+  AU.setPreservesAll();
   AU.addRequired();
   AU.addRequired();
-  AU.setPreservesCFG();
+  AU.addRequired();
   MachineFunctionPass::getAnalysisUsage(AU);
 }
 
-void SIF

Re: [Mesa-dev] mesa : ARB_texture_gather implementation - WIP[PATCH1/1] but need advice !

2012-11-14 Thread Brian Paul

On 11/13/2012 05:02 PM, Kenneth Graunke wrote:

On 11/13/2012 01:44 PM, Maxence Le Doré wrote:
[snip]

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 89c516c..5d5b56d 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1334,7 +1334,8 @@ enum ir_texture_opcode {
ir_txl, /**< Texture look-up with explicit LOD */
ir_txd, /**< Texture look-up with partial derivatvies */
ir_txf, /**< Texel fetch with explicit LOD */
- ir_txs /**< Texture size */
+ ir_txs, /**< Texture size */
+ ir_txg /**< Texture gathering */
};


Or ir_tex_gather.

 Most of the shorter names got picked because the matched
existing, well known, assembly opcodes.
 I don't think that applies here.

Up to you.


FWIW, NVIDIA uses TXG for GL_NV_gpu_program5.  Not sure about TXS.

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


Re: [Mesa-dev] [PATCH] SI: Use IMAGE_SAMPLE_L for the SI.sample.lod intrinsic.

2012-11-14 Thread Alex Deucher
On Wed, Nov 14, 2012 at 6:39 AM, Michel Dänzer  wrote:
> From: Michel Dänzer 
>
>
> Signed-off-by: Michel Dänzer 

Reviewed-by: Alex Deucher 

> ---
>  lib/Target/AMDGPU/SIInstructions.td |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/Target/AMDGPU/SIInstructions.td 
> b/lib/Target/AMDGPU/SIInstructions.td
> index 8512b48..97d2faa 100644
> --- a/lib/Target/AMDGPU/SIInstructions.td
> +++ b/lib/Target/AMDGPU/SIInstructions.td
> @@ -497,7 +497,7 @@ def IMAGE_SAMPLE : MIMG_Load_Helper <0x0020, 
> "IMAGE_SAMPLE">;
>  //def IMAGE_SAMPLE_CL : MIMG_NoPattern_ <"IMAGE_SAMPLE_CL", 0x0021>;
>  def IMAGE_SAMPLE_D : MIMG_Load_Helper <0x0022, "IMAGE_SAMPLE_D">;
>  //def IMAGE_SAMPLE_D_CL : MIMG_NoPattern_ <"IMAGE_SAMPLE_D_CL", 0x0023>;
> -//def IMAGE_SAMPLE_L : MIMG_NoPattern_ <"IMAGE_SAMPLE_L", 0x0024>;
> +def IMAGE_SAMPLE_L : MIMG_Load_Helper <0x0024, "IMAGE_SAMPLE_L">;
>  def IMAGE_SAMPLE_B : MIMG_Load_Helper <0x0025, "IMAGE_SAMPLE_B">;
>  //def IMAGE_SAMPLE_B_CL : MIMG_NoPattern_ <"IMAGE_SAMPLE_B_CL", 0x0026>;
>  //def IMAGE_SAMPLE_LZ : MIMG_NoPattern_ <"IMAGE_SAMPLE_LZ", 0x0027>;
> @@ -1134,7 +1134,7 @@ def : Pat <
>  /* int_SI_sample_lod */
>  def : Pat <
>(int_SI_sample_lod imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, 
> SReg_128:$sampler),
> -  (IMAGE_SAMPLE_D imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
> +  (IMAGE_SAMPLE_L imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
>SReg_256:$rsrc, SReg_128:$sampler)
>  >;
>
> --
> 1.7.10.4
>
> ___
> 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] SI: fix SGPR liveness v5

2012-11-14 Thread Michel Dänzer
On Mit, 2012-11-14 at 14:18 +0100, Christian König wrote: 
> SGPRs are not affected by control flow.
> 
> v2: don't use liveness analyse any more, handle partial
> dominated end notes.
> v3: fix old pass name in CMakeLists.txt
> v4: remove unnecessary successor handling and kill handling
> v5: adjust live analysis directly

Tom merged the v4 patch, so you should rebase this on top of that.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast |  Debian, X and DRI developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] SI: fix SGPR liveness v5

2012-11-14 Thread Christian König
SGPRs are not affected by control flow.

v2: don't use liveness analyse any more, handle partial
dominated end notes.
v3: fix old pass name in CMakeLists.txt
v4: remove unnecessary successor handling and kill handling
v5: adjust live analysis directly

Signed-off-by: Christian König 
---
 lib/Target/AMDGPU/AMDGPU.h|3 +
 lib/Target/AMDGPU/AMDGPUTargetMachine.cpp |9 +-
 lib/Target/AMDGPU/CMakeLists.txt  |1 +
 lib/Target/AMDGPU/SIFixSGPRLiveness.cpp   |  190 +
 4 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 lib/Target/AMDGPU/SIFixSGPRLiveness.cpp

diff --git a/lib/Target/AMDGPU/AMDGPU.h b/lib/Target/AMDGPU/AMDGPU.h
index c722d04..95625d2 100644
--- a/lib/Target/AMDGPU/AMDGPU.h
+++ b/lib/Target/AMDGPU/AMDGPU.h
@@ -29,6 +29,9 @@ FunctionPass *createSILowerFlowControlPass(TargetMachine &tm);
 FunctionPass *createSICodeEmitterPass(formatted_raw_ostream &OS);
 FunctionPass *createSILowerLiteralConstantsPass(TargetMachine &tm);
 
+void initializeSIFixSGPRLivenessPass(PassRegistry &Registry);
+extern char &SIFixSGPRLivenessID;
+
 // Passes common to R600 and SI
 FunctionPass *createAMDGPUConvertToISAPass(TargetMachine &tm);
 
diff --git a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp 
b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index dd4b733..cf4006e 100644
--- a/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -73,7 +73,14 @@ namespace {
 class AMDGPUPassConfig : public TargetPassConfig {
 public:
   AMDGPUPassConfig(AMDGPUTargetMachine *TM, PassManagerBase &PM)
-: TargetPassConfig(TM, PM) {}
+: TargetPassConfig(TM, PM) {
+
+const AMDGPUSubtarget &ST = TM->getSubtarget();
+if (ST.device()->getGeneration() > AMDGPUDeviceInfo::HD6XXX) {
+  initializeSIFixSGPRLivenessPass(*PassRegistry::getPassRegistry());
+  insertPass(&TwoAddressInstructionPassID, &SIFixSGPRLivenessID);
+}
+  }
 
   AMDGPUTargetMachine &getAMDGPUTargetMachine() const {
 return getTM();
diff --git a/lib/Target/AMDGPU/CMakeLists.txt b/lib/Target/AMDGPU/CMakeLists.txt
index 6bb7ba0..2a1f052 100644
--- a/lib/Target/AMDGPU/CMakeLists.txt
+++ b/lib/Target/AMDGPU/CMakeLists.txt
@@ -44,6 +44,7 @@ add_llvm_target(AMDGPUCodeGen
   SILowerFlowControl.cpp
   SIMachineFunctionInfo.cpp
   SIRegisterInfo.cpp
+  SIFixSGPRLiveness.cpp
   )
 
 add_dependencies(LLVMAMDGPUCodeGen intrinsics_gen)
diff --git a/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp 
b/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp
new file mode 100644
index 000..77f58f8
--- /dev/null
+++ b/lib/Target/AMDGPU/SIFixSGPRLiveness.cpp
@@ -0,0 +1,190 @@
+//===-- SIFixSGPRLiveness.cpp - SGPR liveness adjustment 
--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+//
+// SGPRs are not affected by flow control. This pass adjust SGPR liveness in
+// so that the register allocator can still correctly allocate them.
+//
+//===--===//
+
+#include "AMDGPU.h"
+#include "llvm/ADT/DepthFirstIterator.h"
+#include "llvm/CodeGen/LiveIntervalAnalysis.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/MachineDominators.h"
+#include "llvm/CodeGen/MachinePostDominators.h"
+
+using namespace llvm;
+
+namespace {
+
+class SIFixSGPRLiveness : public MachineFunctionPass {
+private:
+
+  MachineRegisterInfo *MRI;
+  MachineDominatorTree *MD;
+  MachinePostDominatorTree *MPD;
+  LiveIntervals *LI;
+
+  bool isSGPR(const TargetRegisterClass *RegClass)
+  {
+return RegClass == &AMDGPU::SReg_1RegClass ||
+   RegClass == &AMDGPU::SReg_32RegClass ||
+   RegClass == &AMDGPU::SReg_64RegClass ||
+   RegClass == &AMDGPU::SReg_128RegClass ||
+   RegClass == &AMDGPU::SReg_256RegClass;
+  }
+
+  void getBegin(unsigned VirtReg, MachineInstr *&BeginDef,
+MachineBasicBlock *&Begin);
+
+  void getEnd(unsigned VirtReg, bool &EndUses,
+  MachineBasicBlock *&End);
+
+  void handleVirtReg(unsigned VirtReg);
+
+public:
+  static char ID;
+
+  SIFixSGPRLiveness():
+MachineFunctionPass(ID) {}
+
+  virtual bool runOnMachineFunction(MachineFunction &MF);
+
+  virtual const char *getPassName() const {
+return "SI fix SGPR liveness pass";
+  }
+
+  virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+};
+
+} // end anonymous namespace
+
+char SIFixSGPRLiveness::ID = 0;
+char &llvm::SIFixSGPRLivenessID = SIFixSGPRLiveness::ID;
+
+INITIALIZE_PASS(SIFixSGPRLiveness, "sifixsgprliveness",
+"SI fix SGPR liveness pass", false, false)
+
+void SIFixSGPRLiveness::getAnalysisUsage(AnalysisUsage &AU) const
+{
+  AU.setPreservesAll();
+  AU.addRequired();

[Mesa-dev] [PATCH] SI: Use IMAGE_SAMPLE_L for the SI.sample.lod intrinsic.

2012-11-14 Thread Michel Dänzer
From: Michel Dänzer 


Signed-off-by: Michel Dänzer 
---
 lib/Target/AMDGPU/SIInstructions.td |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Target/AMDGPU/SIInstructions.td 
b/lib/Target/AMDGPU/SIInstructions.td
index 8512b48..97d2faa 100644
--- a/lib/Target/AMDGPU/SIInstructions.td
+++ b/lib/Target/AMDGPU/SIInstructions.td
@@ -497,7 +497,7 @@ def IMAGE_SAMPLE : MIMG_Load_Helper <0x0020, 
"IMAGE_SAMPLE">;
 //def IMAGE_SAMPLE_CL : MIMG_NoPattern_ <"IMAGE_SAMPLE_CL", 0x0021>;
 def IMAGE_SAMPLE_D : MIMG_Load_Helper <0x0022, "IMAGE_SAMPLE_D">;
 //def IMAGE_SAMPLE_D_CL : MIMG_NoPattern_ <"IMAGE_SAMPLE_D_CL", 0x0023>;
-//def IMAGE_SAMPLE_L : MIMG_NoPattern_ <"IMAGE_SAMPLE_L", 0x0024>;
+def IMAGE_SAMPLE_L : MIMG_Load_Helper <0x0024, "IMAGE_SAMPLE_L">;
 def IMAGE_SAMPLE_B : MIMG_Load_Helper <0x0025, "IMAGE_SAMPLE_B">;
 //def IMAGE_SAMPLE_B_CL : MIMG_NoPattern_ <"IMAGE_SAMPLE_B_CL", 0x0026>;
 //def IMAGE_SAMPLE_LZ : MIMG_NoPattern_ <"IMAGE_SAMPLE_LZ", 0x0027>;
@@ -1134,7 +1134,7 @@ def : Pat <
 /* int_SI_sample_lod */
 def : Pat <
   (int_SI_sample_lod imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, 
SReg_128:$sampler),
-  (IMAGE_SAMPLE_D imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
+  (IMAGE_SAMPLE_L imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
   SReg_256:$rsrc, SReg_128:$sampler)
 >;
 
-- 
1.7.10.4

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


[Mesa-dev] [PATCH 3/3] AMDGPU: Fix name of SI control flow lowering source file.

2012-11-14 Thread Michel Dänzer
From: Michel Dänzer 


Signed-off-by: Michel Dänzer 
---
 lib/Target/AMDGPU/CMakeLists.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Target/AMDGPU/CMakeLists.txt b/lib/Target/AMDGPU/CMakeLists.txt
index 2a1f052..b6b3417 100644
--- a/lib/Target/AMDGPU/CMakeLists.txt
+++ b/lib/Target/AMDGPU/CMakeLists.txt
@@ -41,7 +41,7 @@ add_llvm_target(AMDGPUCodeGen
   SIInstrInfo.cpp
   SIISelLowering.cpp
   SILowerLiteralConstants.cpp
-  SILowerFlowControl.cpp
+  SILowerControlFlow.cpp
   SIMachineFunctionInfo.cpp
   SIRegisterInfo.cpp
   SIFixSGPRLiveness.cpp
-- 
1.7.10.4

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


[Mesa-dev] [PATCH RESEND 1/3] AMDGPU: Fix string concatenation in AMDGPUInstPrinter::printRel().

2012-11-14 Thread Michel Dänzer
From: Michel Dänzer 

Pointed out by compiler warning:

/home/daenzer/src/llvm-git/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp:96:16:
 warning: adding 'int64_t' (aka 'long') to a string does not append to the 
string [-Wstring-plus-int]
O << " + " + Op.getImm();
 ~~^
/home/daenzer/src/llvm-git/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp:96:16:
 note: use array indexing to silence this warning
O << " + " + Op.getImm();
   ^
 & []
1 warning generated.

Signed-off-by: Michel Dänzer 
---

Is this what was intended?

 lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp 
b/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
index fe2032e..546aff8 100644
--- a/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
+++ b/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp
@@ -93,7 +93,7 @@ void AMDGPUInstPrinter::printRel(const MCInst *MI, unsigned 
OpNo,
  raw_ostream &O) {
   const MCOperand &Op = MI->getOperand(OpNo);
   if (Op.getImm() != 0) {
-O << " + " + Op.getImm();
+O << " + " << Op.getImm();
   }
 }
 
-- 
1.7.10.4

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


[Mesa-dev] [PATCH 0/3] AMDGPU: Resending missed changes.

2012-11-14 Thread Michel Dänzer
Resending (parts of) some patches which seem to have been missed.

[PATCH RESEND 1/3] AMDGPU: Fix string concatenation in
[PATCH RESEND 2/3] AMDGPU: Don't allow using SI SGPRs 102 and 103 directly.
[PATCH 3/3] AMDGPU: Fix name of SI control flow lowering source
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH RESEND 2/3] AMDGPU: Don't allow using SI SGPRs 102 and 103 directly.

2012-11-14 Thread Michel Dänzer
From: Michel Dänzer 

Two SGPRs are used for VCC, so it's not possible to use these and VCC
together.

Signed-off-by: Michel Dänzer 
---
 lib/Target/AMDGPU/SIRegisterInfo.td |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Target/AMDGPU/SIRegisterInfo.td 
b/lib/Target/AMDGPU/SIRegisterInfo.td
index a3d91ae..e52311a 100644
--- a/lib/Target/AMDGPU/SIRegisterInfo.td
+++ b/lib/Target/AMDGPU/SIRegisterInfo.td
@@ -65,12 +65,12 @@ def SAMPLE_COVERAGE : SIReg <"SAMPLE_COVERAGE">;
 def POS_FIXED_PT : SIReg <"POS_FIXED_PT">;
 
 // SGPR 32-bit registers
-foreach Index = 0-103 in {
+foreach Index = 0-101 in {
   def SGPR#Index : SGPR_32 ;
 }
 
 def SGPR_32 : RegisterClass<"AMDGPU", [f32, i32], 32,
-(add (sequence "SGPR%u", 0, 103))>;
+(add (sequence "SGPR%u", 0, 101))>;
 
 // SGPR 64-bit registers
 def SGPR_64 : RegisterTuples<[low, high],
-- 
1.7.10.4

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


Re: [Mesa-dev] [PATCH V3 13/13] intel: Enable ETC2 support on intel hardware

2012-11-14 Thread Eric Anholt
Anuj Phogat  writes:

> This patch enables support for ETC2 compressed textures on
> all intel hardware. At present, ETC2 texture decoding is not
> available on intel hardware. So, compressed ETC2 texture data
> is decoded in software and stored in a suitable uncompressed
> MESA_FORMAT at the time of glCompressedTexImage2D. Currently,
> ETC2 formats are only exposed in OpenGL ES 3.0.
>
> V2: Use single etc_wraps variable for both etc1 and etc2.
> V3: Remove redundant code and use just one intel_miptree_map_etc()
> and intel_miptree_unmap_etc() function.
> Signed-off-by: Anuj Phogat 

Given that we support x/y offsets anyway, the asserts for map->x/y == 0
and the justification for it could be dropped.  But either way.

Reviewed-by: Eric Anholt 


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


Re: [Mesa-dev] [PATCH 4/5] i965: Remove some dead code optimization passes.

2012-11-14 Thread Eric Anholt
Here I thought you were going to remove some dead-code-optimization
passes.

This series is:

Reviewed-by: Eric Anholt 


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


Re: [Mesa-dev] [PATCH 5/5] i965: Remove brw_instruction_info::is_arith().

2012-11-14 Thread Eric Anholt
Kenneth Graunke  writes:

> Nobody uses it.

For bonus points, this could used the extern opcode_descs[] now that
this was originally copied from.

Patch 8/5?


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