Merge commit 'origin/7.8'
[mesa.git] / src / gallium / drivers / i915 / i915_state_sampler.c
index d6da82254907dfd386ba11a3ad98eb6a3100efde..73e61b662405f9be4d2cc64cce6d66fd20190502 100644 (file)
@@ -32,6 +32,7 @@
 #include "i915_context.h"
 #include "i915_reg.h"
 #include "i915_state.h"
+#include "i915_resource.h"
 
 
 /*
@@ -77,7 +78,7 @@ static void update_sampler(struct i915_context *i915,
                           const struct i915_texture *tex,
                           unsigned state[3] )
 {
-   const struct pipe_texture *pt = &tex->base;
+   const struct pipe_resource *pt = &tex->b.b;
    unsigned minlod, lastlod;
 
    /* Need to do this after updating the maps, which call the
@@ -149,7 +150,7 @@ void i915_update_samplers( struct i915_context *i915 )
       /* determine unit enable/disable by looking for a bound texture */
       /* could also examine the fragment program? */
       if (i915->fragment_sampler_views[unit]) {
-         struct i915_texture *texture = (struct i915_texture *)i915->fragment_sampler_views[unit]->texture;
+         struct i915_texture *texture = i915_texture(i915->fragment_sampler_views[unit]->texture);
 
         update_sampler( i915,
                         unit,
@@ -192,6 +193,14 @@ translate_texture_format(enum pipe_format pipeFormat)
       return MAPSURF_16BIT | MT_16BIT_ARGB4444;
    case PIPE_FORMAT_B8G8R8A8_UNORM:
       return MAPSURF_32BIT | MT_32BIT_ARGB8888;
+   case PIPE_FORMAT_B8G8R8X8_UNORM:
+      return MAPSURF_32BIT | MT_32BIT_XRGB8888;
+   case PIPE_FORMAT_R8G8B8A8_UNORM:
+      return MAPSURF_32BIT | MT_32BIT_ABGR8888;
+#if 0
+   case PIPE_FORMAT_R8G8B8X8_UNORM:
+      return MAPSURF_32BIT | MT_32BIT_XBGR8888;
+#endif
    case PIPE_FORMAT_YUYV:
       return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
    case PIPE_FORMAT_UYVY:
@@ -212,7 +221,7 @@ translate_texture_format(enum pipe_format pipeFormat)
    case PIPE_FORMAT_RGBA_DXT5:
       return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
 #endif
-   case PIPE_FORMAT_Z24S8_UNORM:
+   case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
       return (MAPSURF_32BIT | MT_32BIT_xI824);
    default:
       debug_printf("i915: translate_texture_format() bad image format %x\n",
@@ -230,7 +239,7 @@ i915_update_texture(struct i915_context *i915,
                     const struct i915_sampler_state *sampler,
                     uint state[6])
 {
-   const struct pipe_texture *pt = &tex->base;
+   const struct pipe_resource *pt = &tex->b.b;
    uint format, pitch;
    const uint width = pt->width0, height = pt->height0, depth = pt->depth0;
    const uint num_levels = pt->last_level;
@@ -288,7 +297,7 @@ i915_update_textures(struct i915_context *i915)
       /* determine unit enable/disable by looking for a bound texture */
       /* could also examine the fragment program? */
       if (i915->fragment_sampler_views[unit]) {
-         struct i915_texture *texture = (struct i915_texture *)i915->fragment_sampler_views[unit]->texture;
+         struct i915_texture *texture = i915_texture(i915->fragment_sampler_views[unit]->texture);
 
         i915_update_texture( i915,
                              unit,