~ubuntu-branches/ubuntu/raring/mesa/raring-proposed

« back to all changes in this revision

Viewing changes to src/mesa/state_tracker/st_cb_accum.c

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2011-06-19 21:26:00 UTC
  • mfrom: (1.6.1 upstream) (3.3.18 sid)
  • mto: (3.3.20 sid)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: james.westby@ubuntu.com-20110619212600-rleaapdmnbtstekb
Tags: 7.11~0-2
Thank you sbuild for giving a green light when that's not actually the
case. Fix missing Pre-Depends for the libegl1-mesa-drivers package
(multiarch-support).

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include "main/imports.h"
34
34
#include "main/image.h"
35
35
#include "main/macros.h"
 
36
#include "main/mfeatures.h"
36
37
 
37
38
#include "st_debug.h"
38
39
#include "st_context.h"
41
42
#include "st_texture.h"
42
43
#include "pipe/p_context.h"
43
44
#include "pipe/p_defines.h"
 
45
#include "util/u_format.h"
44
46
#include "util/u_inlines.h"
45
47
#include "util/u_tile.h"
46
48
 
145
147
 
146
148
   buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
147
149
 
148
 
   pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
150
   pipe_get_tile_rgba_format(pipe, color_trans, 0, 0, width, height,
 
151
                             util_format_linear(color_strb->texture->format),
 
152
                             buf);
149
153
 
150
154
   switch (acc_strb->format) {
151
155
   case PIPE_FORMAT_R16G16B16A16_SNORM:
182
186
   GLubyte *data = acc_strb->data;
183
187
   GLfloat *buf;
184
188
 
185
 
 
186
189
   if (ST_DEBUG & DEBUG_FALLBACK)
187
190
      debug_printf("%s: fallback processing\n", __FUNCTION__);
188
191
 
193
196
 
194
197
   buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
195
198
 
196
 
   pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
199
   pipe_get_tile_rgba_format(pipe, color_trans, 0, 0, width, height,
 
200
                             util_format_linear(color_strb->texture->format),
 
201
                             buf);
197
202
 
198
203
   switch (acc_strb->format) {
199
204
   case PIPE_FORMAT_R16G16B16A16_SNORM:
231
236
   size_t stride = acc_strb->stride;
232
237
   const GLubyte *data = acc_strb->data;
233
238
   GLfloat *buf;
 
239
   enum pipe_format format = util_format_linear(color_strb->texture->format);
234
240
 
235
241
   if (ST_DEBUG & DEBUG_FALLBACK)
236
242
      debug_printf("%s: fallback processing\n", __FUNCTION__);
242
248
   else
243
249
      usage = PIPE_TRANSFER_WRITE;
244
250
 
245
 
   color_trans = pipe_get_transfer(st_context(ctx)->pipe,
 
251
   color_trans = pipe_get_transfer(pipe,
246
252
                                   color_strb->texture, 0, 0,
247
253
                                   usage,
248
254
                                   xpos, ypos,
249
255
                                   width, height);
250
256
 
251
257
   if (usage & PIPE_TRANSFER_READ)
252
 
      pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
258
      pipe_get_tile_rgba_format(pipe, color_trans, 0, 0, width, height,
 
259
                                format, buf);
253
260
 
254
261
   switch (acc_strb->format) {
255
262
   case PIPE_FORMAT_R16G16B16A16_SNORM:
278
285
      _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()");
279
286
   }
280
287
 
281
 
   pipe_put_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
288
   pipe_put_tile_rgba_format(pipe, color_trans, 0, 0, width, height,
 
289
                             format, buf);
282
290
 
283
291
   free(buf);
284
292
   pipe->transfer_destroy(pipe, color_trans);