~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/drivers/svga/svga_pipe_sampler.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "tgsi/tgsi_parse.h"
31
31
 
32
32
#include "svga_context.h"
33
 
#include "svga_screen_texture.h"
 
33
#include "svga_resource_texture.h"
34
34
 
35
35
#include "svga_debug.h"
36
36
 
155
155
   /* Check for no-op */
156
156
   if (num == svga->curr.num_samplers &&
157
157
       !memcmp(svga->curr.sampler, sampler, num * sizeof(void *))) {
158
 
      debug_printf("sampler noop\n");
 
158
      if (0) debug_printf("sampler noop\n");
159
159
      return;
160
160
   }
161
161
 
176
176
}
177
177
 
178
178
 
179
 
static void svga_set_sampler_textures(struct pipe_context *pipe,
180
 
                                      unsigned num,
181
 
                                      struct pipe_texture **texture)
 
179
static struct pipe_sampler_view *
 
180
svga_create_sampler_view(struct pipe_context *pipe,
 
181
                         struct pipe_resource *texture,
 
182
                         const struct pipe_sampler_view *templ)
 
183
{
 
184
   struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view);
 
185
 
 
186
   if (view) {
 
187
      *view = *templ;
 
188
      view->reference.count = 1;
 
189
      view->texture = NULL;
 
190
      pipe_resource_reference(&view->texture, texture);
 
191
      view->context = pipe;
 
192
   }
 
193
 
 
194
   return view;
 
195
}
 
196
 
 
197
 
 
198
static void
 
199
svga_sampler_view_destroy(struct pipe_context *pipe,
 
200
                          struct pipe_sampler_view *view)
 
201
{
 
202
   pipe_resource_reference(&view->texture, NULL);
 
203
   FREE(view);
 
204
}
 
205
 
 
206
static void svga_set_sampler_views(struct pipe_context *pipe,
 
207
                                   unsigned num,
 
208
                                   struct pipe_sampler_view **views)
182
209
{
183
210
   struct svga_context *svga = svga_context(pipe);
184
211
   unsigned flag_1d = 0;
188
215
   assert(num <= PIPE_MAX_SAMPLERS);
189
216
 
190
217
   /* Check for no-op */
191
 
   if (num == svga->curr.num_textures &&
192
 
       !memcmp(svga->curr.texture, texture, num * sizeof(struct pipe_texture *))) {
 
218
   if (num == svga->curr.num_sampler_views &&
 
219
       !memcmp(svga->curr.sampler_views, views, num * sizeof(struct pipe_sampler_view *))) {
193
220
      if (0) debug_printf("texture noop\n");
194
221
      return;
195
222
   }
196
223
 
197
224
   for (i = 0; i < num; i++) {
198
 
      pipe_texture_reference(&svga->curr.texture[i],
199
 
                             texture[i]);
 
225
      pipe_sampler_view_reference(&svga->curr.sampler_views[i],
 
226
                                  views[i]);
200
227
 
201
 
      if (!texture[i])
 
228
      if (!views[i])
202
229
         continue;
203
230
 
204
 
      if (texture[i]->format == PIPE_FORMAT_B8G8R8A8_SRGB)
 
231
      if (views[i]->texture->format == PIPE_FORMAT_B8G8R8A8_SRGB)
205
232
         flag_srgb |= 1 << i;
206
233
 
207
 
      if (texture[i]->target == PIPE_TEXTURE_1D)
 
234
      if (views[i]->texture->target == PIPE_TEXTURE_1D)
208
235
         flag_1d |= 1 << i;
209
236
   }
210
237
 
211
 
   for (i = num; i < svga->curr.num_textures; i++)
212
 
      pipe_texture_reference(&svga->curr.texture[i],
213
 
                             NULL);
 
238
   for (i = num; i < svga->curr.num_sampler_views; i++)
 
239
      pipe_sampler_view_reference(&svga->curr.sampler_views[i],
 
240
                                  NULL);
214
241
 
215
 
   svga->curr.num_textures = num;
 
242
   svga->curr.num_sampler_views = num;
216
243
   svga->dirty |= SVGA_NEW_TEXTURE_BINDING;
217
244
 
218
245
   if (flag_srgb != svga->curr.tex_flags.flag_srgb ||
231
258
   svga->pipe.create_sampler_state = svga_create_sampler_state;
232
259
   svga->pipe.bind_fragment_sampler_states = svga_bind_sampler_states;
233
260
   svga->pipe.delete_sampler_state = svga_delete_sampler_state;
234
 
   svga->pipe.set_fragment_sampler_textures = svga_set_sampler_textures;
 
261
   svga->pipe.set_fragment_sampler_views = svga_set_sampler_views;
 
262
   svga->pipe.create_sampler_view = svga_create_sampler_view;
 
263
   svga->pipe.sampler_view_destroy = svga_sampler_view_destroy;
235
264
}
236
265
 
237
266