summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2018-11-01 12:59:24 +0100
committerGert Wollny <[email protected]>2018-11-02 11:52:44 +0100
commitb8e9c6522d8d1bc78be2bf1b411b22cc6615dbdf (patch)
treeb4e887c644c7c7a69a2759ff6d376b756683328d /src/mesa/swrast
parent742dace8251b764775ee049cf529715f90afecc1 (diff)
mesa/core: Add definitions and translations for EXT_texture_sRGB_R8
v2: - fix format definition line - disable for desktop GL - don't add GL_R8_EXT to glext.h since it is already in GLES2/gl2ext.h in glext.h and include this header where needed (all Emil) v3: - swrast: Fill the function table for sRGB_R8 The size of the function table is checked at compile time and must correspond to the number of mesa texture formats. dri/swrast being gles-2.0 doesn't support the extension though v4: - correct format layout comment (Ilia Mirkin) - correct logic for accepting GL_RED only textures (in part Ilia Mirkin) EXT_texture_sRGB_R8 requires OpenGL ES 3.0 which includes ARB_texture_rg/EXT_texture_rg, so one only must check for the first when SR8_EXT is really requested. v5: - add define for GL_ES8_XT to glheader.h and don't include GLES headers (Ilia Mirkin) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_texfetch.c1
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index fec8728a7a1..e8f4eb598a5 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -257,6 +257,7 @@ texfetch_funcs[] =
FETCH_FUNCS(A8L8_SRGB),
/* Array sRGB formats */
+ FETCH_FUNCS(R_SRGB8),
FETCH_FUNCS(L_SRGB8),
FETCH_FUNCS(BGR_SRGB8),
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 45bd8395048..8261ebf46ef 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -153,6 +153,7 @@ FETCH_RGBA(A8R8G8B8_SRGB, GLuint, 1)
FETCH_RGBA(R8G8B8A8_SRGB, GLuint, 1)
FETCH_RGBA(R8G8B8X8_SRGB, GLuint, 1)
FETCH_RGBA(X8B8G8R8_SRGB, GLuint, 1)
+FETCH_RGBA(R_SRGB8, GLubyte, 1)
FETCH_RGBA(L_SRGB8, GLubyte, 1)
FETCH_RGBA(L8A8_SRGB, GLushort, 1)
FETCH_RGBA(A8L8_SRGB, GLushort, 2)