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

« back to all changes in this revision

Viewing changes to src/gallium/state_trackers/wgl/stw_pixelformat.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:
25
25
 * 
26
26
 **************************************************************************/
27
27
 
28
 
#include "main/mtypes.h"
29
 
#include "main/context.h"
30
 
 
31
28
#include "pipe/p_format.h"
32
29
#include "pipe/p_defines.h"
33
30
#include "pipe/p_screen.h"
34
31
 
35
32
#include "util/u_format.h"
36
33
#include "util/u_debug.h"
 
34
#include "util/u_memory.h"
37
35
 
38
36
#include "stw_icd.h"
39
37
#include "stw_device.h"
96
94
   { PIPE_FORMAT_Z24X8_UNORM, {24, 0} },
97
95
   { PIPE_FORMAT_Z16_UNORM,   {16, 0} },
98
96
   /* combined depth-stencil */
99
 
   { PIPE_FORMAT_Z24S8_UNORM, {24, 8} },
100
 
   { PIPE_FORMAT_S8Z24_UNORM, {24, 8} }
 
97
   { PIPE_FORMAT_Z24_UNORM_S8_USCALED, {24, 8} },
 
98
   { PIPE_FORMAT_S8_USCALED_Z24_UNORM, {24, 8} }
101
99
};
102
100
 
103
101
 
142
140
   
143
141
   memset(pfi, 0, sizeof *pfi);
144
142
   
145
 
   pfi->color_format = color->format;
146
 
   pfi->depth_stencil_format = depth->format;
147
 
   
148
143
   pfi->pfd.nSize = sizeof pfi->pfd;
149
144
   pfi->pfd.nVersion = 1;
150
145
 
184
179
   pfi->pfd.dwVisibleMask = 0;
185
180
   pfi->pfd.dwDamageMask = 0;
186
181
 
187
 
   if(samples) {
188
 
      pfi->numSampleBuffers = 1;
189
 
      pfi->numSamples = samples;
190
 
      extended = TRUE;
191
 
   }
 
182
   /*
 
183
    * since state trackers can allocate depth/stencil/accum buffers, we provide
 
184
    * only color buffers here
 
185
    */
 
186
   pfi->stvis.buffer_mask = ST_ATTACHMENT_FRONT_LEFT_MASK;
 
187
   if (doublebuffer)
 
188
      pfi->stvis.buffer_mask = ST_ATTACHMENT_BACK_LEFT_MASK;
 
189
 
 
190
   pfi->stvis.color_format = color->format;
 
191
   pfi->stvis.depth_stencil_format = depth->format;
 
192
 
 
193
   pfi->stvis.accum_format = (accum) ?
 
194
      PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
 
195
 
 
196
   pfi->stvis.samples = samples;
 
197
   pfi->stvis.render_buffer = ST_ATTACHMENT_INVALID;
192
198
   
193
199
   ++stw_dev->pixelformat_extended_count;
194
200
   
217
223
      for(j = 0; j < Elements(stw_pf_color); ++j) {
218
224
         const struct stw_pf_color_info *color = &stw_pf_color[j];
219
225
         
220
 
         if(!screen->is_format_supported(screen, color->format, PIPE_TEXTURE_2D, 
221
 
                                         PIPE_TEXTURE_USAGE_RENDER_TARGET |
222
 
                                         PIPE_TEXTURE_USAGE_DISPLAY_TARGET, 0))
 
226
         if(!screen->is_format_supported(screen, color->format, PIPE_TEXTURE_2D,
 
227
                                         0, PIPE_BIND_RENDER_TARGET |
 
228
                                         PIPE_BIND_DISPLAY_TARGET, 0))
223
229
            continue;
224
230
         
225
231
         for(k = 0; k < Elements(stw_pf_doublebuffer); ++k) {
229
235
               const struct stw_pf_depth_info *depth = &stw_pf_depth_stencil[l];
230
236
               
231
237
               if(!screen->is_format_supported(screen, depth->format, PIPE_TEXTURE_2D, 
232
 
                                               PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0))
 
238
                                               0, PIPE_BIND_DEPTH_STENCIL, 0))
233
239
                  continue;
234
240
 
235
241
               stw_pixelformat_add( stw_dev, color, depth,  0, doublebuffer, samples );
264
270
}
265
271
 
266
272
 
267
 
void
268
 
stw_pixelformat_visual(GLvisual *visual, 
269
 
                       const struct stw_pixelformat_info *pfi )
270
 
{
271
 
   memset(visual, 0, sizeof *visual);
272
 
   _mesa_initialize_visual(
273
 
      visual,
274
 
      (pfi->pfd.dwFlags & PFD_DOUBLEBUFFER) ? GL_TRUE : GL_FALSE,
275
 
      (pfi->pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE,
276
 
      pfi->pfd.cRedBits,
277
 
      pfi->pfd.cGreenBits,
278
 
      pfi->pfd.cBlueBits,
279
 
      pfi->pfd.cAlphaBits,
280
 
      pfi->pfd.cDepthBits,
281
 
      pfi->pfd.cStencilBits,
282
 
      pfi->pfd.cAccumRedBits,
283
 
      pfi->pfd.cAccumGreenBits,
284
 
      pfi->pfd.cAccumBlueBits,
285
 
      pfi->pfd.cAccumAlphaBits,
286
 
      pfi->numSamples );
287
 
}
288
 
 
289
 
 
290
273
LONG APIENTRY
291
274
DrvDescribePixelFormat(
292
275
   HDC hdc,