re-add MSAA support
This commit is contained in:
@@ -524,15 +524,12 @@ GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer,
|
|||||||
* \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32,
|
* \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32,
|
||||||
* \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it.
|
* \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* XXX: need to re-add msaa support after gallium-0.1 merge
|
|
||||||
*/
|
|
||||||
|
|
||||||
__DRIconfig **
|
__DRIconfig **
|
||||||
driCreateConfigs(GLenum fb_format, GLenum fb_type,
|
driCreateConfigs(GLenum fb_format, GLenum fb_type,
|
||||||
const u_int8_t * depth_bits, const u_int8_t * stencil_bits,
|
const u_int8_t * depth_bits, const u_int8_t * stencil_bits,
|
||||||
unsigned num_depth_stencil_bits,
|
unsigned num_depth_stencil_bits,
|
||||||
const GLenum * db_modes, unsigned num_db_modes)
|
const GLenum * db_modes, unsigned num_db_modes,
|
||||||
|
const u_int8_t * msaa_samples, unsigned num_msaa_modes)
|
||||||
{
|
{
|
||||||
static const u_int8_t bits_table[4][4] = {
|
static const u_int8_t bits_table[4][4] = {
|
||||||
/* R G B A */
|
/* R G B A */
|
||||||
@@ -592,9 +589,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
|
|||||||
int index;
|
int index;
|
||||||
__DRIconfig **configs, **c;
|
__DRIconfig **configs, **c;
|
||||||
__GLcontextModes *modes;
|
__GLcontextModes *modes;
|
||||||
unsigned i;
|
unsigned i, j, k, h;
|
||||||
unsigned j;
|
|
||||||
unsigned k;
|
|
||||||
unsigned num_modes;
|
unsigned num_modes;
|
||||||
unsigned num_accum_bits = 2;
|
unsigned num_accum_bits = 2;
|
||||||
|
|
||||||
@@ -675,66 +670,74 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
|
|||||||
c = configs;
|
c = configs;
|
||||||
for ( k = 0 ; k < num_depth_stencil_bits ; k++ ) {
|
for ( k = 0 ; k < num_depth_stencil_bits ; k++ ) {
|
||||||
for ( i = 0 ; i < num_db_modes ; i++ ) {
|
for ( i = 0 ; i < num_db_modes ; i++ ) {
|
||||||
for ( j = 0 ; j < num_accum_bits ; j++ ) {
|
for ( h = 0 ; h < num_msaa_modes; h++ ) {
|
||||||
*c = _mesa_malloc (sizeof **c);
|
for ( j = 0 ; j < num_accum_bits ; j++ ) {
|
||||||
modes = &(*c)->modes;
|
*c = _mesa_malloc (sizeof **c);
|
||||||
c++;
|
modes = &(*c)->modes;
|
||||||
|
c++;
|
||||||
|
|
||||||
memset(modes, 0, sizeof *modes);
|
memset(modes, 0, sizeof *modes);
|
||||||
modes->redBits = bits[0];
|
modes->redBits = bits[0];
|
||||||
modes->greenBits = bits[1];
|
modes->greenBits = bits[1];
|
||||||
modes->blueBits = bits[2];
|
modes->blueBits = bits[2];
|
||||||
modes->alphaBits = bits[3];
|
modes->alphaBits = bits[3];
|
||||||
modes->redMask = masks[0];
|
modes->redMask = masks[0];
|
||||||
modes->greenMask = masks[1];
|
modes->greenMask = masks[1];
|
||||||
modes->blueMask = masks[2];
|
modes->blueMask = masks[2];
|
||||||
modes->alphaMask = masks[3];
|
modes->alphaMask = masks[3];
|
||||||
modes->rgbBits = modes->redBits + modes->greenBits
|
modes->rgbBits = modes->redBits + modes->greenBits
|
||||||
+ modes->blueBits + modes->alphaBits;
|
+ modes->blueBits + modes->alphaBits;
|
||||||
|
|
||||||
modes->accumRedBits = 16 * j;
|
modes->accumRedBits = 16 * j;
|
||||||
modes->accumGreenBits = 16 * j;
|
modes->accumGreenBits = 16 * j;
|
||||||
modes->accumBlueBits = 16 * j;
|
modes->accumBlueBits = 16 * j;
|
||||||
modes->accumAlphaBits = (masks[3] != 0) ? 16 * j : 0;
|
modes->accumAlphaBits = (masks[3] != 0) ? 16 * j : 0;
|
||||||
modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG;
|
modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG;
|
||||||
|
|
||||||
modes->stencilBits = stencil_bits[k];
|
modes->stencilBits = stencil_bits[k];
|
||||||
modes->depthBits = depth_bits[k];
|
modes->depthBits = depth_bits[k];
|
||||||
|
|
||||||
modes->transparentPixel = GLX_NONE;
|
modes->transparentPixel = GLX_NONE;
|
||||||
modes->transparentRed = GLX_DONT_CARE;
|
modes->transparentRed = GLX_DONT_CARE;
|
||||||
modes->transparentGreen = GLX_DONT_CARE;
|
modes->transparentGreen = GLX_DONT_CARE;
|
||||||
modes->transparentBlue = GLX_DONT_CARE;
|
modes->transparentBlue = GLX_DONT_CARE;
|
||||||
modes->transparentAlpha = GLX_DONT_CARE;
|
modes->transparentAlpha = GLX_DONT_CARE;
|
||||||
modes->transparentIndex = GLX_DONT_CARE;
|
modes->transparentIndex = GLX_DONT_CARE;
|
||||||
modes->visualType = GLX_DONT_CARE;
|
modes->visualType = GLX_DONT_CARE;
|
||||||
modes->renderType = GLX_RGBA_BIT;
|
modes->renderType = GLX_RGBA_BIT;
|
||||||
modes->drawableType = GLX_WINDOW_BIT;
|
modes->drawableType = GLX_WINDOW_BIT;
|
||||||
modes->rgbMode = GL_TRUE;
|
modes->rgbMode = GL_TRUE;
|
||||||
|
|
||||||
if ( db_modes[i] == GLX_NONE ) {
|
if ( db_modes[i] == GLX_NONE ) {
|
||||||
modes->doubleBufferMode = GL_FALSE;
|
modes->doubleBufferMode = GL_FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
modes->doubleBufferMode = GL_TRUE;
|
modes->doubleBufferMode = GL_TRUE;
|
||||||
modes->swapMethod = db_modes[i];
|
modes->swapMethod = db_modes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
modes->haveAccumBuffer = ((modes->accumRedBits +
|
modes->samples = msaa_samples[h];
|
||||||
|
modes->sampleBuffers = modes->samples ? 1 : 0;
|
||||||
|
|
||||||
|
|
||||||
|
modes->haveAccumBuffer = ((modes->accumRedBits +
|
||||||
modes->accumGreenBits +
|
modes->accumGreenBits +
|
||||||
modes->accumBlueBits +
|
modes->accumBlueBits +
|
||||||
modes->accumAlphaBits) > 0);
|
modes->accumAlphaBits) > 0);
|
||||||
modes->haveDepthBuffer = (modes->depthBits > 0);
|
modes->haveDepthBuffer = (modes->depthBits > 0);
|
||||||
modes->haveStencilBuffer = (modes->stencilBits > 0);
|
modes->haveStencilBuffer = (modes->stencilBits > 0);
|
||||||
|
|
||||||
modes->bindToTextureRgb = GL_TRUE;
|
modes->bindToTextureRgb = GL_TRUE;
|
||||||
modes->bindToTextureRgba = GL_TRUE;
|
modes->bindToTextureRgba = GL_TRUE;
|
||||||
modes->bindToMipmapTexture = GL_FALSE;
|
modes->bindToMipmapTexture = GL_FALSE;
|
||||||
modes->bindToTextureTargets = modes->rgbMode ?
|
modes->bindToTextureTargets = modes->rgbMode ?
|
||||||
__DRI_ATTRIB_TEXTURE_1D_BIT |
|
__DRI_ATTRIB_TEXTURE_1D_BIT |
|
||||||
__DRI_ATTRIB_TEXTURE_2D_BIT |
|
__DRI_ATTRIB_TEXTURE_2D_BIT |
|
||||||
__DRI_ATTRIB_TEXTURE_RECTANGLE_BIT :
|
__DRI_ATTRIB_TEXTURE_RECTANGLE_BIT :
|
||||||
0;
|
0;
|
||||||
|
|
||||||
|
modes = modes->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -129,9 +129,10 @@ struct __DRIconfigRec {
|
|||||||
|
|
||||||
extern __DRIconfig **
|
extern __DRIconfig **
|
||||||
driCreateConfigs(GLenum fb_format, GLenum fb_type,
|
driCreateConfigs(GLenum fb_format, GLenum fb_type,
|
||||||
const u_int8_t * depth_bits, const u_int8_t * stencil_bits,
|
const uint8_t * depth_bits, const uint8_t * stencil_bits,
|
||||||
unsigned num_depth_stencil_bits,
|
unsigned num_depth_stencil_bits,
|
||||||
const GLenum * db_modes, unsigned num_db_modes);
|
const GLenum * db_modes, unsigned num_db_modes,
|
||||||
|
const uint8_t * msaa_samples, unsigned num_msaa_modes);
|
||||||
|
|
||||||
const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b);
|
const __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user