gl: Consider also ARB_shader_bit_encoding to enable bit conversion

On drivers only supportinmg OpenGL 3.3, like llvmpipe, ARB_gpu_shader5 may
not be available, but (u)intBitsToFloat and floatBitsTo* are part of GLSL 330,
and are also availabe by enabling the extension ARB_shader_bit_encoding.

Consequently, check for this extension when ARB_gpu_shader5 is not available,
require it when available, and enable the bit code path using these bit cast
functions accordingly.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
This commit is contained in:
Gert Wollny
2019-11-11 12:40:31 +01:00
committed by Baldur Karlsson
parent 44e7bbe439
commit b5890155b5
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -684,6 +684,7 @@ extern bool IsGLES;
EXT_TO_CHECK(33, 30, ARB_texture_swizzle) \
EXT_TO_CHECK(33, 99, ARB_occlusion_query2) \
EXT_TO_CHECK(33, 99, ARB_timer_query) \
EXT_TO_CHECK(33, 30, ARB_shader_bit_encoding) \
EXT_TO_CHECK(40, 32, ARB_draw_buffers_blend) \
EXT_TO_CHECK(40, 31, ARB_draw_indirect) \
EXT_TO_CHECK(40, 32, ARB_gpu_shader5) \
+4
View File
@@ -417,6 +417,10 @@ void GLReplay::InitDebugData()
texSampleDefines +=
"#define HAS_BIT_CONVERSION 1\n"
"#extension GL_ARB_gpu_shader5 : require\n";
else if(HasExt[ARB_shader_bit_encoding])
texSampleDefines +=
"#define HAS_BIT_CONVERSION 1\n"
"#extension GL_ARB_shader_bit_encoding : require\n";
}
vs = GenerateGLSLShader(GetEmbeddedResource(glsl_blit_vert), shaderType, glslBaseVer);