def _create_buffer(self):
        """ Internal method to create the buffer object """
        self._compute_size_from_constraint()
        if not self._create():
            self.error("Failed to create buffer!")
            return False

        if self.create_default_region:
            self._source_region = PostProcessRegion.make(self._internal_buffer)

            if max(self._color_bits) == 0:
                self._source_region.set_attrib(ColorWriteAttrib.make(ColorWriteAttrib.M_none), 1000)
 Internal method to create the buffer object 
metadrive/render_pipeline/rpcore/render_target.py