pcre2: bump to 10.40
[kiss-trunc88.git] / mesa / patches / gallium_msaa.patch
blob2f816e9b3a803518e1915d31ff15173f77abaf54
1 diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
2 index 82a0988a63..43e54e2065 100644
3 --- a/src/gallium/frontends/dri/dri_screen.c
4 +++ b/src/gallium/frontends/dri/dri_screen.c
5 @@ -298,6 +298,37 @@ dri_fill_in_modes(struct dri_screen *screen)
6 return (const __DRIconfig **)configs;
9 +/* The Gallium way to force MSAA. */
10 +DEBUG_GET_ONCE_NUM_OPTION(msaa, "GALLIUM_MSAA", 0);
12 +/* The NVIDIA way to force MSAA. The same variable is used by the NVIDIA
13 + * driver. */
14 +DEBUG_GET_ONCE_NUM_OPTION(msaa_nv, "__GL_FSAA_MODE", 0);
16 +static void
17 +dri_force_msaa_visual(struct st_visual *stvis,
18 + struct pipe_screen *screen)
20 + int i;
21 + int samples = debug_get_option_msaa();
23 + if (!samples)
24 + samples = debug_get_option_msaa_nv();
26 + if (samples <= 1)
27 + return; /* nothing to do */
29 + /* Choose a supported sample count greater than or equal to samples. */
30 + for (i = samples; i <= MSAA_VISUAL_MAX_SAMPLES; i++) {
31 + if (screen->is_format_supported(screen, stvis->color_format,
32 + PIPE_TEXTURE_2D, i, i,
33 + PIPE_BIND_RENDER_TARGET)) {
34 + stvis->samples = i;
35 + break;
36 + }
37 + }
40 /**
41 * Roughly the converse of dri_fill_in_modes.
43 @@ -371,6 +402,10 @@ dri_fill_st_visual(struct st_visual *stvis,
44 if (mode->sampleBuffers) {
45 stvis->samples = mode->samples;
47 + else {
48 + /* This must be done after stvis->color_format is set. */
49 + dri_force_msaa_visual(stvis, screen->base.screen);
50 + }
52 switch (mode->depthBits) {
53 default: