summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-10-01 13:35:42 -0600
committerBrian Paul <brianp@vmware.com>2009-10-01 13:35:42 -0600
commit5d2413fca4c252ec5c7880fa7f983b5df3d762ba (patch)
tree28d9fb9fc5724b65579f06fc9258461f9c7fc47f
parent15c57648cd87d344777e3aafa79a9be970b83979 (diff)
parent18883cdf2334511005973155fc517eb678dc0043 (diff)
Merge branch 'mesa_7_6_branch'
-rw-r--r--docs/relnotes-7.6.1.html2
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c8
-rw-r--r--src/glx/x11/glxcmds.c31
-rw-r--r--src/mesa/drivers/dri/i965/brw_state.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_cache.c49
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c16
-rw-r--r--src/mesa/drivers/x11/fakeglx.c4
-rw-r--r--src/mesa/shader/prog_execute.c2
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin.gc76
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin_gc.h106
-rw-r--r--src/mesa/shader/slang/slang_codegen.c1
-rw-r--r--src/mesa/shader/slang/slang_emit.c1
-rw-r--r--src/mesa/shader/slang/slang_ir.c1
-rw-r--r--src/mesa/shader/slang/slang_ir.h1
14 files changed, 197 insertions, 102 deletions
diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html
index 584a2de926..3271f47989 100644
--- a/docs/relnotes-7.6.1.html
+++ b/docs/relnotes-7.6.1.html
@@ -38,6 +38,8 @@ tbd
<h2>Bug fixes</h2>
<ul>
<li>Fixed crash caused by glXCopyContext() and glXDestroyContext(), bug 24217
+<li>glXQueryContext(GLX_RENDER_TYPE) returned wrong values (bug 24211)
+<li>GLSL sqrt(0) returned unpredictable results
</ul>
</body>
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index d1a98f8991..65012e9253 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -1538,9 +1538,9 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
if (!fbconfig)
return GLX_BAD_ATTRIBUTE;
if (xmvis->mesa_visual.rgbMode)
- *value = GLX_RGBA_BIT;
+ *value = GLX_RGBA_TYPE;
else
- *value = GLX_COLOR_INDEX_BIT;
+ *value = GLX_COLOR_INDEX_TYPE;
break;
case GLX_X_RENDERABLE_SGIX:
if (!fbconfig)
@@ -2120,9 +2120,9 @@ glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value )
break;
case GLX_RENDER_TYPE:
if (xmctx->xm_visual->mesa_visual.rgbMode)
- *value = GLX_RGBA_BIT;
+ *value = GLX_RGBA_TYPE;
else
- *value = GLX_COLOR_INDEX_BIT;
+ *value = GLX_COLOR_INDEX_TYPE;
break;
case GLX_SCREEN:
*value = 0;
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index ea55cc49ef..cd4aede74e 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -398,6 +398,10 @@ CreateContext(Display * dpy, XVisualInfo * vis,
_XError(dpy, &error);
return None;
}
+ if (renderType == 0) {
+ /* Initialize renderType now */
+ renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE;
+ }
}
else {
mode = fbconfig;
@@ -484,6 +488,8 @@ CreateContext(Display * dpy, XVisualInfo * vis,
gc->imported = GL_TRUE;
}
+ gc->renderType = renderType;
+
return gc;
}
@@ -1575,7 +1581,7 @@ GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (),
* This function dynamically determines whether to use the EXT_import_context
* version of the protocol or the GLX 1.3 version of the protocol.
*/
- static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
+static int __glXQueryContextInfo(Display * dpy, GLXContext ctx)
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
xGLXQueryContextReply reply;
@@ -1713,7 +1719,7 @@ GLX_ALIAS(int, glXQueryContextInfoEXT,
(Display * dpy, GLXContext ctx, int attribute, int *value),
(dpy, ctx, attribute, value), glXQueryContext)
- PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
+PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx)
{
return ctx->xid;
}
@@ -2159,18 +2165,19 @@ GLX_ALIAS(int, glXGetFBConfigAttribSGIX,
(Display * dpy, GLXFBConfigSGIX config, int attribute, int *value),
(dpy, config, attribute, value), glXGetFBConfigAttrib)
- PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
- (Display * dpy, int screen, int *attrib_list,
- int *nelements), (dpy, screen, attrib_list, nelements),
- glXChooseFBConfig)
+PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX,
+ (Display * dpy, int screen, int *attrib_list,
+ int *nelements), (dpy, screen, attrib_list, nelements),
+ glXChooseFBConfig)
- PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
- (Display * dpy, GLXFBConfigSGIX config),
- (dpy, config), glXGetVisualFromFBConfig)
+PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX,
+ (Display * dpy, GLXFBConfigSGIX config),
+ (dpy, config), glXGetVisualFromFBConfig)
- PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
- GLXFBConfigSGIX config,
- Pixmap pixmap)
+PUBLIC GLXPixmap
+glXCreateGLXPixmapWithConfigSGIX(Display * dpy,
+ GLXFBConfigSGIX config,
+ Pixmap pixmap)
{
xGLXVendorPrivateWithReplyReq *vpreq;
xGLXCreateGLXPixmapWithConfigSGIXReq *req;
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index 5335eac895..d639656b9d 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -151,6 +151,7 @@ void brw_state_cache_check_size( struct brw_context *brw );
void brw_init_caches( struct brw_context *brw );
void brw_destroy_caches( struct brw_context *brw );
+void brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo);
/***********************************************************************
* brw_state_batch.c
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index e40d7a0416..f8e46aacf7 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -517,6 +517,55 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache)
brw->state.dirty.cache |= ~0;
}
+/* Clear all entries from the cache that point to the given bo.
+ *
+ * This lets us release memory for reuse earlier for known-dead buffers,
+ * at the cost of walking the entire hash table.
+ */
+void
+brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo)
+{
+ struct brw_cache_item **prev;
+ GLuint i;
+
+ if (INTEL_DEBUG & DEBUG_STATE)
+ _mesa_printf("%s\n", __FUNCTION__);
+
+ for (i = 0; i < cache->size; i++) {
+ for (prev = &cache->items[i]; *prev;) {
+ struct brw_cache_item *c = *prev;
+ int j;
+
+ for (j = 0; j < c->nr_reloc_bufs; j++) {
+ if (c->reloc_bufs[j] == bo)
+ break;
+ }
+
+ if (j != c->nr_reloc_bufs) {
+
+ *prev = c->next;
+
+ for (j = 0; j < c->nr_reloc_bufs; j++)
+ dri_bo_unreference(c->reloc_bufs[j]);
+ dri_bo_unreference(c->bo);
+ free((void *)c->key);
+ free(c);
+ cache->n_items--;
+
+ /* Delete up the tree. Notably we're trying to get from
+ * a request to delete the surface, to deleting the surface state
+ * object, to deleting the binding table. We're slack and restart
+ * the deletion process when we do this because the other delete
+ * may kill our *prev.
+ */
+ brw_state_cache_bo_delete(cache, c->bo);
+ prev = &cache->items[i];
+ } else {
+ prev = &(*prev)->next;
+ }
+ }
+ }
+}
void
brw_state_cache_check_size(struct brw_context *brw)
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index c985da5aa2..4f5101a312 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -29,6 +29,9 @@
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
#include "intel_chipset.h"
+#ifndef I915
+#include "brw_state.h"
+#endif
#include "main/enums.h"
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
@@ -269,6 +272,19 @@ intel_miptree_release(struct intel_context *intel,
DBG("%s deleting %p\n", __FUNCTION__, *mt);
+#ifndef I915
+ /* Free up cached binding tables holding a reference on our buffer, to
+ * avoid excessive memory consumption.
+ *
+ * This isn't as aggressive as we could be, as we'd like to do
+ * it from any time we free the last ref on a region. But intel_region.c
+ * is context-agnostic. Perhaps our constant state cache should be, as
+ * well.
+ */
+ brw_state_cache_bo_delete(&brw_context(&intel->ctx)->surface_cache,
+ (*mt)->region->buffer);
+#endif
+
intel_region_release(&((*mt)->region));
for (i = 0; i < MAX_TEXTURE_LEVELS; i++)
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 34e0b8bc8d..eb7c4f6417 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -2477,9 +2477,9 @@ Fake_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value )
break;
case GLX_RENDER_TYPE:
if (xmctx->xm_visual->mesa_visual.rgbMode)
- *value = GLX_RGBA_BIT;
+ *value = GLX_RGBA_TYPE;
else
- *value = GLX_COLOR_INDEX_BIT;
+ *value = GLX_COLOR_INDEX_TYPE;
break;
case GLX_SCREEN:
*value = 0;
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index 69b81e724a..192d39aed1 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -939,7 +939,7 @@ _mesa_execute_program(GLcontext * ctx,
/* The fast LOG2 macro doesn't meet the precision requirements.
*/
if (a[0] == 0.0F) {
- val = 0.0F;
+ val = -FLT_MAX;
}
else {
val = log(a[0]) * 1.442695F;
diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc
index 9764fc25b0..56de47ee8d 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin.gc
+++ b/src/mesa/shader/slang/library/slang_common_builtin.gc
@@ -602,42 +602,50 @@ vec4 exp2(const vec4 a)
float sqrt(const float x)
{
+ const float nx = -x;
float r;
__asm float_rsq r, x;
- __asm float_rcp __retVal, r;
-}
-
-vec2 sqrt(const vec2 v)
-{
- float r;
- __asm float_rsq r, v.x;
- __asm float_rcp __retVal.x, r;
- __asm float_rsq r, v.y;
- __asm float_rcp __retVal.y, r;
-}
-
-vec3 sqrt(const vec3 v)
-{
- float r;
- __asm float_rsq r, v.x;
- __asm float_rcp __retVal.x, r;
- __asm float_rsq r, v.y;
- __asm float_rcp __retVal.y, r;
- __asm float_rsq r, v.z;
- __asm float_rcp __retVal.z, r;
-}
-
-vec4 sqrt(const vec4 v)
-{
- float r;
- __asm float_rsq r, v.x;
- __asm float_rcp __retVal.x, r;
- __asm float_rsq r, v.y;
- __asm float_rcp __retVal.y, r;
- __asm float_rsq r, v.z;
- __asm float_rcp __retVal.z, r;
- __asm float_rsq r, v.w;
- __asm float_rcp __retVal.w, r;
+ __asm float_rcp r, r;
+ __asm vec4_cmp __retVal, nx, r, 0.0;
+}
+
+vec2 sqrt(const vec2 x)
+{
+ const vec2 nx = -x, zero = vec2(0.0);
+ vec2 r;
+ __asm float_rsq r.x, x.x;
+ __asm float_rsq r.y, x.y;
+ __asm float_rcp r.x, r.x;
+ __asm float_rcp r.y, r.y;
+ __asm vec4_cmp __retVal, nx, r, zero;
+}
+
+vec3 sqrt(const vec3 x)
+{
+ const vec3 nx = -x, zero = vec3(0.0);
+ vec3 r;
+ __asm float_rsq r.x, x.x;
+ __asm float_rsq r.y, x.y;
+ __asm float_rsq r.z, x.z;
+ __asm float_rcp r.x, r.x;
+ __asm float_rcp r.y, r.y;
+ __asm float_rcp r.z, r.z;
+ __asm vec4_cmp __retVal, nx, r, zero;
+}
+
+vec4 sqrt(const vec4 x)
+{
+ const vec4 nx = -x, zero = vec4(0.0);
+ vec4 r;
+ __asm float_rsq r.x, x.x;
+ __asm float_rsq r.y, x.y;
+ __asm float_rsq r.z, x.z;
+ __asm float_rsq r.w, x.w;
+ __asm float_rcp r.x, r.x;
+ __asm float_rcp r.y, r.y;
+ __asm float_rcp r.z, r.z;
+ __asm float_rcp r.w, r.w;
+ __asm vec4_cmp __retVal, nx, r, zero;
}
diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h
index 78a7b83ec1..3c3666e4ea 100644
--- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h
+++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h
@@ -307,55 +307,63 @@
0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,
59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,
97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114,116,0,1,1,0,0,9,0,120,0,0,
-0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,
-102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,
-10,0,0,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,
-116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,
-95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,
-0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,
-121,0,0,18,114,0,0,0,0,1,90,95,0,0,11,0,0,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,
-9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,
-111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,
-97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,
-95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,
-0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,
-122,0,0,18,114,0,0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,
-9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,
-111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,
-97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,
-95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,
-0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,
-122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102,
-108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,90,95,
-0,0,9,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,
-116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,
-105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114,
-115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,
-95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0,
-11,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,
-95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,
-97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,
-108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,
-0,1,90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102,
-108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,
-4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,
-0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,
-59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,
-118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0,
-1,9,18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97,
-108,105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115,
-101,115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,
-117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,
-0,0,0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,
-0,9,0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,
-0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,
-95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,
-0,18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118,
-0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,
-18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,
-0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,
-121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1,
-4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,
+0,1,3,2,90,95,1,0,9,0,1,110,120,0,2,18,120,0,54,0,0,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,
+116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,0,18,
+114,0,0,0,4,118,101,99,52,95,99,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,
+0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,10,0,0,115,113,114,116,0,1,1,0,0,10,0,120,0,0,0,1,3,2,90,95,1,
+0,10,0,1,110,120,0,2,18,120,0,54,0,1,1,122,101,114,111,0,2,58,118,101,99,50,0,0,17,48,0,48,0,0,0,0,
+0,0,3,2,90,95,0,0,10,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,
+120,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,
+4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0,18,114,0,59,120,0,0,0,4,102,108,111,97,
+116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0,0,4,118,101,99,52,95,99,109,112,0,18,
+95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,
+11,0,0,115,113,114,116,0,1,1,0,0,11,0,120,0,0,0,1,3,2,90,95,1,0,11,0,1,110,120,0,2,18,120,0,54,0,1,
+1,122,101,114,111,0,2,58,118,101,99,51,0,0,17,48,0,48,0,0,0,0,0,0,3,2,90,95,0,0,11,0,1,114,0,0,0,4,
+102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,120,0,59,120,0,0,0,4,102,108,111,97,116,
+95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,
+18,114,0,59,122,0,0,18,120,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0,
+18,114,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0,
+0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,122,0,0,18,114,0,59,122,0,0,0,4,118,101,99,52,
+95,99,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,
+0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,120,0,0,0,1,3,2,90,95,1,0,12,0,1,110,120,0,
+2,18,120,0,54,0,1,1,122,101,114,111,0,2,58,118,101,99,52,0,0,17,48,0,48,0,0,0,0,0,0,3,2,90,95,0,0,
+12,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,120,0,59,120,0,0,0,4,
+102,108,111,97,116,95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,4,102,108,111,97,116,
+95,114,115,113,0,18,114,0,59,122,0,0,18,120,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,
+18,114,0,59,119,0,0,18,120,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0,
+18,114,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0,
+0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,122,0,0,18,114,0,59,122,0,0,0,4,102,108,111,97,
+116,95,114,99,112,0,18,114,0,59,119,0,0,18,114,0,59,119,0,0,0,4,118,101,99,52,95,99,109,112,0,18,
+95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,9,
+0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,
+114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,105,
+110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114,115,
+113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,
+114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0,11,0,
+0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,95,
+114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,
+116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,
+111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1,
+90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108,
+111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,
+102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,
+0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,
+122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,
+0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0,1,9,
+18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97,108,
+105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115,101,
+115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,117,
+108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,0,0,
+0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,9,
+0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,
+4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,
+109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,
+18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118,0,
+0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18,
+118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,
+4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,
+122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1,4,
+118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,
97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,
0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,
52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12,
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 703af9f874..344dfdc680 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -422,6 +422,7 @@ static slang_asm_info AsmInfo[] = {
{ "vec4_lrp", IR_LRP, 1, 3 },
{ "vec4_min", IR_MIN, 1, 2 },
{ "vec4_max", IR_MAX, 1, 2 },
+ { "vec4_cmp", IR_CMP, 1, 3 },
{ "vec4_clamp", IR_CLAMP, 1, 3 },
{ "vec4_seq", IR_SEQUAL, 1, 2 },
{ "vec4_sne", IR_SNEQUAL, 1, 2 },
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 3f455e0640..3af301eacd 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -2287,6 +2287,7 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n)
case IR_POW:
/* trinary operators */
case IR_LRP:
+ case IR_CMP:
return emit_arith(emitInfo, n);
case IR_EQUAL:
diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c
index 1c7f7474e7..62603503dd 100644
--- a/src/mesa/shader/slang/slang_ir.c
+++ b/src/mesa/shader/slang/slang_ir.c
@@ -80,6 +80,7 @@ static const slang_ir_info IrInfo[] = {
{ IR_NOISE4, "IR_NOISE4", OPCODE_NOISE4, 1, 1 },
/* other */
+ { IR_CMP, "IR_CMP", OPCODE_CMP, 4, 3 }, /* compare/select */
{ IR_SEQ, "IR_SEQ", OPCODE_NOP, 0, 0 },
{ IR_SCOPE, "IR_SCOPE", OPCODE_NOP, 0, 0 },
{ IR_LABEL, "IR_LABEL", OPCODE_NOP, 0, 0 },
diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h
index e796693ed5..166b4e8043 100644
--- a/src/mesa/shader/slang/slang_ir.h
+++ b/src/mesa/shader/slang/slang_ir.h
@@ -91,6 +91,7 @@ typedef enum
IR_CLAMP,
IR_MIN,
IR_MAX,
+ IR_CMP, /* = (op0 < 0) ? op1 : op2 */
IR_SEQUAL, /* Set if args are equal (vector) */
IR_SNEQUAL, /* Set if args are not equal (vector) */
IR_SGE, /* Set if greater or equal (vector) */