summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/render/bgfx')
-rw-r--r--src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_chroma.sc9
-rw-r--r--src/osd/modules/render/bgfx/shaders/makefile26
-rw-r--r--src/osd/modules/render/bgfx/shaders/shader.mk8
-rw-r--r--src/osd/modules/render/bgfx/uniform.cpp6
-rw-r--r--src/osd/modules/render/bgfx/uniformreader.cpp2
-rw-r--r--src/osd/modules/render/bgfx/vertex.h2
6 files changed, 32 insertions, 21 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 51bb14676d3..c0d8ba07ac7 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
@@ -22,11 +22,20 @@ void main()
vec4 cin = texture2D(s_tex, v_texcoord0);
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
);
+#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/makefile b/src/osd/modules/render/bgfx/shaders/makefile
index 1ca45471b9b..7a058e7810f 100644
--- a/src/osd/modules/render/bgfx/shaders/makefile
+++ b/src/osd/modules/render/bgfx/shaders/makefile
@@ -15,22 +15,24 @@ endif
$(SUBDIRS):
@echo $@
ifeq ($(OS),windows)
- @make -s --no-print-directory TARGET=0 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=1 SHADERS_DIR=$@/ clean all
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=0 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=1 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
endif
- @make -s --no-print-directory TARGET=2 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=3 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=4 SHADERS_DIR=$@/ clean all
- @make -s --no-print-directory TARGET=5 SHADERS_DIR=$@/ clean all
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=2 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=3 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=4 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=5 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=7 SHADERS_DIR=$@/ clean all SILENT="$(SILENT)"
main:
ifeq ($(OS),windows)
- @make -s --no-print-directory TARGET=0 clean all
- @make -s --no-print-directory TARGET=1 clean all
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=0 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=1 clean all SILENT="$(SILENT)"
endif
- @make -s --no-print-directory TARGET=2 clean all
- @make -s --no-print-directory TARGET=3 clean all
- @make -s --no-print-directory TARGET=4 clean all
- @make -s --no-print-directory TARGET=5 clean all
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=2 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=3 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=4 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=5 clean all SILENT="$(SILENT)"
+ $(SILENT) $(MAKE) -s --no-print-directory TARGET=7 clean all SILENT="$(SILENT)"
.PHONY: main rebuild $(SUBDIRS)
diff --git a/src/osd/modules/render/bgfx/shaders/shader.mk b/src/osd/modules/render/bgfx/shaders/shader.mk
index e7db3cdc242..b9cf2f47cef 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
+FS_FLAGS=--platform nacl --define TRANSPOSED_XYZ_TO_sRGB
SHADER_PATH=shaders/essl/$(SHADERS_DIR)
else
ifeq ($(TARGET), 3)
VS_FLAGS=--platform android
-FS_FLAGS=--platform android
+FS_FLAGS=--platform android --define TRANSPOSED_XYZ_TO_sRGB
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
+FS_FLAGS=--platform linux -p 120 --define TRANSPOSED_XYZ_TO_sRGB
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
+FS_FLAGS=--platform osx -p metal --define TRANSPOSED_XYZ_TO_sRGB
CS_FLAGS=--platform osx -p metal
SHADER_PATH=shaders/metal/$(SHADERS_DIR)
else
diff --git a/src/osd/modules/render/bgfx/uniform.cpp b/src/osd/modules/render/bgfx/uniform.cpp
index ef33c11f128..dc81475ad59 100644
--- a/src/osd/modules/render/bgfx/uniform.cpp
+++ b/src/osd/modules/render/bgfx/uniform.cpp
@@ -29,7 +29,7 @@ bgfx_uniform::~bgfx_uniform()
void bgfx_uniform::upload()
{
- if (m_type != bgfx::UniformType::Int1)
+ if (m_type != bgfx::UniformType::Sampler)
{
bgfx::setUniform(m_handle, m_data);
}
@@ -42,7 +42,7 @@ bgfx_uniform* bgfx_uniform::set(float* value)
bgfx_uniform* bgfx_uniform::set_int(int value)
{
- return set(&value, get_size_for_type(bgfx::UniformType::Int1));
+ return set(&value, get_size_for_type(bgfx::UniformType::Sampler));
}
bgfx_uniform* bgfx_uniform::set_mat3(float* value)
@@ -69,7 +69,7 @@ size_t bgfx_uniform::get_size_for_type(bgfx::UniformType::Enum type)
case bgfx::UniformType::Vec4:
return sizeof(float) * 4;
- case bgfx::UniformType::Int1:
+ case bgfx::UniformType::Sampler:
return sizeof(int);
case bgfx::UniformType::Mat3:
diff --git a/src/osd/modules/render/bgfx/uniformreader.cpp b/src/osd/modules/render/bgfx/uniformreader.cpp
index 3e3cb5db318..c97ca484e48 100644
--- a/src/osd/modules/render/bgfx/uniformreader.cpp
+++ b/src/osd/modules/render/bgfx/uniformreader.cpp
@@ -11,7 +11,7 @@
#include "uniform.h"
const uniform_reader::string_to_enum uniform_reader::TYPE_NAMES[uniform_reader::TYPE_COUNT] = {
- { "int", bgfx::UniformType::Int1 },
+ { "int", bgfx::UniformType::Sampler },
{ "vec4", bgfx::UniformType::Vec4 },
{ "mat3", bgfx::UniformType::Mat3 },
{ "mat4", bgfx::UniformType::Mat4 }
diff --git a/src/osd/modules/render/bgfx/vertex.h b/src/osd/modules/render/bgfx/vertex.h
index 32b3c36064f..2036296a9d0 100644
--- a/src/osd/modules/render/bgfx/vertex.h
+++ b/src/osd/modules/render/bgfx/vertex.h
@@ -31,7 +31,7 @@ struct ScreenVertex
.end();
}
- static bgfx::VertexDecl ms_decl;
+ static bgfx::VertexLayout ms_decl;
};
#endif // __DRAWBGFX_VERTEX__