summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
authorGravatarGravatar Julian Sikorski <belegdol+github@gmail.com>2019-11-13 04:08:23 +0100
committerGravatarGravatar R. Belmont <rb6502@users.noreply.github.com>2019-11-12 22:08:23 -0500
commit0c70101b74db61f883fdd7907a4975ffff735044 (patch)
tree067ae1c831088d6853b6f443e5a05a4c5d8cd7aa /src/osd
parentc089bea7011de9ca78f43979d902978a113d33e2 (diff)
Sync bgfx, bx and bimg with upstream; fix the hlsl fs_chroma.sc matrix transposition properly (#5875)
* Sync bgfx with upstream revision 280420d * Sync bx with upstream revision 267727d * Sync bimg with upstream revision c1bab10 * Use bgfx helper functions to ensure correct matrix orientation * Rebuild hlsl chain
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc16
-rw-r--r--src/osd/modules/render/bgfx/shaders/shader.mk8
2 files changed, 8 insertions, 16 deletions
diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
index c0d8ba07ac7..2c11ac8499b 100644
--- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
+++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc
@@ -23,19 +23,11 @@ void main()
vec4 cout = vec4(0.0, 0.0, 0.0, cin.a);
mat3 xy = mat3(u_chroma_a.xyz, u_chroma_b.xyz, u_chroma_c.xyz);
-#ifdef TRANSPOSED_XYZ_TO_sRGB
- const mat3 XYZ_TO_sRGB = mat3(
- 3.2406, -0.9689, 0.0557,
- -1.5372, 1.8758, -0.2040,
- -0.4986, 0.0415, 1.0570
+ mat3 XYZ_TO_sRGB = mtxFromRows3(
+ vec3( 3.2406, -1.5372, -0.4986),
+ vec3(-0.9689, 1.8758, 0.0415),
+ vec3( 0.0557, -0.2040, 1.0570)
);
-#else
- const mat3 XYZ_TO_sRGB = mat3(
- 3.2406, -1.5372, -0.4986,
- -0.9689, 1.8758, 0.0415,
- 0.0557, -0.2040, 1.0570
- );
-#endif
for (int i = 0; i < 3; ++i) {
float Y = u_y_gain[i] * cin[i];
diff --git a/src/osd/modules/render/bgfx/shaders/shader.mk b/src/osd/modules/render/bgfx/shaders/shader.mk
index b9cf2f47cef..e7db3cdc242 100644
--- a/src/osd/modules/render/bgfx/shaders/shader.mk
+++ b/src/osd/modules/render/bgfx/shaders/shader.mk
@@ -43,24 +43,24 @@ SHADER_PATH=shaders/dx11/$(SHADERS_DIR)
else
ifeq ($(TARGET), 2)
VS_FLAGS=--platform nacl
-FS_FLAGS=--platform nacl --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform nacl
SHADER_PATH=shaders/essl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 3)
VS_FLAGS=--platform android
-FS_FLAGS=--platform android --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform android
CS_FLAGS=--platform android
SHADER_PATH=shaders/essl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 4)
VS_FLAGS=--platform linux -p 120
-FS_FLAGS=--platform linux -p 120 --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform linux -p 120
CS_FLAGS=--platform linux -p 430
SHADER_PATH=shaders/glsl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 5)
VS_FLAGS=--platform osx -p metal
-FS_FLAGS=--platform osx -p metal --define TRANSPOSED_XYZ_TO_sRGB
+FS_FLAGS=--platform osx -p metal
CS_FLAGS=--platform osx -p metal
SHADER_PATH=shaders/metal/$(SHADERS_DIR)
else