From 066f45c7a1888ca8a9de78a81b38af7c74bca9e1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 8 Feb 2010 10:32:29 -0800 Subject: intel: Update comment in intelInitScreen2 to noting DRI2 protocol issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_screen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index c9ef1647a32..1acd7a576eb 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -401,9 +401,9 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) __DRIconfig **new_configs; int depth_factor; - /* With DRI2 right now, GetBuffers always returns a depth/stencil buffer - * with the same cpp as the drawable. So we can't support depth cpp != - * color cpp currently. + /* Starting with DRI2 protocol version 1.1 we can request a depth/stencil + * buffer that has a diffferent number of bits per pixel than the color + * buffer. This isn't yet supported here. */ if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) { depth_bits[1] = 16; -- cgit v1.2.3 From 6d91f9a024f6e3bc3ae1e71b80e2ec07d60490cf Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 8 Feb 2010 10:33:35 -0800 Subject: intel: Remove redundant init of depth_bits / stencil_bits in intelInitScreen2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_screen.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 1acd7a576eb..bda94e0df35 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -374,15 +374,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) intelScreen->irq_active = 1; psp->extensions = intelScreenExtensions; - depth_bits[0] = 0; - stencil_bits[0] = 0; - depth_bits[1] = 16; - stencil_bits[1] = 0; - depth_bits[2] = 24; - stencil_bits[2] = 0; - depth_bits[3] = 24; - stencil_bits[3] = 8; - msaa_samples_array[0] = 0; fb_format[0] = GL_RGB; -- cgit v1.2.3 From 73e24cd5a7a0760726a681dda5b88805ddcf1555 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 8 Feb 2010 10:34:52 -0800 Subject: intel: Stop exposing useless 24 depth/0 stencil configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_screen.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index bda94e0df35..b308ae19104 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -399,16 +399,13 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) { depth_bits[1] = 16; stencil_bits[1] = 0; - - depth_factor = 2; } else { depth_bits[1] = 24; - stencil_bits[1] = 0; - depth_bits[2] = 24; - stencil_bits[2] = 8; - - depth_factor = 3; + stencil_bits[1] = 8; } + + depth_factor = 2; + new_configs = driCreateConfigs(fb_format[color], fb_type[color], depth_bits, stencil_bits, -- cgit v1.2.3 From 3cce4a1e10361458630511543b7a8a6438544775 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 8 Feb 2010 11:09:15 -0800 Subject: dri: Allow selective generation of accum. buffer configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modify the interface to driCreateConfigs allowing drivers to not expose configs with an accumuation buffer. All of the drivers calling function have been updated to pass true for the accumulation selector. This maintains the current behavior. Signed-off-by: Ian Romanick Reviewed-by: Kristian Høgsberg Reviewed-by: Corbin Simpson --- src/gallium/state_trackers/dri/dri_screen.c | 9 ++++++--- src/mesa/drivers/dri/common/utils.c | 5 +++-- src/mesa/drivers/dri/common/utils.h | 3 ++- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 2 +- src/mesa/drivers/dri/i810/i810screen.c | 2 +- src/mesa/drivers/dri/intel/intel_screen.c | 3 ++- src/mesa/drivers/dri/mach64/mach64_screen.c | 2 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 2 +- src/mesa/drivers/dri/nouveau/nouveau_screen.c | 3 ++- src/mesa/drivers/dri/r128/r128_screen.c | 2 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 9 +++++---- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 +- src/mesa/drivers/dri/sis/sis_screen.c | 2 +- src/mesa/drivers/dri/swrast/swrast.c | 3 ++- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 3 ++- src/mesa/drivers/dri/unichrome/via_screen.c | 2 +- 16 files changed, 32 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 2052867309c..4064976b234 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -157,7 +157,8 @@ dri_fill_in_modes(struct dri_screen *screen, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, msaa_samples_factor); + msaa_samples_array, msaa_samples_factor, + GL_TRUE); } else { __DRIconfig **configs_a8r8g8b8 = NULL; __DRIconfig **configs_x8r8g8b8 = NULL; @@ -170,7 +171,8 @@ dri_fill_in_modes(struct dri_screen *screen, back_buffer_modes, back_buffer_factor, msaa_samples_array, - msaa_samples_factor); + msaa_samples_factor, + GL_TRUE); if (pf_x8r8g8b8) configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV, depth_bits_array, @@ -179,7 +181,8 @@ dri_fill_in_modes(struct dri_screen *screen, back_buffer_modes, back_buffer_factor, msaa_samples_array, - msaa_samples_factor); + msaa_samples_factor, + GL_TRUE); if (configs_a8r8g8b8 && configs_x8r8g8b8) configs = driConcatConfigs(configs_x8r8g8b8, configs_a8r8g8b8); diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 81d026a697c..833f9ad232a 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -424,7 +424,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, - const uint8_t * msaa_samples, unsigned num_msaa_modes) + const uint8_t * msaa_samples, unsigned num_msaa_modes, + GLboolean enable_accum) { static const uint8_t bits_table[4][4] = { /* R G B A */ @@ -486,7 +487,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, __GLcontextModes *modes; unsigned i, j, k, h; unsigned num_modes; - unsigned num_accum_bits = 2; + unsigned num_accum_bits = (enable_accum) ? 2 : 1; switch ( fb_type ) { case GL_UNSIGNED_BYTE_3_3_2: diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 2aa6de66c18..02ca3feb739 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -104,7 +104,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, const uint8_t * depth_bits, const uint8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, - const uint8_t * msaa_samples, unsigned num_msaa_modes); + const uint8_t * msaa_samples, unsigned num_msaa_modes, + GLboolean enable_accum); __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **b); diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 6a846514795..7fdf883cdf4 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -658,7 +658,7 @@ ffbFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 476c8013580..825a1b5fbe4 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -92,7 +92,7 @@ i810FillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index b308ae19104..8344b82f181 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -413,7 +413,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) back_buffer_modes, ARRAY_SIZE(back_buffer_modes), msaa_samples_array, - ARRAY_SIZE(msaa_samples_array)); + ARRAY_SIZE(msaa_samples_array), + GL_TRUE); if (configs == NULL) configs = new_configs; else diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 5cbfb85627a..99aad574c8d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -119,7 +119,7 @@ mach64FillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index e7813b63725..a0a65cb4512 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -160,7 +160,7 @@ mgaFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index de6328251ea..6abab8c9656 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -83,7 +83,8 @@ nouveau_get_configs(void) back_buffer_modes, Elements(back_buffer_modes), msaa_samples, - Elements(msaa_samples)); + Elements(msaa_samples), + GL_TRUE); assert(config); configs = configs ? driConcatConfigs(configs, config) diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index ef6b5a35c4a..afc44d46508 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -449,7 +449,7 @@ r128FillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 93b6399a669..7d5cdb5843f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -293,18 +293,18 @@ radeonFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, msaa_samples_array, - 1); + 1, TRUE); configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, depth_bits_array, stencil_bits_array, 1, back_buffer_modes, 1, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8); } else configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", @@ -1676,7 +1676,8 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp) back_buffer_modes, ARRAY_SIZE(back_buffer_modes), msaa_samples_array, - ARRAY_SIZE(msaa_samples_array)); + ARRAY_SIZE(msaa_samples_array), + GL_TRUE); if (configs == NULL) configs = new_configs; else diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 8e879ca41c0..788c49fdbe8 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -939,7 +939,7 @@ savageFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index cb7ed8a08bb..0b985417322 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -103,7 +103,7 @@ sisFillInModes(__DRIscreen *psp, int bpp) 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); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); return NULL; diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 4e823669bfc..40535b03b95 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -132,7 +132,8 @@ swrastFillInModes(__DRIscreen *psp, 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); + back_buffer_factor, msaa_samples_array, 1, + GL_TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 9f6b35faa28..d554bcdc92c 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -383,7 +383,8 @@ tdfxFillInModes(__DRIscreen *psp, stencil_bits_array, deep ? 2 : 4, db_modes, 2, - msaa_samples_array, 1); + msaa_samples_array, 1, + GL_TRUE); } /** diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 8c91c937c68..55125018cc2 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -354,7 +354,7 @@ viaFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); -- cgit v1.2.3 From bb65a1d009e3d8398492aa30d944c17a40535aa1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 8 Feb 2010 11:21:29 -0800 Subject: intel: Expose a minimal number of configs with accumulation buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expose one config per color depth that includes accumulation buffer. We could probably expose only one config with accumulation buffer, but that would require figuring out the actual color depth. This is easier and only exposes 2 useless configs. Signed-off-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_screen.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 8344b82f181..551b97e42a6 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -388,6 +388,9 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) depth_bits[0] = 0; stencil_bits[0] = 0; + /* Generate a rich set of useful configs that do not include an + * accumulation buffer. + */ for (color = 0; color < ARRAY_SIZE(fb_format); color++) { __DRIconfig **new_configs; int depth_factor; @@ -414,6 +417,31 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) ARRAY_SIZE(back_buffer_modes), msaa_samples_array, ARRAY_SIZE(msaa_samples_array), + GL_FALSE); + if (configs == NULL) + configs = new_configs; + else + configs = driConcatConfigs(configs, new_configs); + } + + /* Generate the minimum possible set of configs that include an + * accumulation buffer. + */ + for (color = 0; color < ARRAY_SIZE(fb_format); color++) { + __DRIconfig **new_configs; + + if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) { + depth_bits[0] = 16; + stencil_bits[0] = 0; + } else { + depth_bits[0] = 24; + stencil_bits[0] = 8; + } + + new_configs = driCreateConfigs(fb_format[color], fb_type[color], + depth_bits, stencil_bits, 1, + back_buffer_modes + 1, 1, + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) configs = new_configs; -- cgit v1.2.3 From 6bd9da01eacf9d100dfb0a9529700aa894a23d24 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 8 Feb 2010 13:11:58 -0800 Subject: intel: Don't expose GLX_SWAP_EXCHANGE_OML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't always guarantee that the swap will happen by exchange, so we can't expose this mode. GLX_SWAP_UNDEFINED_OML already covers the case where the swap *might be* by exchange. Signed-off-by: Ian Romanick Reviewed-by: Kristian Høgsberg --- src/mesa/drivers/dri/intel/intel_screen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 551b97e42a6..fa46b252ee7 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -341,8 +341,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) GLenum fb_type[3]; static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML, - GLX_SWAP_EXCHANGE_OML, GLX_SWAP_COPY_OML + GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1]; int color; -- cgit v1.2.3 From 96728bb4f3e078c190da066868dede611685f6aa Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 10 Feb 2010 11:43:02 -0800 Subject: dri: Fix copy-and-paste brain damage in previous commit A number of places in 3cce4a1e10361458630511543b7a8a6438544775 use TRUE instead of GL_TRUE. This causes build failures in all of the drivers that I don't typically build. Win. Reported by sungami on IRC. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i810/i810screen.c | 2 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 2 +- src/mesa/drivers/dri/r128/r128_screen.c | 2 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 6 +++--- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 +- src/mesa/drivers/dri/sis/sis_screen.c | 2 +- src/mesa/drivers/dri/unichrome/via_screen.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 825a1b5fbe4..1c4deef319f 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -92,7 +92,7 @@ i810FillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index a0a65cb4512..687412bca55 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -160,7 +160,7 @@ mgaFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index afc44d46508..2d918028236 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -449,7 +449,7 @@ r128FillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 7d5cdb5843f..631f729048a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -293,18 +293,18 @@ radeonFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, msaa_samples_array, - 1, TRUE); + 1, GL_TRUE); configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, depth_bits_array, stencil_bits_array, 1, back_buffer_modes, 1, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8); } else configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 788c49fdbe8..74a001b7898 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -939,7 +939,7 @@ savageFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__ ); diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 0b985417322..80fb455ec75 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -103,7 +103,7 @@ sisFillInModes(__DRIscreen *psp, int bpp) 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, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); return NULL; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 55125018cc2..ee10b569bf1 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -354,7 +354,7 @@ viaFillInModes( __DRIscreen *psp, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1, TRUE); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); -- cgit v1.2.3 From 92ea8834d826eb6986112b5c2e0b530522d00530 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 10 Feb 2010 12:31:18 -0800 Subject: r300/compiler: r500-fs: Properly set HW register swizzles. Fixes fallout from 9a1bf52c. --- src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 2 +- src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index d87acecdabe..b0fb8e970b7 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -295,7 +295,7 @@ static char *toswiz(int swiz_val) { case 2: return "B"; case 3: return "A"; case 4: return "0"; - case 5: return "1/2"; + case 5: return "H"; case 6: return "1"; case 7: return "U"; } diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index c2eb613b23f..829f028950c 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -121,8 +121,19 @@ static unsigned int translate_alpha_op(struct r300_fragment_program_compiler *c, static unsigned int fix_hw_swizzle(unsigned int swz) { - if (swz == 5) swz = 6; - if (swz == RC_SWIZZLE_UNUSED) swz = 4; + switch (swz) { + case RC_SWIZZLE_ZERO: + case RC_SWIZZLE_UNUSED: + swz = 4; + break; + case RC_SWIZZLE_HALF: + swz = 5; + break; + case RC_SWIZZLE_ONE: + swz = 6; + break; + } + return swz; } -- cgit v1.2.3