summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-16 18:52:07 +0100
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-16 18:52:07 +0100
commit493cf7289be81f15a975d60b48e58b0132854323 (patch)
treece0312c41258ad27182bffada0faacb0b5a9d3ac
parente1883e3090510d943af54ae24cee3a637e4d72a5 (diff)
More bgfx HLSL fixups, nw
-rw-r--r--bgfx/chains/hlsl.json6
-rw-r--r--bgfx/effects/blit.json8
-rw-r--r--bgfx/effects/bloom_scale.json8
-rw-r--r--bgfx/effects/color.json8
-rw-r--r--bgfx/effects/deconverge.json8
-rw-r--r--bgfx/effects/defocus.json8
-rw-r--r--bgfx/effects/distortion.json8
-rw-r--r--bgfx/effects/ntsc_decode.json16
-rw-r--r--bgfx/effects/ntsc_encode.json22
-rw-r--r--bgfx/effects/phosphor.json8
-rw-r--r--bgfx/effects/post.json8
-rw-r--r--bgfx/effects/ratios.json8
-rw-r--r--bgfx/effects/screen_opaque.json8
-rw-r--r--bgfx/effects/tint.json8
-rw-r--r--bgfx/shaders/dx11/fs_blit.binbin40856 -> 40856 bytes
-rw-r--r--bgfx/shaders/dx11/fs_color.binbin43259 -> 43259 bytes
-rw-r--r--bgfx/shaders/dx11/fs_deconverge.binbin41062 -> 41062 bytes
-rw-r--r--bgfx/shaders/dx11/fs_defocus.binbin47854 -> 47854 bytes
-rw-r--r--bgfx/shaders/dx11/fs_distortion.binbin56047 -> 56047 bytes
-rw-r--r--bgfx/shaders/dx11/fs_gui.binbin40856 -> 40856 bytes
-rw-r--r--bgfx/shaders/dx11/fs_ntsc_decode.binbin58921 -> 58921 bytes
-rw-r--r--bgfx/shaders/dx11/fs_ntsc_encode.binbin48189 -> 48333 bytes
-rw-r--r--bgfx/shaders/dx11/fs_phosphor.binbin41094 -> 41094 bytes
-rw-r--r--bgfx/shaders/dx11/fs_post.binbin57905 -> 57905 bytes
-rw-r--r--bgfx/shaders/dx11/fs_ratios.binbin41118 -> 41118 bytes
-rw-r--r--bgfx/shaders/dx11/fs_screen.binbin40856 -> 40856 bytes
-rw-r--r--bgfx/shaders/dx11/fs_tint.binbin41011 -> 41011 bytes
-rw-r--r--bgfx/shaders/dx11/vs_blit.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_color.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_deconverge.binbin43891 -> 43891 bytes
-rw-r--r--bgfx/shaders/dx11/vs_defocus.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_distortion.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_gui.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_ntsc_decode.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_ntsc_encode.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_phosphor.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_post.binbin41216 -> 41216 bytes
-rw-r--r--bgfx/shaders/dx11/vs_ratios.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_screen.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx11/vs_tint.binbin38987 -> 38987 bytes
-rw-r--r--bgfx/shaders/dx9/fs_color.binbin1483 -> 1483 bytes
-rw-r--r--bgfx/shaders/dx9/fs_ntsc_encode.binbin3249 -> 3537 bytes
-rw-r--r--bgfx/shaders/gles/fs_ntsc_encode.binbin3035 -> 2879 bytes
-rw-r--r--bgfx/shaders/glsl/fs_ntsc_encode.binbin2881 -> 2730 bytes
-rw-r--r--bgfx/shaders/metal/fs_ntsc_encode.binbin3577 -> 3415 bytes
-rw-r--r--src/osd/modules/render/bgfx/chainentry.cpp28
-rw-r--r--src/osd/modules/render/bgfx/chainentry.h9
-rw-r--r--src/osd/modules/render/bgfx/chainentryreader.cpp4
-rw-r--r--src/osd/modules/render/bgfx/chainreader.cpp6
-rw-r--r--src/osd/modules/render/bgfx/entryuniform.h1
-rw-r--r--src/osd/modules/render/bgfx/fs_color.sc3
-rw-r--r--src/osd/modules/render/bgfx/fs_ntsc_encode.sc26
-rw-r--r--src/osd/modules/render/bgfx/target.cpp2
-rw-r--r--src/osd/modules/render/bgfx/targetmanager.cpp17
-rw-r--r--src/osd/modules/render/bgfx/texturemanager.cpp10
55 files changed, 127 insertions, 111 deletions
diff --git a/bgfx/chains/hlsl.json b/bgfx/chains/hlsl.json
index 6e7c82af52a..935833750de 100644
--- a/bgfx/chains/hlsl.json
+++ b/bgfx/chains/hlsl.json
@@ -7,7 +7,6 @@
{ "type": "float", "name": "a_value", "text": "NTSC A Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "b_value", "text": "NTSC B Value", "default": 50, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "cc_value", "text": "NTSC Color Carrier (Hz)", "default": 35795454, "max": 36795454, "min": 34795454, "step": 100, "scale": 0.0000001, "format": "%1.7f", "screen": "raster" },
- { "type": "float", "name": "o_value", "text": "NTSC Time Offset", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "p_value", "text": "NTSC Phase Offset", "default": 100, "max": 200, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
{ "type": "float", "name": "scan_time", "text": "NTSC Scanline Duration (uSec)", "default": 526, "max": 1500, "min": 1, "step": 1, "scale": 0.1, "format": "%3.1f", "screen": "raster" },
{ "type": "float", "name": "notch_width", "text": "NTSC Color Notch Filter Width", "default": 100, "max": 400, "min": 1, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "raster" },
@@ -46,8 +45,8 @@
{ "type": "vec2", "name": "shadow_uv_size", "text": "Shadow Mask UV Size ", "default": [ 48, 64 ], "max": [ 256, 256 ], "min": [ 0, 0 ], "step": 1, "scale": 0.00390625, "format": "%1.7f", "screen": "crt" },
{ "type": "vec2", "name": "shadow_uv_offset", "text": "Shadow Mask UV Offset ", "default": [ 0, 0 ], "max": [ 256, 256 ], "min": [ 0, 0 ], "step": 1, "scale": 0.00390625, "format": "%1.7f", "screen": "crt" },
{ "type": "int_enum", "name": "shadow_tile_mode", "text": "Shadow Mask Tile Mode", "default": 0, "max": 1, "min": 0, "step": 1, "scale": 1.0, "format": "%s", "screen": "crt", "strings": [ "Screen", "Source" ] },
- { "type": "float", "name": "humbar_alpha", "text": "Hum Bar Amount", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.7f", "screen": "crt" },
- { "type": "float", "name": "humbar_hertz_rate", "text": "Hum Bar Frequency", "default": 100, "max": 10000, "min": 0, "step": 1, "scale": 0.00001, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "humbar_alpha", "text": "Hum Bar Amount", "default": 0, "max": 100, "min": 0, "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" },
+ { "type": "float", "name": "humbar_hertz_rate", "text": "Hum Bar Frequency", "default": 100, "max": 10000, "min": 0, "step": 1, "scale": 0.00001, "format": "%1.7f", "screen": "crt" },
{ "type": "color", "name": "floor", "text": "Signal Floor, ", "default": [ 0, 0, 0 ], "max": [ 100, 100, 100 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" },
{ "type": "color", "name": "power", "text": "Signal Exponent, ", "default": [ 100, 100, 100 ], "max": [ 400, 400, 400 ], "min": [ 0, 0, 0 ], "step": 1, "scale": 0.01, "format": "%1.2f", "screen": "crt" },
@@ -116,7 +115,6 @@
{ "uniform": "u_a_value", "slider": "a_value" },
{ "uniform": "u_b_value", "slider": "b_value" },
{ "uniform": "u_cc_value", "slider": "cc_value" },
- { "uniform": "u_o_value", "slider": "o_value" },
{ "uniform": "u_scan_time", "slider": "scan_time" },
{ "uniform": "u_notch_width", "slider": "notch_width" },
{ "uniform": "u_y_freq_response", "slider": "y_freq_response" },
diff --git a/bgfx/effects/blit.json b/bgfx/effects/blit.json
index 2d2d281df62..3954b4d0b74 100644
--- a/bgfx/effects/blit.json
+++ b/bgfx/effects/blit.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/bloom_scale.json b/bgfx/effects/bloom_scale.json
index 0dfcdcee712..5ba081a5a19 100644
--- a/bgfx/effects/bloom_scale.json
+++ b/bgfx/effects/bloom_scale.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/color.json b/bgfx/effects/color.json
index 8e1ad25e167..41e38714e9c 100644
--- a/bgfx/effects/color.json
+++ b/bgfx/effects/color.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/deconverge.json b/bgfx/effects/deconverge.json
index 71a0c6e3cb8..69d67632497 100644
--- a/bgfx/effects/deconverge.json
+++ b/bgfx/effects/deconverge.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/defocus.json b/bgfx/effects/defocus.json
index bfbba4b388a..ddf8abf1b62 100644
--- a/bgfx/effects/defocus.json
+++ b/bgfx/effects/defocus.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/distortion.json b/bgfx/effects/distortion.json
index 785a1e8ee4d..e8fcb4722c7 100644
--- a/bgfx/effects/distortion.json
+++ b/bgfx/effects/distortion.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/ntsc_decode.json b/bgfx/effects/ntsc_decode.json
index ba57ae65f26..89e8288f8b2 100644
--- a/bgfx/effects/ntsc_decode.json
+++ b/bgfx/effects/ntsc_decode.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
@@ -19,10 +19,10 @@
"uniforms": [
{ "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
{ "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 0.0, 0.0, 0.0 ] },
- { "name": "u_o_value", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] },
+ { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.5, 0.5, 0.5 ] },
+ { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 3.5795454, 3.5795454, 3.5795454 ] },
+ { "name": "u_o_value", "type": "vec4", "values": [ 1.570796325, 1.570796325, 1.570796325, 1.570796325 ] },
{ "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] },
{ "name": "u_notch_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_y_freq_response", "type": "vec4", "values": [ 6.0, 0.0, 0.0, 0.0 ] },
diff --git a/bgfx/effects/ntsc_encode.json b/bgfx/effects/ntsc_encode.json
index 4d622b0dc10..9cee95af3c3 100644
--- a/bgfx/effects/ntsc_encode.json
+++ b/bgfx/effects/ntsc_encode.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
@@ -18,13 +18,13 @@
"fragment": "fs_ntsc_encode",
"uniforms": [
{ "name": "DiffuseSampler", "type": "int", "values": [ 1.0 ] },
- { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
- { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
- { "name": "u_cc_value", "type": "vec4", "values": [ 3.5795454, 0.0, 0.0, 0.0 ] },
- { "name": "u_p_value", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] },
+ { "name": "u_a_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_b_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_cc_value", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] },
+ { "name": "u_p_value", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] },
{ "name": "u_scan_time", "type": "vec4", "values": [ 52.6, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
- { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
+ { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] },
+ { "name": "u_jitter_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }
]
} \ No newline at end of file
diff --git a/bgfx/effects/phosphor.json b/bgfx/effects/phosphor.json
index 0efbad997de..68038e3e99b 100644
--- a/bgfx/effects/phosphor.json
+++ b/bgfx/effects/phosphor.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/post.json b/bgfx/effects/post.json
index 3afcc66b7ef..f73e2a0be7c 100644
--- a/bgfx/effects/post.json
+++ b/bgfx/effects/post.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/ratios.json b/bgfx/effects/ratios.json
index 0949172b0c9..7b8af5c1875 100644
--- a/bgfx/effects/ratios.json
+++ b/bgfx/effects/ratios.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/screen_opaque.json b/bgfx/effects/screen_opaque.json
index f03f1943404..121439837ab 100644
--- a/bgfx/effects/screen_opaque.json
+++ b/bgfx/effects/screen_opaque.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "1",
- "dstColor": "0",
- "srcAlpha": "1",
- "dstAlpha": "0"
+ "srcColor": "srcAlpha",
+ "dstColor": "1-srcAlpha",
+ "srcAlpha": "srcAlpha",
+ "dstAlpha": "1-srcAlpha"
},
"depth": {
"function": "always"
diff --git a/bgfx/effects/tint.json b/bgfx/effects/tint.json
index 7dfe9c8d709..9b022ebe993 100644
--- a/bgfx/effects/tint.json
+++ b/bgfx/effects/tint.json
@@ -1,10 +1,10 @@
{
"blend": {
"equation": "add",
- "srcColor": "srcAlpha",
- "dstColor": "1-srcAlpha",
- "srcAlpha": "srcAlpha",
- "dstAlpha": "1-srcAlpha"
+ "srcColor": "1",
+ "dstColor": "0",
+ "srcAlpha": "1",
+ "dstAlpha": "0"
},
"depth": {
"function": "always"
diff --git a/bgfx/shaders/dx11/fs_blit.bin b/bgfx/shaders/dx11/fs_blit.bin
index c395c6baf64..185d5a65b6a 100644
--- a/bgfx/shaders/dx11/fs_blit.bin
+++ b/bgfx/shaders/dx11/fs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_color.bin b/bgfx/shaders/dx11/fs_color.bin
index 3682b2f778b..ce7cde86c96 100644
--- a/bgfx/shaders/dx11/fs_color.bin
+++ b/bgfx/shaders/dx11/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_deconverge.bin b/bgfx/shaders/dx11/fs_deconverge.bin
index abf36790d75..3c6744c0def 100644
--- a/bgfx/shaders/dx11/fs_deconverge.bin
+++ b/bgfx/shaders/dx11/fs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_defocus.bin b/bgfx/shaders/dx11/fs_defocus.bin
index 4ae1928129d..3d4c59a7faf 100644
--- a/bgfx/shaders/dx11/fs_defocus.bin
+++ b/bgfx/shaders/dx11/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_distortion.bin b/bgfx/shaders/dx11/fs_distortion.bin
index 5d9fc697609..434d894b279 100644
--- a/bgfx/shaders/dx11/fs_distortion.bin
+++ b/bgfx/shaders/dx11/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_gui.bin b/bgfx/shaders/dx11/fs_gui.bin
index d08762737a0..0c91226bafa 100644
--- a/bgfx/shaders/dx11/fs_gui.bin
+++ b/bgfx/shaders/dx11/fs_gui.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_ntsc_decode.bin b/bgfx/shaders/dx11/fs_ntsc_decode.bin
index 5052d7790f5..ac5fd682c48 100644
--- a/bgfx/shaders/dx11/fs_ntsc_decode.bin
+++ b/bgfx/shaders/dx11/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_ntsc_encode.bin b/bgfx/shaders/dx11/fs_ntsc_encode.bin
index a797593e409..6f4d2bcfe36 100644
--- a/bgfx/shaders/dx11/fs_ntsc_encode.bin
+++ b/bgfx/shaders/dx11/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_phosphor.bin b/bgfx/shaders/dx11/fs_phosphor.bin
index 13c34469be7..bdc6523bb0d 100644
--- a/bgfx/shaders/dx11/fs_phosphor.bin
+++ b/bgfx/shaders/dx11/fs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_post.bin b/bgfx/shaders/dx11/fs_post.bin
index ae60d4bcca0..9797487029f 100644
--- a/bgfx/shaders/dx11/fs_post.bin
+++ b/bgfx/shaders/dx11/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_ratios.bin b/bgfx/shaders/dx11/fs_ratios.bin
index 38c7bda2b75..491c3f99f47 100644
--- a/bgfx/shaders/dx11/fs_ratios.bin
+++ b/bgfx/shaders/dx11/fs_ratios.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_screen.bin b/bgfx/shaders/dx11/fs_screen.bin
index 0a90b724289..392fe4252b4 100644
--- a/bgfx/shaders/dx11/fs_screen.bin
+++ b/bgfx/shaders/dx11/fs_screen.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/fs_tint.bin b/bgfx/shaders/dx11/fs_tint.bin
index 3aaeb95dc94..04ce07637ab 100644
--- a/bgfx/shaders/dx11/fs_tint.bin
+++ b/bgfx/shaders/dx11/fs_tint.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_blit.bin b/bgfx/shaders/dx11/vs_blit.bin
index 4d10fa1dae0..c116cc2a4e9 100644
--- a/bgfx/shaders/dx11/vs_blit.bin
+++ b/bgfx/shaders/dx11/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_color.bin b/bgfx/shaders/dx11/vs_color.bin
index 400a7013784..fbb6b7a15cc 100644
--- a/bgfx/shaders/dx11/vs_color.bin
+++ b/bgfx/shaders/dx11/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_deconverge.bin b/bgfx/shaders/dx11/vs_deconverge.bin
index a924a1404f4..8057739fc5a 100644
--- a/bgfx/shaders/dx11/vs_deconverge.bin
+++ b/bgfx/shaders/dx11/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_defocus.bin b/bgfx/shaders/dx11/vs_defocus.bin
index 61126720672..764b3bcce77 100644
--- a/bgfx/shaders/dx11/vs_defocus.bin
+++ b/bgfx/shaders/dx11/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_distortion.bin b/bgfx/shaders/dx11/vs_distortion.bin
index 3134e562a72..732acef5941 100644
--- a/bgfx/shaders/dx11/vs_distortion.bin
+++ b/bgfx/shaders/dx11/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_gui.bin b/bgfx/shaders/dx11/vs_gui.bin
index 2b2bf90facd..a4cb697e49b 100644
--- a/bgfx/shaders/dx11/vs_gui.bin
+++ b/bgfx/shaders/dx11/vs_gui.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_ntsc_decode.bin b/bgfx/shaders/dx11/vs_ntsc_decode.bin
index 38720f9f4e7..e8488bee668 100644
--- a/bgfx/shaders/dx11/vs_ntsc_decode.bin
+++ b/bgfx/shaders/dx11/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_ntsc_encode.bin b/bgfx/shaders/dx11/vs_ntsc_encode.bin
index a11b50097d1..eb7997d7482 100644
--- a/bgfx/shaders/dx11/vs_ntsc_encode.bin
+++ b/bgfx/shaders/dx11/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_phosphor.bin b/bgfx/shaders/dx11/vs_phosphor.bin
index decb727a8bd..42eca109791 100644
--- a/bgfx/shaders/dx11/vs_phosphor.bin
+++ b/bgfx/shaders/dx11/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_post.bin b/bgfx/shaders/dx11/vs_post.bin
index b4a48c5821f..3ec96991283 100644
--- a/bgfx/shaders/dx11/vs_post.bin
+++ b/bgfx/shaders/dx11/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_ratios.bin b/bgfx/shaders/dx11/vs_ratios.bin
index 680a1cf38d3..0544af5799e 100644
--- a/bgfx/shaders/dx11/vs_ratios.bin
+++ b/bgfx/shaders/dx11/vs_ratios.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_screen.bin b/bgfx/shaders/dx11/vs_screen.bin
index bcabfacc022..fe3145fa0ed 100644
--- a/bgfx/shaders/dx11/vs_screen.bin
+++ b/bgfx/shaders/dx11/vs_screen.bin
Binary files differ
diff --git a/bgfx/shaders/dx11/vs_tint.bin b/bgfx/shaders/dx11/vs_tint.bin
index 8b3a17cead0..ae2f439ccc3 100644
--- a/bgfx/shaders/dx11/vs_tint.bin
+++ b/bgfx/shaders/dx11/vs_tint.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/fs_color.bin b/bgfx/shaders/dx9/fs_color.bin
index a1c0521ad0e..b93489e973b 100644
--- a/bgfx/shaders/dx9/fs_color.bin
+++ b/bgfx/shaders/dx9/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/dx9/fs_ntsc_encode.bin b/bgfx/shaders/dx9/fs_ntsc_encode.bin
index 25f989f1d53..26d087e2f18 100644
--- a/bgfx/shaders/dx9/fs_ntsc_encode.bin
+++ b/bgfx/shaders/dx9/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/gles/fs_ntsc_encode.bin b/bgfx/shaders/gles/fs_ntsc_encode.bin
index 57b92885914..d2d5c0d24f7 100644
--- a/bgfx/shaders/gles/fs_ntsc_encode.bin
+++ b/bgfx/shaders/gles/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/fs_ntsc_encode.bin b/bgfx/shaders/glsl/fs_ntsc_encode.bin
index 53c7b6fec73..9d03f2897fe 100644
--- a/bgfx/shaders/glsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/glsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/fs_ntsc_encode.bin b/bgfx/shaders/metal/fs_ntsc_encode.bin
index 41224f621d4..01459d63024 100644
--- a/bgfx/shaders/metal/fs_ntsc_encode.bin
+++ b/bgfx/shaders/metal/fs_ntsc_encode.bin
Binary files differ
diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp
index ceec50f2706..8b36460ad0c 100644
--- a/src/osd/modules/render/bgfx/chainentry.cpp
+++ b/src/osd/modules/render/bgfx/chainentry.cpp
@@ -24,12 +24,13 @@
#include "vertex.h"
#include "suppressor.h"
-bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_suppressor*> suppressors, std::vector<bgfx_input_pair> inputs, std::vector<bgfx_entry_uniform*> uniforms, bgfx_target* output)
+bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_suppressor*> suppressors, std::vector<bgfx_input_pair> inputs, std::vector<bgfx_entry_uniform*> uniforms, target_manager& targets, std::string output)
: m_name(name)
, m_effect(effect)
, m_suppressors(suppressors)
, m_inputs(inputs)
, m_uniforms(uniforms)
+ , m_targets(targets)
, m_output(output)
{
}
@@ -104,16 +105,20 @@ void bgfx_chain_entry::submit(render_primitive* prim, int view, texture_manager&
source_dims->set(values, sizeof(float) * 2);
}
}
+
for (bgfx_entry_uniform* uniform : m_uniforms)
{
- uniform->bind();
+ if (uniform->name() != "DiffuseSampler")
+ {
+ uniform->bind();
+ }
}
- m_effect->submit(view, blend);
-
- if (m_output != nullptr)
+ m_effect->submit(view, blend);
+
+ if (m_targets.target(m_output) != nullptr)
{
- m_output->page_flip();
+ m_targets.target(m_output)->page_flip();
}
}
@@ -122,11 +127,12 @@ void bgfx_chain_entry::setup_view(int view, uint16_t screen_width, uint16_t scre
bgfx::FrameBufferHandle handle = BGFX_INVALID_HANDLE;
uint16_t width = screen_width;
uint16_t height = screen_height;
- if (m_output != nullptr)
+ if (m_targets.target(m_output) != nullptr)
{
- handle = m_output->target();
- width = m_output->width();
- height = m_output->height();
+ bgfx_target* output = m_targets.target(m_output);
+ handle = output->target();
+ width = output->width();
+ height = output->height();
}
bgfx::setViewFrameBuffer(view, handle);
@@ -136,7 +142,7 @@ void bgfx_chain_entry::setup_view(int view, uint16_t screen_width, uint16_t scre
bx::mtxIdentity(viewMat);
float projMat[16];
- bx::mtxOrtho(projMat, 0.0f, width, height, 0.0f, 0.0f, 100.0f);
+ bx::mtxOrtho(projMat, 0.0f, screen_width, screen_height, 0.0f, 0.0f, 100.0f);
bgfx::setViewTransform(view, viewMat, projMat);
bgfx::setViewClear(view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x000000ff, 1.0f, 0);
diff --git a/src/osd/modules/render/bgfx/chainentry.h b/src/osd/modules/render/bgfx/chainentry.h
index f9ed1aa6358..d6e7edeaf09 100644
--- a/src/osd/modules/render/bgfx/chainentry.h
+++ b/src/osd/modules/render/bgfx/chainentry.h
@@ -20,6 +20,7 @@
#include <vector>
#include "inputpair.h"
+#include "targetmanager.h"
class render_primitive;
class bgfx_effect;
@@ -27,18 +28,19 @@ class bgfx_target;
class bgfx_entry_uniform;
class bgfx_suppressor;
class texture_manager;
+class target_manager;
class bgfx_chain_entry
{
public:
- bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_suppressor*> suppressors, std::vector<bgfx_input_pair> inputs, std::vector<bgfx_entry_uniform*> uniforms, bgfx_target* output);
+ bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_suppressor*> suppressors, std::vector<bgfx_input_pair> inputs, std::vector<bgfx_entry_uniform*> uniforms, target_manager& targets, std::string output);
~bgfx_chain_entry();
void submit(render_primitive* prim, int view, texture_manager& textures, uint16_t screen_width, uint16_t screen_height, uint64_t blend);
// Getters
std::string name() const { return m_name; }
- bgfx_target* target() const { return m_output; }
+ bgfx_target* target() const { return m_targets.target(m_output); }
bool skip();
private:
@@ -50,7 +52,8 @@ private:
std::vector<bgfx_suppressor*> m_suppressors;
std::vector<bgfx_input_pair> m_inputs;
std::vector<bgfx_entry_uniform*> m_uniforms;
- bgfx_target* m_output;
+ target_manager& m_targets;
+ std::string m_output;
};
#endif // __DRAWBGFX_CHAIN_ENTRY__
diff --git a/src/osd/modules/render/bgfx/chainentryreader.cpp b/src/osd/modules/render/bgfx/chainentryreader.cpp
index ce056b01900..0bf27e342cc 100644
--- a/src/osd/modules/render/bgfx/chainentryreader.cpp
+++ b/src/osd/modules/render/bgfx/chainentryreader.cpp
@@ -84,11 +84,11 @@ bgfx_chain_entry* chain_entry_reader::read_from_value(const Value& value, osd_op
std::string output_name = value["output"].GetString();
if (output_name != std::string("backbuffer"))
{
- return new bgfx_chain_entry(value["name"].GetString(), effect, suppressors, inputs, uniforms, targets.target(output_name));
+ return new bgfx_chain_entry(value["name"].GetString(), effect, suppressors, inputs, uniforms, targets, output_name);
}
else
{
- return new bgfx_chain_entry(value["name"].GetString(), effect, suppressors, inputs, uniforms, nullptr);
+ return new bgfx_chain_entry(value["name"].GetString(), effect, suppressors, inputs, uniforms, targets, "none");
}
}
diff --git a/src/osd/modules/render/bgfx/chainreader.cpp b/src/osd/modules/render/bgfx/chainreader.cpp
index d3632174516..5addfc6fffa 100644
--- a/src/osd/modules/render/bgfx/chainreader.cpp
+++ b/src/osd/modules/render/bgfx/chainreader.cpp
@@ -84,9 +84,9 @@ bgfx_chain* chain_reader::read_from_value(const Value& value, osd_options& optio
{
assert(target_array[i].HasMember("name"));
assert(target_array[i]["name"].IsString());
- uint32_t mode = uint32_t(get_enum_from_value(value, "mode", TARGET_STYLE_NATIVE, STYLE_NAMES, STYLE_COUNT));
- bool bilinear = get_bool(target_array[i], "bilinear", false);
- bool double_buffer = get_bool(target_array[i], "doublebuffer", false);
+ uint32_t mode = uint32_t(get_enum_from_value(target_array[i], "mode", TARGET_STYLE_NATIVE, STYLE_NAMES, STYLE_COUNT));
+ bool bilinear = get_bool(target_array[i], "bilinear", true);
+ bool double_buffer = get_bool(target_array[i], "doublebuffer", true);
float prescalef = 1.0f;
float default_prescale = 1.0f;
diff --git a/src/osd/modules/render/bgfx/entryuniform.h b/src/osd/modules/render/bgfx/entryuniform.h
index 9cef6c86825..a72b9e00cf5 100644
--- a/src/osd/modules/render/bgfx/entryuniform.h
+++ b/src/osd/modules/render/bgfx/entryuniform.h
@@ -25,6 +25,7 @@ public:
virtual ~bgfx_entry_uniform() { }
virtual void bind() = 0;
+ std::string name() const { return m_uniform->name(); }
protected:
bgfx_uniform* m_uniform;
diff --git a/src/osd/modules/render/bgfx/fs_color.sc b/src/osd/modules/render/bgfx/fs_color.sc
index 8ee80110440..a90b380a8a9 100644
--- a/src/osd/modules/render/bgfx/fs_color.sc
+++ b/src/osd/modules/render/bgfx/fs_color.sc
@@ -24,9 +24,6 @@ uniform vec4 u_saturation;
#define Scale u_scale.xyz
#define Saturation u_saturation.x
-uniform vec4 u_texsize;
-uniform vec4 u_screenrect;
-
SAMPLER2D(DiffuseSampler, 0);
void main()
diff --git a/src/osd/modules/render/bgfx/fs_ntsc_encode.sc b/src/osd/modules/render/bgfx/fs_ntsc_encode.sc
index 2a16d225183..52246d270dd 100644
--- a/src/osd/modules/render/bgfx/fs_ntsc_encode.sc
+++ b/src/osd/modules/render/bgfx/fs_ntsc_encode.sc
@@ -28,7 +28,7 @@ SAMPLER2D(DiffuseSampler, 0);
void main()
{
- vec2 PValueSourceTexel = vec2(u_p_value.x, 0.0) * u_source_dims.xy;
+ vec2 PValueSourceTexel = vec2(u_p_value.x, 0.0) / u_source_dims.xy;
vec2 C0 = v_texcoord0 + PValueSourceTexel * vec2(0.0, 0.0);
vec2 C1 = v_texcoord0 + PValueSourceTexel * vec2(0.25, 0.0);
@@ -41,6 +41,9 @@ void main()
vec4 Texel2 = texture2D(DiffuseSampler, C2);
vec4 Texel3 = texture2D(DiffuseSampler, C3);
+ vec4 HPosition = Cx;
+ vec4 VPosition = Cy;
+
const vec4 YDot = vec4(0.299, 0.587, 0.114, 0.0);
const vec4 IDot = vec4(0.595716, -0.274453, -0.321263, 0.0);
const vec4 QDot = vec4(0.211456, -0.522591, 0.311135, 0.0);
@@ -48,18 +51,17 @@ void main()
vec4 I = vec4(dot(Texel0, IDot), dot(Texel1, IDot), dot(Texel2, IDot), dot(Texel3, IDot));
vec4 Q = vec4(dot(Texel0, QDot), dot(Texel1, QDot), dot(Texel2, QDot), dot(Texel3, QDot));
- const vec4 PI = vec4(3.1415927, 3.1415927, 3.1415927, 3.1415927);
- const vec4 PI2 = vec4(6.2831854, 6.2831854, 6.2831854, 6.2831854);
- vec4 W = PI2 * u_cc_value.xxxx * u_scan_time.xxxx;
- vec4 WoPI = W / PI;
+ const float PI = 3.1415927;
+ const float PI2 = 6.2831854;
+
+ float W = PI2 * u_cc_value.x * u_scan_time.x;
+ float WoPI = W / PI;
- vec4 HOffset = (u_b_value.xxxx + u_jitter_amount.xxxx * u_jitter_offset.xxxx) / WoPI;
- vec4 VScale = (u_a_value.xxxx * u_source_dims.yyyy) / WoPI;
+ float HOffset = (u_a_value.x + u_jitter_amount.x * u_jitter_offset.x) / WoPI;
+ float VScale = (u_b_value.x * u_source_dims.y) / WoPI;
- vec4 T = Cx + HOffset + Cy * VScale;
+ vec4 T = Cx + vec4(HOffset, HOffset, HOffset, HOffset) + Cy * vec4(VScale, VScale, VScale, VScale);
vec4 TW = T * W;
- vec4 output_rgb = Y + I * cos(TW) + Q * sin(TW);
-
- gl_FragColor = vec4(output_rgb.xyz, 1.0);
-}
+ gl_FragColor = Y + I * cos(TW) + Q * sin(TW);
+} \ No newline at end of file
diff --git a/src/osd/modules/render/bgfx/target.cpp b/src/osd/modules/render/bgfx/target.cpp
index e6a12c5aff3..9fc05625b33 100644
--- a/src/osd/modules/render/bgfx/target.cpp
+++ b/src/osd/modules/render/bgfx/target.cpp
@@ -22,7 +22,7 @@ bgfx_target::bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uin
, m_page_count(double_buffer ? 2 : 1)
{
uint32_t wrap_mode = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP;
- uint32_t filter_mode = filter ? 0 : (BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT);
+ uint32_t filter_mode = filter ? (BGFX_TEXTURE_MIN_ANISOTROPIC | BGFX_TEXTURE_MAG_ANISOTROPIC) : (BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT);
m_textures = new bgfx::TextureHandle[m_page_count];
m_targets = new bgfx::FrameBufferHandle[m_page_count];
diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp
index e61bda90747..b04a280eb1d 100644
--- a/src/osd/modules/render/bgfx/targetmanager.cpp
+++ b/src/osd/modules/render/bgfx/targetmanager.cpp
@@ -58,19 +58,20 @@ void target_manager::update_guest_targets(uint16_t width, uint16_t height)
{
m_guest_width = width;
m_guest_height = height;
- std::vector<bgfx_target*> to_resize;
for (std::pair<std::string, bgfx_target*> target : m_targets)
{
if ((target.second)->style() == TARGET_STYLE_GUEST)
{
- to_resize.push_back(target.second);
+ bgfx_target* target_ptr = target.second;
+ std::string name = target_ptr->name();
+ const bgfx::TextureFormat::Enum format = target_ptr->format();
+ const bool double_buffered = target_ptr->double_buffered();
+ const bool filter = target_ptr->filter();
+ delete target_ptr;
+
+ target.second = new bgfx_target(name, format, width, height, TARGET_STYLE_GUEST, double_buffered, filter);
+ m_textures.add_provider(name, target.second);
}
}
-
- for (bgfx_target* target : to_resize)
- {
- m_targets[target->name()] = new bgfx_target(target->name(), target->format(), width, height, TARGET_STYLE_GUEST, target->double_buffered(), target->filter());
- delete target;
- }
}
}
diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp
index adf31790aec..3c32bcd13c3 100644
--- a/src/osd/modules/render/bgfx/texturemanager.cpp
+++ b/src/osd/modules/render/bgfx/texturemanager.cpp
@@ -28,7 +28,15 @@ texture_manager::~texture_manager()
void texture_manager::add_provider(std::string name, bgfx_texture_handle_provider* provider)
{
- m_textures[name] = provider;
+ std::map<std::string, bgfx_texture_handle_provider*>::iterator iter = m_textures.find(name);
+ if (iter != m_textures.end())
+ {
+ iter->second = provider;
+ }
+ else
+ {
+ m_textures[name] = provider;
+ }
}
bgfx_texture* texture_manager::create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags)