mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
re-add MSAA support
(cherry picked from commit f7d80aa006)
This also involved adding the new MSAA fields to driCreateConfigs().
Also, re-add prog_instructions->Sampler field for i965 driver. Will
have to revisit that.
This commit is contained in:
parent
22c6c1eaad
commit
e13593678f
13 changed files with 60 additions and 45 deletions
|
|
@ -57,16 +57,9 @@ PROGRAM_DIRS := egl $(PROGRAM_DIRS)
|
|||
# EGL directories
|
||||
EGL_DRIVERS_DIRS = demo glx
|
||||
|
||||
DRIVER_DIRS =
|
||||
DRIVER_DIRS = dri
|
||||
WINDOW_SYSTEM = dri
|
||||
GALLIUM_WINSYS_DIRS = drm
|
||||
|
||||
# gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
|
||||
# XXX: need to figure out a way for gallium and non-gallium builds to
|
||||
# coexist:
|
||||
#
|
||||
|
||||
#DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
|
||||
# savage sis tdfx trident unichrome ffb
|
||||
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
|
|
|||
|
|
@ -628,6 +628,7 @@ ffbFillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[3];
|
||||
uint8_t stencil_bits_array[3];
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = 0;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -656,9 +657,10 @@ ffbFillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor, back_buffer_modes,
|
||||
back_buffer_factor);
|
||||
back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
|
||||
__LINE__);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ i810FillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[2];
|
||||
uint8_t stencil_bits_array[2];
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = depth_bits;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -94,7 +95,8 @@ i810FillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor);
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__ );
|
||||
|
|
|
|||
|
|
@ -478,6 +478,7 @@ intelFillInModes(__DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[3];
|
||||
uint8_t stencil_bits_array[3];
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = 0;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -509,7 +510,9 @@ intelFillInModes(__DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor, back_buffer_modes,
|
||||
back_buffer_factor);
|
||||
back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
|
||||
__LINE__);
|
||||
|
|
@ -679,7 +682,7 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
|
|||
static const GLenum back_buffer_modes[] = {
|
||||
GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
|
||||
};
|
||||
uint8_t depth_bits[4], stencil_bits[4];
|
||||
uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
|
||||
int color;
|
||||
const __DRIconfig **configs = NULL;
|
||||
|
||||
|
|
@ -748,7 +751,9 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
|
|||
stencil_bits,
|
||||
ARRAY_SIZE(depth_bits),
|
||||
back_buffer_modes,
|
||||
ARRAY_SIZE(back_buffer_modes));
|
||||
ARRAY_SIZE(back_buffer_modes),
|
||||
msaa_samples_array, ARRAY_SIZE(msaa_samples_array));
|
||||
|
||||
if (configs == NULL)
|
||||
configs = new_configs;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ mach64FillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[2];
|
||||
uint8_t stencil_bits_array[2];
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = depth_bits;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -119,7 +120,8 @@ mach64FillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor, back_buffer_modes,
|
||||
back_buffer_factor);
|
||||
back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__);
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ mgaFillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[3];
|
||||
uint8_t stencil_bits_array[3];
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
|
||||
depth_bits_array[0] = 0;
|
||||
|
|
@ -158,7 +159,8 @@ mgaFillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor);
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__ );
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ r128FillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[2];
|
||||
uint8_t stencil_bits_array[2];
|
||||
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = depth_bits;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -446,26 +446,27 @@ r128FillInModes( __DRIscreenPrivate *psp,
|
|||
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
}
|
||||
|
||||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor, back_buffer_modes,
|
||||
back_buffer_factor);
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
|
||||
__LINE__);
|
||||
return NULL;
|
||||
}
|
||||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor, back_buffer_modes,
|
||||
back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
|
||||
__LINE__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Mark the visual as slow if there are "fake" stencil bits.
|
||||
*/
|
||||
for (i = 0; configs[i]; i++) {
|
||||
m = &configs[i]->modes;
|
||||
if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
|
||||
m->visualRating = GLX_SLOW_CONFIG;
|
||||
}
|
||||
}
|
||||
/* Mark the visual as slow if there are "fake" stencil bits.
|
||||
*/
|
||||
for (i = 0; configs[i]; i++) {
|
||||
m = &configs[i]->modes;
|
||||
if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
|
||||
m->visualRating = GLX_SLOW_CONFIG;
|
||||
}
|
||||
}
|
||||
|
||||
return (const __DRIconfig **) configs;
|
||||
return (const __DRIconfig **) configs;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ radeonFillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[2];
|
||||
uint8_t stencil_bits_array[2];
|
||||
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = depth_bits;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -303,7 +303,8 @@ radeonFillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor);
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__ );
|
||||
|
|
|
|||
|
|
@ -910,7 +910,7 @@ savageFillInModes( __DRIscreenPrivate *psp,
|
|||
|
||||
uint8_t depth_bits_array[2];
|
||||
uint8_t stencil_bits_array[2];
|
||||
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = depth_bits;
|
||||
depth_bits_array[1] = depth_bits;
|
||||
|
|
@ -937,7 +937,8 @@ savageFillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor);
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
|
||||
__func__, __LINE__ );
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
|
|||
};
|
||||
uint8_t depth_bits_array[4];
|
||||
uint8_t stencil_bits_array[4];
|
||||
uint8_t msaa_samples_array[1];
|
||||
|
||||
depth_bits_array[0] = 0;
|
||||
stencil_bits_array[0] = 0;
|
||||
|
|
@ -100,7 +101,8 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp)
|
|||
|
||||
configs = driCreateConfigs(fb_format, fb_type, depth_bits_array,
|
||||
stencil_bits_array, depth_buffer_factor,
|
||||
back_buffer_modes, back_buffer_factor);
|
||||
back_buffer_modes, back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -361,6 +361,7 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
|
|||
static const GLenum db_modes[2] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML };
|
||||
uint8_t depth_bits_array[4];
|
||||
uint8_t stencil_bits_array[4];
|
||||
uint8_t msaa_samples_array[1];
|
||||
if(deep) {
|
||||
depth_bits_array[0] = 0;
|
||||
depth_bits_array[1] = 24;
|
||||
|
|
@ -383,7 +384,8 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
|
|||
depth_bits_array,
|
||||
stencil_bits_array,
|
||||
deep ? 2 : 4,
|
||||
db_modes, 2);
|
||||
db_modes, 2,
|
||||
msaa_samples_array, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -342,6 +342,7 @@ viaFillInModes( __DRIscreenPrivate *psp,
|
|||
*/
|
||||
static const uint8_t depth_bits_array[4] = { 0, 16, 24, 32 };
|
||||
static const uint8_t stencil_bits_array[4] = { 0, 0, 8, 0 };
|
||||
uint8_t msaa_samples_array[1];
|
||||
const unsigned depth_buffer_factor = 3;
|
||||
|
||||
if ( pixel_bits == 16 ) {
|
||||
|
|
@ -356,7 +357,8 @@ viaFillInModes( __DRIscreenPrivate *psp,
|
|||
configs = driCreateConfigs(fb_format, fb_type,
|
||||
depth_bits_array, stencil_bits_array,
|
||||
depth_buffer_factor, back_buffer_modes,
|
||||
back_buffer_factor);
|
||||
back_buffer_factor,
|
||||
msaa_samples_array, 1);
|
||||
if (configs == NULL) {
|
||||
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
|
||||
__LINE__);
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ struct prog_instruction
|
|||
*/
|
||||
GLint BranchTarget;
|
||||
|
||||
#if 0
|
||||
#if 01 /* XXX just use this for i965 driver for now! */
|
||||
/**
|
||||
* For TEX instructions in shaders, the sampler to use for the
|
||||
* texture lookup.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue