[Mesa-dev] [PATCH 03/22] glformats: Add a mapping for MESA_FORMAT_S_UINT8

Erik Faye-Lund kusmabite at gmail.com
Thu Aug 10 06:48:45 UTC 2017


On Sat, Aug 5, 2017 at 11:39 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Map the user format of GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE to the
> internal format of MESA_FORMAT_S_UINT8.
> ---
>  src/mesa/main/glformats.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index 06be3ec48d..8ae833ca65 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -3472,6 +3472,10 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
>      * matching the OpenGL format and data type
>      */
>     switch (type) {
> +   case GL_UNSIGNED_BYTE:
> +      if (format == GL_STENCIL_INDEX)
> +         return MESA_FORMAT_S_UINT8;
> +      break;

The commit message says "GL_DEPTH_COMPONENT", but the code says
"GL_STENCIL_INDEX". I'm guessing the latter is the intended.


More information about the mesa-dev mailing list