OSDN Git Service

mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]
authorChad Versace <chadversary@chromium.org>
Tue, 20 Jun 2017 23:53:36 +0000 (16:53 -0700)
committerChad Versace <chadversary@chromium.org>
Tue, 27 Jun 2017 23:56:28 +0000 (16:56 -0700)
commita1983223d8839a0c9f5ca5aaf305ca6d2e01860b
tree514e67fd002ed15351dc746a0ff17c5df772d596
parent4a10d6154e1a6086e1eecf0e17ab63cc41862ea6
mesa: Add _mesa_format_fallback_rgbx_to_rgba() [v2]

The new function takes a mesa_format and, if the format is an alpha
format with a non-alpha variant, returns the non-alpha format.
Otherwise, it returns the original format.

Example:
  input -> output

  // Fallback exists
  MESA_FORMAT_R8G8B8X8_UNORM -> MESA_FORMAT_R8G8B8A8_UNORM
  MESA_FORMAT_RGBX_UNORM16 -> MESA_FORMAT_RGBA_UNORM16

  // No fallback
  MESA_FORMAT_R8G8B8A8_UNORM -> MESA_FORMAT_R8G8B8A8_UNORM
  MESA_FORMAT_Z_FLOAT32 -> MESA_FORMAT_Z_FLOAT32

i965 will use this for EGLImages and DRIimages.

v2 (Jason Ekstrand):
 - Use mako
 - Rework to be easier to read
 - Write directly to the output file

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/Android.gen.mk
src/mesa/Makefile.am
src/mesa/Makefile.sources
src/mesa/main/.gitignore
src/mesa/main/format_fallback.py [new file with mode: 0644]
src/mesa/main/formats.h