summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderimage.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-01-10 14:02:51 -0800
committerEric Anholt <[email protected]>2020-02-05 10:31:09 -0800
commitbb615e5fe3f68d0dc8210e6b09ced6913b433103 (patch)
tree09d29faf6605eb28cb46385513e3e584dd733276 /src/mesa/main/shaderimage.c
parent23c137612bea1e319ecdfb894c020b6651f4909a (diff)
mesa: Clean up some endianness adapters for shader image formats.
We already had a uint version in formats.h, move the snorm/unorm ones there, too. Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3355>
Diffstat (limited to 'src/mesa/main/shaderimage.c')
-rw-r--r--src/mesa/main/shaderimage.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index 5deca07b6a4..b0ff09f256d 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -36,21 +36,6 @@
#include "teximage.h"
#include "enums.h"
-/*
- * Define endian-invariant aliases for some mesa formats that are
- * defined in terms of their channel layout from LSB to MSB in a
- * 32-bit word. The actual byte offsets matter here because the user
- * is allowed to bit-cast one format into another and get predictable
- * results.
- */
-#ifdef MESA_BIG_ENDIAN
-# define MESA_FORMAT_RGBA_8 MESA_FORMAT_A8B8G8R8_UNORM
-# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_A8B8G8R8_SNORM
-#else
-# define MESA_FORMAT_RGBA_8 MESA_FORMAT_R8G8B8A8_UNORM
-# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_R8G8B8A8_SNORM
-#endif
-
mesa_format
_mesa_get_shader_image_format(GLenum format)
{
@@ -140,7 +125,7 @@ _mesa_get_shader_image_format(GLenum format)
return MESA_FORMAT_R10G10B10A2_UNORM;
case GL_RGBA8:
- return MESA_FORMAT_RGBA_8;
+ return MESA_FORMAT_RGBA_UNORM8;
case GL_RG16:
return MESA_FORMAT_RG_UNORM16;
@@ -158,7 +143,7 @@ _mesa_get_shader_image_format(GLenum format)
return MESA_FORMAT_RGBA_SNORM16;
case GL_RGBA8_SNORM:
- return MESA_FORMAT_SIGNED_RGBA_8;
+ return MESA_FORMAT_RGBA_SNORM8;
case GL_RG16_SNORM:
return MESA_FORMAT_RG_SNORM16;
@@ -286,7 +271,7 @@ get_image_format_class(mesa_format format)
case MESA_FORMAT_R10G10B10A2_UNORM:
return IMAGE_FORMAT_CLASS_2_10_10_10;
- case MESA_FORMAT_RGBA_8:
+ case MESA_FORMAT_RGBA_UNORM8:
return IMAGE_FORMAT_CLASS_4X8;
case MESA_FORMAT_RG_UNORM16:
@@ -304,7 +289,7 @@ get_image_format_class(mesa_format format)
case MESA_FORMAT_RGBA_SNORM16:
return IMAGE_FORMAT_CLASS_4X16;
- case MESA_FORMAT_SIGNED_RGBA_8:
+ case MESA_FORMAT_RGBA_SNORM8:
return IMAGE_FORMAT_CLASS_4X8;
case MESA_FORMAT_RG_SNORM16: