summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.h
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-06-20 16:53:36 -0700
committerChad Versace <[email protected]>2017-06-27 16:56:28 -0700
commita1983223d8839a0c9f5ca5aaf305ca6d2e01860b (patch)
tree514e67fd002ed15351dc746a0ff17c5df772d596 /src/mesa/main/formats.h
parent4a10d6154e1a6086e1eecf0e17ab63cc41862ea6 (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.h')
-rw-r--r--src/mesa/main/formats.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index b88466f0368..62b5e0c1a7e 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -762,6 +762,9 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
GLenum format, GLenum type,
GLboolean swapBytes, GLenum *error);
+mesa_format
+_mesa_format_fallback_rgbx_to_rgba(mesa_format format);
+
#ifdef __cplusplus
}
#endif