dri: Add param driCreateConfigs(mutable_render_buffer)
authorChad Versace <chadversary@chromium.org>
Sat, 31 Mar 2018 08:15:09 +0000 (01:15 -0700)
committerChad Versace <chadversary@chromium.org>
Tue, 7 Aug 2018 18:11:05 +0000 (11:11 -0700)
If set, then the config will have __DRI_ATTRIB_MUTABLE_RENDER_BUFFER,
which translates to EGL_MUTABLE_RENDER_BUFFER_BIT_KHR.

Not used yet.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/gallium/state_trackers/dri/dri_screen.c
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/common/utils.h
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/swrast/swrast.c

index fe4e39b3f931febcafbb5454b95ee31ded32e1ba..e5bc47391e73922dae2cafcc02b9cb90d7b10798 100644 (file)
@@ -274,7 +274,7 @@ dri_fill_in_modes(struct dri_screen *screen)
                                         depth_buffer_factor, back_buffer_modes,
                                         ARRAY_SIZE(back_buffer_modes),
                                         msaa_modes, 1,
-                                        GL_TRUE, !mixed_color_depth);
+                                        GL_TRUE, !mixed_color_depth, GL_FALSE);
          configs = driConcatConfigs(configs, new_configs);
 
          /* Multi-sample configs without an accumulation buffer. */
@@ -284,7 +284,7 @@ dri_fill_in_modes(struct dri_screen *screen)
                                            depth_buffer_factor, back_buffer_modes,
                                            ARRAY_SIZE(back_buffer_modes),
                                            msaa_modes+1, num_msaa_modes-1,
-                                           GL_FALSE, !mixed_color_depth);
+                                           GL_FALSE, !mixed_color_depth, GL_FALSE);
             configs = driConcatConfigs(configs, new_configs);
          }
       }
index 86169d5c21436ec6e9eefb0386398af4859f6d9a..88835a7add55638570c71c3bbe3e96f53282624f 100644 (file)
@@ -147,7 +147,10 @@ driGetRendererString( char * buffer, const char * hardware_name,
  * \param color_depth_match Whether the color depth must match the zs depth
  *                          This forces 32-bit color to have 24-bit depth, and
  *                          16-bit color to have 16-bit depth.
- * 
+ * \param mutable_render_buffer Enable __DRI_ATTRIB_MUTABLE_RENDER_BUFFER,
+ *                              which translates to
+ *                              EGL_MUTABLE_RENDER_BUFFER_BIT_KHR.
+ *
  * \returns
  * Pointer to any array of pointers to the \c __DRIconfig structures created
  * for the specified formats.  If there is an error, \c NULL is returned.
@@ -160,7 +163,8 @@ driCreateConfigs(mesa_format format,
                 unsigned num_depth_stencil_bits,
                 const GLenum * db_modes, unsigned num_db_modes,
                 const uint8_t * msaa_samples, unsigned num_msaa_modes,
-                GLboolean enable_accum, GLboolean color_depth_match)
+                GLboolean enable_accum, GLboolean color_depth_match,
+                GLboolean mutable_render_buffer)
 {
    static const uint32_t masks_table[][4] = {
       /* MESA_FORMAT_B5G6R5_UNORM */
@@ -325,6 +329,7 @@ driCreateConfigs(mesa_format format,
 
                    modes->yInverted = GL_TRUE;
                    modes->sRGBCapable = is_srgb;
+                   modes->mutableRenderBuffer = mutable_render_buffer;
                }
            }
        }
index 7be0465c2617c91ffbd35d74b51e706f7966416f..7c9719f9f426e3e7591cbe8de038f5d2bca79ee1 100644 (file)
@@ -45,7 +45,8 @@ driCreateConfigs(mesa_format format,
                 unsigned num_depth_stencil_bits,
                 const GLenum * db_modes, unsigned num_db_modes,
                 const uint8_t * msaa_samples, unsigned num_msaa_modes,
-                GLboolean enable_accum, GLboolean color_depth_match);
+                GLboolean enable_accum, GLboolean color_depth_match,
+                GLboolean mutable_render_buffer);
 
 __DRIconfig **driConcatConfigs(__DRIconfig **a,
                               __DRIconfig **b);
index 882c498622f8b8a9c9a7c0ab13424e18cba68445..27be9219e477f6949b3f39d74dad3c07fa3cfeb0 100644 (file)
@@ -1094,7 +1094,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
                                      num_depth_stencil_bits,
                                      back_buffer_modes, 2,
                                      singlesample_samples, 1,
-                                     false, false);
+                                     false, false, false);
       configs = driConcatConfigs(configs, new_configs);
    }
 
@@ -1116,7 +1116,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
                                      depth_bits, stencil_bits, 1,
                                      back_buffer_modes, 1,
                                      singlesample_samples, 1,
-                                     true, false);
+                                     true, false, false);
       configs = driConcatConfigs(configs, new_configs);
    }
 
index cb357419a774753c57202554fac458b004f31a48..f1c195c5d14e577a76e34aa6ce118248847340a0 100644 (file)
@@ -2195,7 +2195,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
                                      num_depth_stencil_bits,
                                      back_buffer_modes, 2,
                                      singlesample_samples, 1,
-                                     false, false);
+                                     false, false, false);
       configs = driConcatConfigs(configs, new_configs);
    }
 
@@ -2222,7 +2222,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
                                      depth_bits, stencil_bits, 1,
                                      back_buffer_modes, 1,
                                      singlesample_samples, 1,
-                                     true, false);
+                                     true, false, false);
       configs = driConcatConfigs(configs, new_configs);
    }
 
@@ -2289,7 +2289,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
                                      back_buffer_modes, 1,
                                      multisample_samples,
                                      num_msaa_modes,
-                                     false, false);
+                                     false, false, false);
       configs = driConcatConfigs(configs, new_configs);
    }
 
index 95b3469daae821e303270d3cc2c812ec0bb578b0..a3be805d048483c122bf426301ab43d6ff780364 100644 (file)
@@ -78,7 +78,7 @@ nouveau_get_configs(uint32_t chipset)
                                          ARRAY_SIZE(back_buffer_modes),
                                          msaa_samples,
                                          ARRAY_SIZE(msaa_samples),
-                                         GL_TRUE, chipset < 0x10);
+                                         GL_TRUE, chipset < 0x10, GL_FALSE);
                assert(config);
 
                configs = driConcatConfigs(configs, config);
index 51af452e2455cde7857f2fa4e2ffcb727d730dae..438844aac0c64e9422665fb74deb1a51c705040a 100644 (file)
@@ -804,7 +804,7 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
                                     ARRAY_SIZE(back_buffer_modes),
                                     msaa_samples_array,
                                     ARRAY_SIZE(msaa_samples_array),
-                                    GL_TRUE, GL_FALSE);
+                                    GL_TRUE, GL_FALSE, GL_FALSE);
       configs = driConcatConfigs(configs, new_configs);
    }
 
index 4be993a95325b8815e05d8e2ae7ef3b6b0807ad1..524f9b17c6d67006888c57f5149cafa8eeda68dc 100644 (file)
@@ -272,7 +272,7 @@ swrastFillInModes(__DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
                               back_buffer_factor, msaa_samples_array, 1,
-                              GL_TRUE, GL_FALSE);
+                              GL_TRUE, GL_FALSE, GL_FALSE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);