diff --git a/bgfx/chains/crt-geom-deluxe.json b/bgfx/chains/crt-geom-deluxe.json index 9978c2279a8..f138845c774 100644 --- a/bgfx/chains/crt-geom-deluxe.json +++ b/bgfx/chains/crt-geom-deluxe.json @@ -283,7 +283,6 @@ }, { "effect": "crt-geom/phosphor_apply", - "applytint": true, "name": "phosphor apply", "uniforms": [ { "uniform": "u_phosphor_power", "slider": "phosphor_power" }, diff --git a/bgfx/chains/crt-geom.json b/bgfx/chains/crt-geom.json index 34cccc2d040..da6fb4e3e2c 100644 --- a/bgfx/chains/crt-geom.json +++ b/bgfx/chains/crt-geom.json @@ -163,7 +163,6 @@ "passes": [ { "effect": "crt-geom/crt-geom", - "applytint": true, "name": "CRT", "uniforms": [ { "uniform": "curvature", "slider": "curvature" }, diff --git a/bgfx/chains/default.json b/bgfx/chains/default.json index 5df37df64c7..44110127cf2 100644 --- a/bgfx/chains/default.json +++ b/bgfx/chains/default.json @@ -3,12 +3,12 @@ "targets": [ { "name": "temp", "mode": "guest", - "bilinear": true + "bilinear": true, + "user_prescale": true } ], "passes": [ { "effect": "misc/blit", - "applytint": true, "name": "Copy To Filtered Texture", "input": [ { "sampler": "s_tex", "texture": "screen" } diff --git a/bgfx/chains/eagle/super-eagle.json b/bgfx/chains/eagle/super-eagle.json index 64cf0a38244..6eb46bb89a6 100644 --- a/bgfx/chains/eagle/super-eagle.json +++ b/bgfx/chains/eagle/super-eagle.json @@ -26,7 +26,6 @@ "passes": [ { "effect": "eagle/supereagle", - "applytint": true, "name": "Super Eagle pass", "input": [ { "sampler": "decal", "texture": "screen" }, diff --git a/bgfx/chains/hlsl.json b/bgfx/chains/hlsl.json index 3164339ff0b..59b56153f44 100644 --- a/bgfx/chains/hlsl.json +++ b/bgfx/chains/hlsl.json @@ -204,7 +204,6 @@ "input": [ { "sampler": "s_tex", "texture": "screen" } ], - "applytint": true, "output": "ntsc" }, { @@ -349,7 +348,6 @@ "input": [ { "sampler": "s_tex", "texture": "screen" } ], - "applytint": true, "output": "guest" }, { "effect": "hlsl/color", diff --git a/bgfx/chains/hqx/hq2x.json b/bgfx/chains/hqx/hq2x.json index 8f500549181..f26f773ad39 100644 --- a/bgfx/chains/hqx/hq2x.json +++ b/bgfx/chains/hqx/hq2x.json @@ -43,7 +43,6 @@ "passes": [ { "effect": "hqx/hq2x", - "applytint": true, "name": "HQ2x pass", "input": [ { "sampler": "decal", "texture": "screen" }, diff --git a/bgfx/chains/hqx/hq3x.json b/bgfx/chains/hqx/hq3x.json index 119946414f5..d06b3d6a499 100644 --- a/bgfx/chains/hqx/hq3x.json +++ b/bgfx/chains/hqx/hq3x.json @@ -43,7 +43,6 @@ "passes": [ { "effect": "hqx/hq3x", - "applytint": true, "name": "HQ3x pass", "input": [ { "sampler": "decal", "texture": "screen" }, diff --git a/bgfx/chains/hqx/hq4x.json b/bgfx/chains/hqx/hq4x.json index 9ba3f2edcdd..347ff1c18b5 100644 --- a/bgfx/chains/hqx/hq4x.json +++ b/bgfx/chains/hqx/hq4x.json @@ -43,7 +43,6 @@ "passes": [ { "effect": "hqx/hq4x", - "applytint": true, "name": "HQ4x pass", "input": [ { "sampler": "decal", "texture": "screen" }, diff --git a/bgfx/chains/lcd-grid.json b/bgfx/chains/lcd-grid.json index d12e7a26b4d..4e103640e93 100644 --- a/bgfx/chains/lcd-grid.json +++ b/bgfx/chains/lcd-grid.json @@ -123,7 +123,6 @@ }, { "effect": "lcd-grid/lcd-grid", - "applytint": true, "name": "LCD", "uniforms": [ { "uniform": "u_rsubpix", "slider": "rsubpix" }, diff --git a/bgfx/chains/lut.json b/bgfx/chains/lut.json index 6143410f009..50353b5292b 100644 --- a/bgfx/chains/lut.json +++ b/bgfx/chains/lut.json @@ -10,7 +10,6 @@ "passes": [ { "effect": "misc/blit", - "applytint": true, "name": "Copy To Filtered Texture", "input": [ { "sampler": "s_tex", "texture": "screen" } diff --git a/bgfx/chains/unfiltered.json b/bgfx/chains/unfiltered.json index d17a01f412b..ee64121dabd 100644 --- a/bgfx/chains/unfiltered.json +++ b/bgfx/chains/unfiltered.json @@ -2,7 +2,6 @@ "author": "Ryan Holtz", "passes": [ { "effect": "misc/blit", - "applytint": true, "name": "Unfiltered Upscale", "input": [ { "sampler": "s_tex", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-2xbr-3d-2p.json b/bgfx/chains/xbr/super-2xbr-3d-2p.json index 3f998786625..973ed3bbb1c 100644 --- a/bgfx/chains/xbr/super-2xbr-3d-2p.json +++ b/bgfx/chains/xbr/super-2xbr-3d-2p.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-2xbr-3d-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-2xbr-3d-3p-smoother.json b/bgfx/chains/xbr/super-2xbr-3d-3p-smoother.json index 37144fb1acc..7748d77a411 100644 --- a/bgfx/chains/xbr/super-2xbr-3d-3p-smoother.json +++ b/bgfx/chains/xbr/super-2xbr-3d-3p-smoother.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-2xbr-3d-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-4xbr-3d-4p.json b/bgfx/chains/xbr/super-4xbr-3d-4p.json index d88fcfff279..ea52a34aa14 100644 --- a/bgfx/chains/xbr/super-4xbr-3d-4p.json +++ b/bgfx/chains/xbr/super-4xbr-3d-4p.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-4xbr-3d-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-4xbr-3d-6p-smoother.json b/bgfx/chains/xbr/super-4xbr-3d-6p-smoother.json index 53cd24c0210..0089a92eec9 100644 --- a/bgfx/chains/xbr/super-4xbr-3d-6p-smoother.json +++ b/bgfx/chains/xbr/super-4xbr-3d-6p-smoother.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-4xbr-3d-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-xbr-2p.json b/bgfx/chains/xbr/super-xbr-2p.json index f733ab21610..df66e7dfa96 100644 --- a/bgfx/chains/xbr/super-xbr-2p.json +++ b/bgfx/chains/xbr/super-xbr-2p.json @@ -49,7 +49,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-xbr-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-xbr-3p-smoother.json b/bgfx/chains/xbr/super-xbr-3p-smoother.json index f7d2bf5165e..7c53a8f0fea 100644 --- a/bgfx/chains/xbr/super-xbr-3p-smoother.json +++ b/bgfx/chains/xbr/super-xbr-3p-smoother.json @@ -49,7 +49,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-xbr-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-xbr-6p.json b/bgfx/chains/xbr/super-xbr-6p.json index cffd4d24a26..f0e3d4e4c9e 100644 --- a/bgfx/chains/xbr/super-xbr-6p.json +++ b/bgfx/chains/xbr/super-xbr-6p.json @@ -63,7 +63,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-xbr-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-xbr-deposterize.json b/bgfx/chains/xbr/super-xbr-deposterize.json index 4010e7f1215..e3543ae41af 100644 --- a/bgfx/chains/xbr/super-xbr-deposterize.json +++ b/bgfx/chains/xbr/super-xbr-deposterize.json @@ -48,7 +48,6 @@ "passes": [ { "effect": "misc/deposterize-pass0", - "applytint": true, "name": "Deposterize, Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-xbr-fast-3p.json b/bgfx/chains/xbr/super-xbr-fast-3p.json index 7ccf13b1669..472a3cd5413 100644 --- a/bgfx/chains/xbr/super-xbr-fast-3p.json +++ b/bgfx/chains/xbr/super-xbr-fast-3p.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-xbr-fast-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/super-xbr-fast-6p.json b/bgfx/chains/xbr/super-xbr-fast-6p.json index a7d32c22907..cfdc3779a8b 100644 --- a/bgfx/chains/xbr/super-xbr-fast-6p.json +++ b/bgfx/chains/xbr/super-xbr-fast-6p.json @@ -55,7 +55,6 @@ "passes": [ { "effect": "xbr/super-xbr/super-xbr-fast-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "s0", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-hybrid.json b/bgfx/chains/xbr/xbr-hybrid.json index 963283618cc..b61095aaf36 100644 --- a/bgfx/chains/xbr/xbr-hybrid.json +++ b/bgfx/chains/xbr/xbr-hybrid.json @@ -22,7 +22,6 @@ "passes": [ { "effect": "xbr/xbr-hybrid/2xbr-hybrid-v4b", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv1-noblend.json b/bgfx/chains/xbr/xbr-lv1-noblend.json index 123dc565582..216edc4b0a6 100644 --- a/bgfx/chains/xbr/xbr-lv1-noblend.json +++ b/bgfx/chains/xbr/xbr-lv1-noblend.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv1-noblend", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-3d.json b/bgfx/chains/xbr/xbr-lv2-3d.json index 048f72e8e04..29a3ef24276 100644 --- a/bgfx/chains/xbr/xbr-lv2-3d.json +++ b/bgfx/chains/xbr/xbr-lv2-3d.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv2-3d", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-accuracy-multipass.json b/bgfx/chains/xbr/xbr-lv2-accuracy-multipass.json index 5258f7c9840..1e14d28ece0 100644 --- a/bgfx/chains/xbr/xbr-lv2-accuracy-multipass.json +++ b/bgfx/chains/xbr/xbr-lv2-accuracy-multipass.json @@ -41,7 +41,6 @@ "passes": [ { "effect": "xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-accuracy-smart-blur.json b/bgfx/chains/xbr/xbr-lv2-accuracy-smart-blur.json index b6e8ea3c8e4..5a7fffdb46e 100644 --- a/bgfx/chains/xbr/xbr-lv2-accuracy-smart-blur.json +++ b/bgfx/chains/xbr/xbr-lv2-accuracy-smart-blur.json @@ -21,7 +21,6 @@ "passes": [ { "effect": "xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-deposterize.json b/bgfx/chains/xbr/xbr-lv2-deposterize.json index 7451cd54ab4..63c55bd28cd 100644 --- a/bgfx/chains/xbr/xbr-lv2-deposterize.json +++ b/bgfx/chains/xbr/xbr-lv2-deposterize.json @@ -15,7 +15,6 @@ "passes": [ { "effect": "misc/deposterize-pass0", - "applytint": true, "name": "Deposterize, Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-fast.json b/bgfx/chains/xbr/xbr-lv2-fast.json index 26bcce5ef0b..466295b3d38 100644 --- a/bgfx/chains/xbr/xbr-lv2-fast.json +++ b/bgfx/chains/xbr/xbr-lv2-fast.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv2-fast", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-multipass.json b/bgfx/chains/xbr/xbr-lv2-multipass.json index 2dd34a9b9d3..287afbe8825 100644 --- a/bgfx/chains/xbr/xbr-lv2-multipass.json +++ b/bgfx/chains/xbr/xbr-lv2-multipass.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/xbr-lv2-multipass/xbr-lv2-c-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2-noblend.json b/bgfx/chains/xbr/xbr-lv2-noblend.json index db08feb2647..0721e6a903b 100644 --- a/bgfx/chains/xbr/xbr-lv2-noblend.json +++ b/bgfx/chains/xbr/xbr-lv2-noblend.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv2-noblend", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv2.json b/bgfx/chains/xbr/xbr-lv2.json index 3f589d734fe..49019d422b4 100644 --- a/bgfx/chains/xbr/xbr-lv2.json +++ b/bgfx/chains/xbr/xbr-lv2.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv2", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv3-multipass.json b/bgfx/chains/xbr/xbr-lv3-multipass.json index ac63612b704..6e9f49b8ebb 100644 --- a/bgfx/chains/xbr/xbr-lv3-multipass.json +++ b/bgfx/chains/xbr/xbr-lv3-multipass.json @@ -42,7 +42,6 @@ "passes": [ { "effect": "xbr/xbr-lv3-multipass/xbr-lv3-pass0", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv3-noblend.json b/bgfx/chains/xbr/xbr-lv3-noblend.json index 8f5b3ac2e2e..9e8e788d5fa 100644 --- a/bgfx/chains/xbr/xbr-lv3-noblend.json +++ b/bgfx/chains/xbr/xbr-lv3-noblend.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv3-noblend", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-lv3.json b/bgfx/chains/xbr/xbr-lv3.json index ddeb80874c9..1bb2352fe76 100644 --- a/bgfx/chains/xbr/xbr-lv3.json +++ b/bgfx/chains/xbr/xbr-lv3.json @@ -32,7 +32,6 @@ "passes": [ { "effect": "xbr/xbr-lv3", - "applytint": true, "name": "Main Pass", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-mlv4-dilation.json b/bgfx/chains/xbr/xbr-mlv4-dilation.json index 3ce4926ca8b..e9d80f8fb19 100644 --- a/bgfx/chains/xbr/xbr-mlv4-dilation.json +++ b/bgfx/chains/xbr/xbr-mlv4-dilation.json @@ -56,7 +56,6 @@ "passes": [ { "effect": "xbr/xbr-mlv4-multipass/xbr-mlv4-pass1", - "applytint": true, "name": "Pass 1", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/chains/xbr/xbr-mlv4-multipass.json b/bgfx/chains/xbr/xbr-mlv4-multipass.json index 2eb09a7f87d..64838263e22 100644 --- a/bgfx/chains/xbr/xbr-mlv4-multipass.json +++ b/bgfx/chains/xbr/xbr-mlv4-multipass.json @@ -49,7 +49,6 @@ "passes": [ { "effect": "xbr/xbr-mlv4-multipass/xbr-mlv4-pass1", - "applytint": true, "name": "Pass 0", "input": [ { "sampler": "decal", "texture": "screen" } diff --git a/bgfx/effects/blurs/smart-blur.json b/bgfx/effects/blurs/smart-blur.json index abc52469dbd..f997dad6767 100644 --- a/bgfx/effects/blurs/smart-blur.json +++ b/bgfx/effects/blurs/smart-blur.json @@ -48,8 +48,9 @@ "vertex": "chains/blurs/vs_smart-blur", "fragment": "chains/blurs/fs_smart-blur", "uniforms": [ - { "name": "s_p", "type": "int", "values": [ 1.0 ] }, - { "name": "SB_THRESHOLD", "type": "vec4", "values": [ 0.2, 0.2, 0.2, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "s_p", "type": "int", "values": [ 1.0 ] }, + { "name": "SB_THRESHOLD", "type": "vec4", "values": [ 0.2, 0.2, 0.2, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/crt-geom-deluxe.json b/bgfx/effects/crt-geom/crt-geom-deluxe.json index 08e4f2714c1..a33f124b4ef 100644 --- a/bgfx/effects/crt-geom/crt-geom-deluxe.json +++ b/bgfx/effects/crt-geom/crt-geom-deluxe.json @@ -20,33 +20,34 @@ "vertex": "chains/crt-geom/vs_crt-geom", "fragment": "chains/crt-geom/fs_crt-geom-deluxe", "uniforms": [ - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_rotation_type", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, - { "name": "mask_texture", "type": "int", "values": [ 1 ] }, - { "name": "blur_texture", "type": "int", "values": [ 2 ] }, - { "name": "mipmap_texture", "type": "int", "values": [ 3 ] }, - { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, - { "name": "monitorsRGB", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, - { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75,0.0, 0.0 ] }, - { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, - { "name": "angle", "type": "vec4", "values": [ 0.0,-0.05,0.0, 0.0 ] }, - { "name": "cornersize", "type": "vec4", "values": [ 0.01,0.0, 0.0, 0.0 ] }, - { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0,0.0,0.0,0.0 ] }, - { "name": "aperture_strength", "type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, - { "name": "aperture_brightboost","type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, - { "name": "spot_size", "type": "vec4", "values": [ 0.3,0.0,0.0,0.0 ] }, - { "name": "spot_growth", "type": "vec4", "values": [ 0.1,0.0,0.0,0.0 ] }, - { "name": "spot_growth_power", "type": "vec4", "values": [ 3.0,0.0,0.0,0.0 ] }, - { "name": "u_interp", "type": "vec4", "values": [ 2.0,0.0,0.0,0.0 ] }, - { "name": "halation", "type": "vec4", "values": [ 0.1,0.0,0.0,0.0 ] }, - { "name": "blurwidth", "type": "vec4", "values": [ 2.0,0.0,0.0,0.0 ] }, - { "name": "rasterbloom", "type": "vec4", "values": [ 0.01,0.0,0.0,0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_rotation_type", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, + { "name": "mask_texture", "type": "int", "values": [ 1 ] }, + { "name": "blur_texture", "type": "int", "values": [ 2 ] }, + { "name": "mipmap_texture", "type": "int", "values": [ 3 ] }, + { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, + { "name": "monitorsRGB", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75, 0.0, 0.0 ] }, + { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, + { "name": "angle", "type": "vec4", "values": [ 0.0, -0.05, 0.0, 0.0 ] }, + { "name": "cornersize", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, + { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0, 0.0, 0.0, 0.0 ] }, + { "name": "aperture_strength", "type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] }, + { "name": "aperture_brightboost","type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] }, + { "name": "spot_size", "type": "vec4", "values": [ 0.3, 0.0, 0.0, 0.0 ] }, + { "name": "spot_growth", "type": "vec4", "values": [ 0.1, 0.0, 0.0, 0.0 ] }, + { "name": "spot_growth_power", "type": "vec4", "values": [ 3.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_interp", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "halation", "type": "vec4", "values": [ 0.1, 0.0, 0.0, 0.0 ] }, + { "name": "blurwidth", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "rasterbloom", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/crt-geom.json b/bgfx/effects/crt-geom/crt-geom.json index e51f071495e..be3036a7620 100644 --- a/bgfx/effects/crt-geom/crt-geom.json +++ b/bgfx/effects/crt-geom/crt-geom.json @@ -20,28 +20,29 @@ "vertex": "chains/crt-geom/vs_crt-geom", "fragment": "chains/crt-geom/fs_crt-geom", "uniforms": [ - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_rotation_type", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, - { "name": "mask_texture", "type": "int", "values": [ 1 ] }, - { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, - { "name": "monitorsRGB", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, - { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75,0.0, 0.0 ] }, - { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, - { "name": "angle", "type": "vec4", "values": [ 0.0,-0.05,0.0, 0.0 ] }, - { "name": "cornersize", "type": "vec4", "values": [ 0.01,0.0, 0.0, 0.0 ] }, - { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0,0.0,0.0,0.0 ] }, - { "name": "aperture_strength", "type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, - { "name": "aperture_brightboost","type": "vec4", "values": [ 0.25,0.0,0.0,0.0 ] }, - { "name": "spot_size", "type": "vec4", "values": [ 0.3,0.0,0.0,0.0 ] }, - { "name": "spot_growth", "type": "vec4", "values": [ 0.1,0.0,0.0,0.0 ] }, - { "name": "spot_growth_power", "type": "vec4", "values": [ 3.0,0.0,0.0,0.0 ] }, - { "name": "u_interp", "type": "vec4", "values": [ 2.0,0.0,0.0,0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_rotation_type", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "mpass_texture", "type": "int", "values": [ 0 ] }, + { "name": "mask_texture", "type": "int", "values": [ 1 ] }, + { "name": "curvature", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "CRTgamma", "type": "vec4", "values": [ 2.4, 0.0, 0.0, 0.0 ] }, + { "name": "monitorsRGB", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "overscan", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "aspect", "type": "vec4", "values": [ 1.0, 0.75, 0.0, 0.0 ] }, + { "name": "d", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "R", "type": "vec4", "values": [ 3.5, 0.0, 0.0, 0.0 ] }, + { "name": "angle", "type": "vec4", "values": [ 0.0, -0.05, 0.0, 0.0 ] }, + { "name": "cornersize", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, + { "name": "cornersmooth", "type": "vec4", "values": [ 1000.0, 0.0, 0.0, 0.0 ] }, + { "name": "aperture_strength", "type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] }, + { "name": "aperture_brightboost","type": "vec4", "values": [ 0.25, 0.0, 0.0, 0.0 ] }, + { "name": "spot_size", "type": "vec4", "values": [ 0.3, 0.0, 0.0, 0.0 ] }, + { "name": "spot_growth", "type": "vec4", "values": [ 0.1, 0.0, 0.0, 0.0 ] }, + { "name": "spot_growth_power", "type": "vec4", "values": [ 3.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_interp", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/gaussx.json b/bgfx/effects/crt-geom/gaussx.json index 896e514f0e5..1cf0a6e9dd0 100644 --- a/bgfx/effects/crt-geom/gaussx.json +++ b/bgfx/effects/crt-geom/gaussx.json @@ -20,10 +20,11 @@ "vertex": "chains/crt-geom/vs_gaussx", "fragment": "chains/crt-geom/fs_gaussx", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_aspect", "type": "vec4", "values": [ 1.0,0.75, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_aspect", "type": "vec4", "values": [ 1.0, 0.75, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/gaussy.json b/bgfx/effects/crt-geom/gaussy.json index e3e539a4ce2..c4bcc5ddb01 100644 --- a/bgfx/effects/crt-geom/gaussy.json +++ b/bgfx/effects/crt-geom/gaussy.json @@ -20,10 +20,11 @@ "vertex": "chains/crt-geom/vs_gaussy", "fragment": "chains/crt-geom/fs_gaussy", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_aspect", "type": "vec4", "values": [ 1.0,0.75, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_width", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_aspect", "type": "vec4", "values": [ 1.0, 0.75, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/lowpass.json b/bgfx/effects/crt-geom/lowpass.json index d5467d0a9a7..76aa381c85c 100644 --- a/bgfx/effects/crt-geom/lowpass.json +++ b/bgfx/effects/crt-geom/lowpass.json @@ -20,9 +20,10 @@ "vertex": "chains/crt-geom/vs_lowpass", "fragment": "chains/crt-geom/fs_lowpass", "uniforms": [ - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, { "name": "u_lowpass_cutoff","type": "vec4", "values": [ 200.0, 0.0, 0.0, 0.0 ] }, { "name": "u_lowpass_width", "type": "vec4", "values": [ 80.0, 0.0, 0.0, 0.0 ] }, - { "name": "s_screen", "type": "int", "values": [ 0 ] } + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/mipmap8.json b/bgfx/effects/crt-geom/mipmap8.json index 78605feb939..f18bdd488bd 100644 --- a/bgfx/effects/crt-geom/mipmap8.json +++ b/bgfx/effects/crt-geom/mipmap8.json @@ -20,10 +20,11 @@ "vertex": "chains/crt-geom/vs_mipmap8", "fragment": "chains/crt-geom/fs_mipmap8", "uniforms": [ - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_smooth", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, - { "name": "s_screen", "type": "int", "values": [ 0 ] }, - { "name": "s_mipmap", "type": "int", "values": [ 1 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_smooth", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_mipmap", "type": "int", "values": [ 1 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/phosphor_apply.json b/bgfx/effects/crt-geom/phosphor_apply.json index f1c322c5b6e..a6344901a8d 100644 --- a/bgfx/effects/crt-geom/phosphor_apply.json +++ b/bgfx/effects/crt-geom/phosphor_apply.json @@ -20,11 +20,12 @@ "vertex": "chains/crt-geom/vs_phosphor_apply", "fragment": "chains/crt-geom/fs_phosphor_apply", "uniforms": [ - { "name": "s_screen", "type": "int", "values": [ 0 ] }, - { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, - { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor_cutoff", "type": "vec4", "values": [300.0,0.0, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, + { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor_amplitude", "type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor_cutoff", "type": "vec4", "values": [ 300.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/crt-geom/phosphor_update.json b/bgfx/effects/crt-geom/phosphor_update.json index 77740af02ba..cb221443d3a 100644 --- a/bgfx/effects/crt-geom/phosphor_update.json +++ b/bgfx/effects/crt-geom/phosphor_update.json @@ -20,11 +20,12 @@ "vertex": "chains/crt-geom/vs_phosphor_update", "fragment": "chains/crt-geom/fs_phosphor_update", "uniforms": [ - { "name": "s_screen", "type": "int", "values": [ 0 ] }, - { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, - { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor_cutoff", "type": "vec4", "values": [300.0,0.0, 0.0, 0.0 ] }, - { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_phosphor", "type": "int", "values": [ 1 ] }, + { "name": "u_phosphor_power", "type": "vec4", "values": [ 1.3, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor_amplitude","type": "vec4", "values": [ 0.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor_cutoff", "type": "vec4", "values": [ 300.0 ,0.0, 0.0, 0.0 ] }, + { "name": "u_gamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/default/blit.json b/bgfx/effects/default/blit.json index 82b4594dd7a..00d57f3f0b0 100644 --- a/bgfx/effects/default/blit.json +++ b/bgfx/effects/default/blit.json @@ -58,6 +58,12 @@ // // NOTE: Some names correspond to special values that will be automatically filled by the BGFX // code if they are used by the shader. These names are: + // "u_view_dims" + // The dimensions of the viewport. + // Valid values: xy + // "u_inv_view_dims" + // The reciprocal of u_view_dims. + // Valid values: xy // "u_screen_dims" // The dimensions of the first texture input if present, otherwise the dimensions of the output window. // Valid values: xy @@ -95,6 +101,7 @@ // "mat3": 9 floats // "mat4": 16 floats "values": [ 1.0 ] - } + }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/eagle/supereagle.json b/bgfx/effects/eagle/supereagle.json index ec919828d5c..3ae4387c15a 100644 --- a/bgfx/effects/eagle/supereagle.json +++ b/bgfx/effects/eagle/supereagle.json @@ -28,8 +28,9 @@ "vertex": "chains/eagle/vs_eagle", "fragment": "chains/eagle/fs_eagle", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "LUT", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "LUT", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/gui_add.json b/bgfx/effects/gui_add.json index 8b5da4998a1..72174b79b58 100644 --- a/bgfx/effects/gui_add.json +++ b/bgfx/effects/gui_add.json @@ -25,6 +25,7 @@ "vertex": "vs_gui", "fragment": "fs_gui", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/gui_blend.json b/bgfx/effects/gui_blend.json index 9cf160ac6ba..e73a8dd2f95 100644 --- a/bgfx/effects/gui_blend.json +++ b/bgfx/effects/gui_blend.json @@ -25,6 +25,7 @@ "vertex": "vs_gui", "fragment": "fs_gui", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/gui_multiply.json b/bgfx/effects/gui_multiply.json index 15ac24c91a9..047b1f437eb 100644 --- a/bgfx/effects/gui_multiply.json +++ b/bgfx/effects/gui_multiply.json @@ -10,9 +10,7 @@ "blend": { "equation": "add", "srcColor": "dstcolor", - "dstColor": "0", - "srcAlpha": "dstalpha", - "dstAlpha": "0" + "dstColor": "1-srcalpha" }, "depth": { "function": "always" @@ -25,6 +23,7 @@ "vertex": "vs_gui", "fragment": "fs_gui", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/gui_opaque.json b/bgfx/effects/gui_opaque.json index 51f0941c89f..f7f298145c7 100644 --- a/bgfx/effects/gui_opaque.json +++ b/bgfx/effects/gui_opaque.json @@ -6,13 +6,6 @@ // //============================================================ { - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, "depth": { "function": "always" }, @@ -24,6 +17,7 @@ "vertex": "vs_gui", "fragment": "fs_gui", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/blit.json b/bgfx/effects/hlsl/blit.json index 1fdfd623638..7aa7f37f5e9 100644 --- a/bgfx/effects/hlsl/blit.json +++ b/bgfx/effects/hlsl/blit.json @@ -116,6 +116,7 @@ // "mat3": 9 floats // "mat4": 16 floats "values": [ 1.0 ] - } + }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/chroma.json b/bgfx/effects/hlsl/chroma.json index 96bae4475f8..64ddb4db311 100644 --- a/bgfx/effects/hlsl/chroma.json +++ b/bgfx/effects/hlsl/chroma.json @@ -24,10 +24,11 @@ "vertex": "chains/hlsl/vs_chroma", "fragment": "chains/hlsl/fs_chroma", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0.0 ] }, - { "name": "u_y_gain", "type": "vec4", "values": [ 0.2124, 0.7011, 0.0866, 0.0 ] }, - { "name": "u_chroma_a", "type": "vec4", "values": [ 0.630, 0.340, 0.0, 0.0 ] }, - { "name": "u_chroma_b", "type": "vec4", "values": [ 0.310, 0.595, 0.0, 0.0 ] }, - { "name": "u_chroma_c", "type": "vec4", "values": [ 0.155, 0.070, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 0.0 ] }, + { "name": "u_y_gain", "type": "vec4", "values": [ 0.2124, 0.7011, 0.0866, 0.0 ] }, + { "name": "u_chroma_a", "type": "vec4", "values": [ 0.630, 0.340, 0.0, 0.0 ] }, + { "name": "u_chroma_b", "type": "vec4", "values": [ 0.310, 0.595, 0.0, 0.0 ] }, + { "name": "u_chroma_c", "type": "vec4", "values": [ 0.155, 0.070, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/color.json b/bgfx/effects/hlsl/color.json index 69743d6cab5..8916f5b2b3a 100644 --- a/bgfx/effects/hlsl/color.json +++ b/bgfx/effects/hlsl/color.json @@ -24,12 +24,13 @@ "vertex": "chains/hlsl/vs_color", "fragment": "chains/hlsl/fs_color", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_red_ratios", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_grn_ratios", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_blu_ratios", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] }, - { "name": "u_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scale", "type": "vec4", "values": [ 0.95, 0.95, 0.95, 0.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.5, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_red_ratios", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_grn_ratios", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_blu_ratios", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] }, + { "name": "u_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scale", "type": "vec4", "values": [ 0.95, 0.95, 0.95, 0.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.5, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/deconverge.json b/bgfx/effects/hlsl/deconverge.json index 053bc078c64..ca496f2c534 100644 --- a/bgfx/effects/hlsl/deconverge.json +++ b/bgfx/effects/hlsl/deconverge.json @@ -25,13 +25,14 @@ "vertex": "chains/hlsl/vs_deconverge", "fragment": "chains/hlsl/fs_deconverge", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, { "name": "u_source_size", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, - { "name": "u_converge_red", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, - { "name": "u_converge_green", "type": "vec4", "values": [ 0.0, 0.5, 0.0, 0.0 ] }, - { "name": "u_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radial_converge_red", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radial_converge_green", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radial_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + { "name": "u_converge_red", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, + { "name": "u_converge_green", "type": "vec4", "values": [ 0.0, 0.5, 0.0, 0.0 ] }, + { "name": "u_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radial_converge_red", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radial_converge_green", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radial_converge_blue", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/defocus.json b/bgfx/effects/hlsl/defocus.json index aa46ca0822b..556b8aeffe7 100644 --- a/bgfx/effects/hlsl/defocus.json +++ b/bgfx/effects/hlsl/defocus.json @@ -24,8 +24,9 @@ "vertex": "chains/hlsl/vs_defocus", "fragment": "chains/hlsl/fs_defocus", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_defocus", "type": "vec4", "values": [ 0.5, 0.5, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_defocus", "type": "vec4", "values": [ 0.5, 0.5, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/distortion.json b/bgfx/effects/hlsl/distortion.json index 4fc6fbc3dd5..d4127fb8066 100644 --- a/bgfx/effects/hlsl/distortion.json +++ b/bgfx/effects/hlsl/distortion.json @@ -38,6 +38,7 @@ { "name": "u_round_corner", "type": "vec4", "values": [ 0.20, 0.0, 0.0, 0.0 ] }, { "name": "u_smooth_border", "type": "vec4", "values": [ 0.05, 0.0, 0.0, 0.0 ] }, { "name": "u_vignetting", "type": "vec4", "values": [ 0.20, 0.0, 0.0, 0.0 ] }, - { "name": "u_reflection", "type": "vec4", "values": [ 0.30, 0.0, 0.0, 0.0 ] } + { "name": "u_reflection", "type": "vec4", "values": [ 0.30, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/ntsc_decode.json b/bgfx/effects/hlsl/ntsc_decode.json index 039a94de4b5..8c363bb1dff 100644 --- a/bgfx/effects/hlsl/ntsc_decode.json +++ b/bgfx/effects/hlsl/ntsc_decode.json @@ -31,13 +31,14 @@ { "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_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 ] }, { "name": "u_i_freq_response", "type": "vec4", "values": [ 1.2, 0.0, 0.0, 0.0 ] }, { "name": "u_q_freq_response", "type": "vec4", "values": [ 0.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_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/ntsc_encode.json b/bgfx/effects/hlsl/ntsc_encode.json index 71ef588ceaa..140eb2fb150 100644 --- a/bgfx/effects/hlsl/ntsc_encode.json +++ b/bgfx/effects/hlsl/ntsc_encode.json @@ -26,13 +26,14 @@ "fragment": "chains/hlsl/fs_ntsc_encode", "uniforms": [ { "name": "s_tex", "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": [ 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_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 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/phosphor.json b/bgfx/effects/hlsl/phosphor.json index 7209c98891d..48a03c42081 100644 --- a/bgfx/effects/hlsl/phosphor.json +++ b/bgfx/effects/hlsl/phosphor.json @@ -25,9 +25,10 @@ "vertex": "chains/hlsl/vs_phosphor", "fragment": "chains/hlsl/fs_phosphor", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "s_prev", "type": "int", "values": [ 1.0 ] }, - { "name": "u_passthrough", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_phosphor", "type": "vec4", "values": [ 0.7, 0.7, 0.7, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_prev", "type": "int", "values": [ 1.0 ] }, + { "name": "u_passthrough", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_phosphor", "type": "vec4", "values": [ 0.7, 0.7, 0.7, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/post.json b/bgfx/effects/hlsl/post.json index 41fbd4b2f40..d6c25b4c84e 100644 --- a/bgfx/effects/hlsl/post.json +++ b/bgfx/effects/hlsl/post.json @@ -27,23 +27,24 @@ "uniforms": [ { "name": "s_tex", "type": "int", "values": [ 0.0 ] }, { "name": "s_shadow", "type": "int", "values": [ 1.0 ] }, - { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, - { "name": "u_target_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, - { "name": "u_target_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_humbar_hertz_rate", "type": "vec4", "values": [ 0.001, 0.0, 0.0, 0.0 ] }, - { "name": "u_humbar_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_shadow_tile_mode", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_shadow_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_shadow_count", "type": "vec4", "values": [ 12.0, 12.0, 0.0, 0.0 ] }, - { "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.25, 0.0, 0.0 ] }, - { "name": "u_shadow_uv_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_power", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 0.0 ] }, - { "name": "u_floor", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_chroma_mode", "type": "vec4", "values": [ 3.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_conversion_gain", "type": "vec4", "values": [ 0.299, 0.587, 0.114, 0.0 ] } + { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, + { "name": "u_target_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, + { "name": "u_target_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_humbar_hertz_rate", "type": "vec4", "values": [ 0.001, 0.0, 0.0, 0.0 ] }, + { "name": "u_humbar_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_shadow_tile_mode", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_shadow_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_shadow_count", "type": "vec4", "values": [ 12.0, 12.0, 0.0, 0.0 ] }, + { "name": "u_shadow_uv", "type": "vec4", "values": [ 0.25, 0.25, 0.0, 0.0 ] }, + { "name": "u_shadow_uv_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_power", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 0.0 ] }, + { "name": "u_floor", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_chroma_mode", "type": "vec4", "values": [ 3.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_conversion_gain", "type": "vec4", "values": [ 0.299, 0.587, 0.114, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/prescale.json b/bgfx/effects/hlsl/prescale.json index cbe684321cf..df0aec423e3 100644 --- a/bgfx/effects/hlsl/prescale.json +++ b/bgfx/effects/hlsl/prescale.json @@ -25,8 +25,9 @@ "vertex": "chains/hlsl/vs_prescale", "fragment": "chains/hlsl/fs_prescale", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_source_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hlsl/scanline.json b/bgfx/effects/hlsl/scanline.json index 07ff15546f3..60d21ad74a8 100644 --- a/bgfx/effects/hlsl/scanline.json +++ b/bgfx/effects/hlsl/scanline.json @@ -25,20 +25,21 @@ "fragment": "chains/hlsl/fs_scanline", "uniforms": [ { "name": "s_tex", "type": "int", "values": [ 0.0 ] }, - { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_swap_xy", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, { "name": "u_source_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, { "name": "u_target_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, { "name": "u_quad_dims", "type": "vec4", "values": [ 256.0, 256.0, 0.0, 0.0 ] }, - { "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_bright_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_bright_offset", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_jitter", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_height", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_scanline_variation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + { "name": "u_time", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_screen_scale", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_screen_offset", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_alpha", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_bright_scale", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_bright_offset", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_jitter", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_height", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_scanline_variation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_jitter_amount", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hqx/hq2x.json b/bgfx/effects/hqx/hq2x.json index 315603820ff..4938a4487a6 100644 --- a/bgfx/effects/hqx/hq2x.json +++ b/bgfx/effects/hqx/hq2x.json @@ -22,8 +22,9 @@ "vertex": "chains/hqx/vs_hq2x", "fragment": "chains/hqx/fs_hq2x", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "LUT", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "LUT", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hqx/hq3x.json b/bgfx/effects/hqx/hq3x.json index 5a578eb931f..fe282d61b53 100644 --- a/bgfx/effects/hqx/hq3x.json +++ b/bgfx/effects/hqx/hq3x.json @@ -22,8 +22,9 @@ "vertex": "chains/hqx/vs_hq3x", "fragment": "chains/hqx/fs_hq3x", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "LUT", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "LUT", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/hqx/hq4x.json b/bgfx/effects/hqx/hq4x.json index 6fe7803dc3f..2511cc46d36 100644 --- a/bgfx/effects/hqx/hq4x.json +++ b/bgfx/effects/hqx/hq4x.json @@ -22,8 +22,9 @@ "vertex": "chains/hqx/vs_hq4x", "fragment": "chains/hqx/fs_hq4x", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "LUT", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "LUT", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/lcd-grid/lcd-grid.json b/bgfx/effects/lcd-grid/lcd-grid.json index 5b465d5cf7b..b848cdca708 100644 --- a/bgfx/effects/lcd-grid/lcd-grid.json +++ b/bgfx/effects/lcd-grid/lcd-grid.json @@ -20,18 +20,19 @@ "vertex": "chains/lcd-grid/vs_lcd-grid", "fragment": "chains/lcd-grid/fs_lcd-grid", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_rsubpix", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_gsubpix", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_bsubpix", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] }, - { "name": "u_gain", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_blacklevel","type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_ambient", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_BGR", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_subpixsize","type": "vec4", "values": [ 0.5, 0.63, 0.0, 0.0 ] }, - { "name": "u_LCDgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, - { "name": "u_monitorgamma","type":"vec4","values": [ 2.2, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_quad_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_rsubpix", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_gsubpix", "type": "vec4", "values": [ 0.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_bsubpix", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 0.0 ] }, + { "name": "u_gain", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_blacklevel", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_ambient", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_BGR", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_subpixsize", "type": "vec4", "values": [ 0.5, 0.63, 0.0, 0.0 ] }, + { "name": "u_LCDgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_monitorgamma", "type": "vec4", "values": [ 2.2, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/lcd-grid/persistence.json b/bgfx/effects/lcd-grid/persistence.json index 1f4e57c7587..f9ab0d6ae87 100644 --- a/bgfx/effects/lcd-grid/persistence.json +++ b/bgfx/effects/lcd-grid/persistence.json @@ -20,8 +20,9 @@ "vertex": "chains/lcd-grid/vs_persistence", "fragment": "chains/lcd-grid/fs_persistence", "uniforms": [ - { "name": "s_screen", "type": "int", "values": [ 0 ] }, - { "name": "s_motionblur", "type": "int", "values": [ 1 ] }, - { "name": "u_persistence","type":"vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] } + { "name": "s_screen", "type": "int", "values": [ 0 ] }, + { "name": "s_motionblur", "type": "int", "values": [ 1 ] }, + { "name": "u_persistence", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/bcg_adjust.json b/bgfx/effects/misc/bcg_adjust.json index 35c9595e309..01a09559e0a 100644 --- a/bgfx/effects/misc/bcg_adjust.json +++ b/bgfx/effects/misc/bcg_adjust.json @@ -8,10 +8,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", "writeenable": false }, "cull": { "mode": "none" }, @@ -19,8 +19,9 @@ "vertex": "chains/misc/vs_blit", "fragment": "chains/misc/fs_blit_bcg", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/blit.json b/bgfx/effects/misc/blit.json index a5e5c544336..c8ef20a4a91 100644 --- a/bgfx/effects/misc/blit.json +++ b/bgfx/effects/misc/blit.json @@ -21,10 +21,10 @@ // defaults (dstColor, dstAlpha): "0" // // "zero", "one", "invsrccolor", "invdstcolor", "invsrcalpha", and "invdstalpha" are provided as aliases for "0", "1", "1-srccolor", "1-dstcolor", "1-srcalpha", and "1-dstalpha" - "srcColor": "srcalpha", - "dstColor": "1-srcalpha", - "srcAlpha": "srcalpha", - "dstAlpha": "1-srcalpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, // depth (required): The depth state for this effect. @@ -116,6 +116,7 @@ // "mat3": 9 floats // "mat4": 16 floats "values": [ 1.0 ] - } + }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/blit_palette16.json b/bgfx/effects/misc/blit_palette16.json index e0eb7f09140..39cd1d235a2 100644 --- a/bgfx/effects/misc/blit_palette16.json +++ b/bgfx/effects/misc/blit_palette16.json @@ -21,10 +21,10 @@ // defaults (dstColor, dstAlpha): "0" // // "zero", "one", "invsrccolor", "invdstcolor", "invsrcalpha", and "invdstalpha" are provided as aliases for "0", "1", "1-srccolor", "1-dstcolor", "1-srcalpha", and "1-dstalpha" - "srcColor": "srcalpha", - "dstColor": "1-srcalpha", - "srcAlpha": "srcalpha", - "dstAlpha": "1-srcalpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, // depth (required): The depth state for this effect. @@ -117,9 +117,10 @@ // "mat4": 16 floats "values": [ 1.0 ] }, - { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, { "name": "u_inv_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/deposterize-pass0.json b/bgfx/effects/misc/deposterize-pass0.json index c5e8efe9fc2..5c83a02f406 100644 --- a/bgfx/effects/misc/deposterize-pass0.json +++ b/bgfx/effects/misc/deposterize-pass0.json @@ -29,9 +29,10 @@ "vertex": "chains/misc/vs_deposterize-pass0", "fragment": "chains/misc/fs_deposterize-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "EQ_THRESH1", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, - { "name": "DIFF_THRESH1", "type": "vec4", "values": [ 0.06, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "EQ_THRESH1", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, + { "name": "DIFF_THRESH1", "type": "vec4", "values": [ 0.06, 0.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/deposterize-pass1.json b/bgfx/effects/misc/deposterize-pass1.json index 3b7be7e9e12..f3ab46309af 100644 --- a/bgfx/effects/misc/deposterize-pass1.json +++ b/bgfx/effects/misc/deposterize-pass1.json @@ -29,9 +29,10 @@ "vertex": "chains/misc/vs_deposterize-pass1", "fragment": "chains/misc/fs_deposterize-pass1", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "EQ_THRESH2", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, - { "name": "DIFF_THRESH2", "type": "vec4", "values": [ 0.06, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "EQ_THRESH2", "type": "vec4", "values": [ 0.01, 0.0, 0.0, 0.0 ] }, + { "name": "DIFF_THRESH2", "type": "vec4", "values": [ 0.06, 0.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/lut.json b/bgfx/effects/misc/lut.json index a1c3c0d0d22..306774e4754 100644 --- a/bgfx/effects/misc/lut.json +++ b/bgfx/effects/misc/lut.json @@ -19,9 +19,10 @@ "vertex": "chains/misc/vs_lut", "fragment": "chains/misc/fs_lut", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "s_3dlut", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_3dlut", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/saturation.json b/bgfx/effects/misc/saturation.json index bdd8fe1e6e2..1ad27c0f728 100644 --- a/bgfx/effects/misc/saturation.json +++ b/bgfx/effects/misc/saturation.json @@ -24,7 +24,8 @@ "vertex": "chains/misc/vs_saturation", "fragment": "chains/misc/fs_saturation", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/misc/texconv_argb32.json b/bgfx/effects/misc/texconv_argb32.json new file mode 100644 index 00000000000..771bd9de312 --- /dev/null +++ b/bgfx/effects/misc/texconv_argb32.json @@ -0,0 +1,27 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +//=============================================================== +// +// texconv_argb32.json: An basic texture-to-target copy. +// +//=============================================================== +{ + "blend": { + "equation": "add", + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" + }, + "depth": { "function": "always", "writeenable": false }, + "cull": { "mode": "none" }, + "write": { "rgb": true, "alpha": true }, + "vertex": "chains/misc/vs_resize_blit", + "fragment": "chains/misc/fs_blit", + "uniforms": [ + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_bounds0", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 1.0 ] } + ] +} diff --git a/bgfx/effects/misc/texconv_palette16.json b/bgfx/effects/misc/texconv_palette16.json index a9cee2d3f16..d2efb3adc4e 100644 --- a/bgfx/effects/misc/texconv_palette16.json +++ b/bgfx/effects/misc/texconv_palette16.json @@ -8,21 +8,23 @@ { "blend": { "equation": "add", - "srcColor": "srcalpha", - "dstColor": "1-srcalpha", - "srcAlpha": "srcalpha", - "dstAlpha": "1-srcalpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { "function": "always", "writeenable": false }, "cull": { "mode": "none" }, "write": { "rgb": true, "alpha": true }, - "vertex": "chains/misc/vs_blit", + "vertex": "chains/misc/vs_resize_blit", "fragment": "chains/misc/fs_blit_palette16", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, { "name": "u_inv_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_inv_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_bounds0", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 1.0 ] } ] } diff --git a/bgfx/effects/misc/texconv_rgb32.json b/bgfx/effects/misc/texconv_rgb32.json index 076175d7782..ffc5d3e809d 100644 --- a/bgfx/effects/misc/texconv_rgb32.json +++ b/bgfx/effects/misc/texconv_rgb32.json @@ -8,18 +8,20 @@ { "blend": { "equation": "add", - "srcColor": "srcalpha", - "dstColor": "1-srcalpha", - "srcAlpha": "srcalpha", - "dstAlpha": "1-srcalpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { "function": "always", "writeenable": false }, "cull": { "mode": "none" }, "write": { "rgb": true, "alpha": true }, - "vertex": "chains/misc/vs_blit", + "vertex": "chains/misc/vs_resize_blit", "fragment": "chains/misc/fs_blit_rgb32", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "s_pal", "type": "int", "values": [ 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "s_pal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_bounds0", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 1.0 ] } ] } diff --git a/bgfx/effects/misc/texconv_yuy16.json b/bgfx/effects/misc/texconv_yuy16.json index b46f996c9c2..cfa412bd2d6 100644 --- a/bgfx/effects/misc/texconv_yuy16.json +++ b/bgfx/effects/misc/texconv_yuy16.json @@ -9,19 +9,21 @@ { "blend": { "equation": "add", - "srcColor": "srcalpha", - "dstColor": "1-srcalpha", - "srcAlpha": "srcalpha", - "dstAlpha": "1-srcalpha" + "srcColor": "1", + "dstColor": "0", + "srcAlpha": "1", + "dstAlpha": "0" }, "depth": { "function": "always", "writeenable": false }, "cull": { "mode": "none" }, "write": { "rgb": true, "alpha": true }, - "vertex": "chains/misc/vs_blit", + "vertex": "chains/misc/vs_resize_blit", "fragment": "chains/misc/fs_blit_yuy16", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_inv_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_bounds0", "type": "vec4", "values": [ 0.0, 0.0, 1.0, 1.0 ] } ] } diff --git a/bgfx/effects/pillarbox_left_horizontal/gaussian.json b/bgfx/effects/pillarbox_left_horizontal/gaussian.json index b7c2a228c53..a5ac6ae3ad6 100644 --- a/bgfx/effects/pillarbox_left_horizontal/gaussian.json +++ b/bgfx/effects/pillarbox_left_horizontal/gaussian.json @@ -24,9 +24,10 @@ "vertex": "chains/pillarbox_left_horizontal/vs_gaussian", "fragment": "chains/pillarbox_left_horizontal/fs_gaussian", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_left_horizontal/offset_sat.json b/bgfx/effects/pillarbox_left_horizontal/offset_sat.json index 2244741f8cc..796a3ac8fda 100644 --- a/bgfx/effects/pillarbox_left_horizontal/offset_sat.json +++ b/bgfx/effects/pillarbox_left_horizontal/offset_sat.json @@ -28,7 +28,8 @@ "vertex": "chains/pillarbox_left_horizontal/vs_offset_sat", "fragment": "chains/pillarbox_left_horizontal/fs_offset_sat", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_left_vertical/gaussian.json b/bgfx/effects/pillarbox_left_vertical/gaussian.json index 497a8421e29..ddb6777bf67 100644 --- a/bgfx/effects/pillarbox_left_vertical/gaussian.json +++ b/bgfx/effects/pillarbox_left_vertical/gaussian.json @@ -24,9 +24,10 @@ "vertex": "chains/pillarbox_left_vertical/vs_gaussian", "fragment": "chains/pillarbox_left_vertical/fs_gaussian", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_left_vertical/offset_sat.json b/bgfx/effects/pillarbox_left_vertical/offset_sat.json index 19c6a141db7..bf2f3eae78c 100644 --- a/bgfx/effects/pillarbox_left_vertical/offset_sat.json +++ b/bgfx/effects/pillarbox_left_vertical/offset_sat.json @@ -28,7 +28,8 @@ "vertex": "chains/pillarbox_left_vertical/vs_offset_sat", "fragment": "chains/pillarbox_left_vertical/fs_offset_sat", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_right_horizontal/gaussian.json b/bgfx/effects/pillarbox_right_horizontal/gaussian.json index 855d79cbdb5..ba585fefd52 100644 --- a/bgfx/effects/pillarbox_right_horizontal/gaussian.json +++ b/bgfx/effects/pillarbox_right_horizontal/gaussian.json @@ -24,9 +24,10 @@ "vertex": "chains/pillarbox_right_horizontal/vs_gaussian", "fragment": "chains/pillarbox_right_horizontal/fs_gaussian", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_right_horizontal/offset_sat.json b/bgfx/effects/pillarbox_right_horizontal/offset_sat.json index 75165c63625..4636309212f 100644 --- a/bgfx/effects/pillarbox_right_horizontal/offset_sat.json +++ b/bgfx/effects/pillarbox_right_horizontal/offset_sat.json @@ -28,7 +28,8 @@ "vertex": "chains/pillarbox_right_horizontal/vs_offset_sat", "fragment": "chains/pillarbox_right_horizontal/fs_offset_sat", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_right_vertical/gaussian.json b/bgfx/effects/pillarbox_right_vertical/gaussian.json index a07622b34eb..61a04b86b70 100644 --- a/bgfx/effects/pillarbox_right_vertical/gaussian.json +++ b/bgfx/effects/pillarbox_right_vertical/gaussian.json @@ -24,9 +24,10 @@ "vertex": "chains/pillarbox_right_vertical/vs_gaussian", "fragment": "chains/pillarbox_right_vertical/fs_gaussian", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_dimension", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_radius", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/pillarbox_right_vertical/offset_sat.json b/bgfx/effects/pillarbox_right_vertical/offset_sat.json index 516c1b6be98..58707d34a34 100644 --- a/bgfx/effects/pillarbox_right_vertical/offset_sat.json +++ b/bgfx/effects/pillarbox_right_vertical/offset_sat.json @@ -28,7 +28,8 @@ "vertex": "chains/pillarbox_right_vertical/vs_offset_sat", "fragment": "chains/pillarbox_right_vertical/fs_offset_sat", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_saturation", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/screen_add.json b/bgfx/effects/screen_add.json index e1603f53507..8f99bda7188 100644 --- a/bgfx/effects/screen_add.json +++ b/bgfx/effects/screen_add.json @@ -26,7 +26,8 @@ "vertex": "vs_screen", "fragment": "fs_screen", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/screen_blend.json b/bgfx/effects/screen_blend.json index 0b2226d3396..64d64102b87 100644 --- a/bgfx/effects/screen_blend.json +++ b/bgfx/effects/screen_blend.json @@ -26,7 +26,8 @@ "vertex": "vs_screen", "fragment": "fs_screen", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/screen_multiply.json b/bgfx/effects/screen_multiply.json index 93bfb90c358..ba3192f550c 100644 --- a/bgfx/effects/screen_multiply.json +++ b/bgfx/effects/screen_multiply.json @@ -11,8 +11,8 @@ "blend": { "equation": "add", "srcColor": "dstcolor", - "dstColor": "0", - "srcAlpha": "dstalpha", + "dstColor": "1-srcalpha", + "srcAlpha": "1", "dstAlpha": "0" }, "depth": { @@ -26,7 +26,8 @@ "vertex": "vs_screen", "fragment": "fs_screen", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tint", "type": "vec4", "values": [ 1.0, 1.0, 1.0, 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/screen_opaque.json b/bgfx/effects/screen_opaque.json index 928ffdc5462..b94c06d39d9 100644 --- a/bgfx/effects/screen_opaque.json +++ b/bgfx/effects/screen_opaque.json @@ -8,13 +8,6 @@ // //============================================================ { - "blend": { - "equation": "add", - "srcColor": "1", - "dstColor": "0", - "srcAlpha": "1", - "dstAlpha": "0" - }, "depth": { "function": "always" }, @@ -26,6 +19,7 @@ "vertex": "vs_screen", "fragment": "fs_screen", "uniforms": [ - { "name": "s_tex", "type": "int", "values": [ 1.0 ] } + { "name": "s_tex", "type": "int", "values": [ 1.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/unfiltered/blit.json b/bgfx/effects/unfiltered/blit.json index 96760fff22c..1ad05a90bb1 100644 --- a/bgfx/effects/unfiltered/blit.json +++ b/bgfx/effects/unfiltered/blit.json @@ -116,6 +116,7 @@ // "mat3": 9 floats // "mat4": 16 floats "values": [ 1.0 ] - } + }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/warp/dilation-horizontal-fast.json b/bgfx/effects/warp/dilation-horizontal-fast.json index 6db07750ea5..63161dc51cd 100644 --- a/bgfx/effects/warp/dilation-horizontal-fast.json +++ b/bgfx/effects/warp/dilation-horizontal-fast.json @@ -48,7 +48,8 @@ "vertex": "chains/warp/vs_dilation-horizontal-fast", "fragment": "chains/warp/fs_dilation-horizontal-fast", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/custom-jinc2-sharper.json b/bgfx/effects/xbr/super-xbr/custom-jinc2-sharper.json index 124f750f5b8..d9c407a100e 100644 --- a/bgfx/effects/xbr/super-xbr/custom-jinc2-sharper.json +++ b/bgfx/effects/xbr/super-xbr/custom-jinc2-sharper.json @@ -32,7 +32,8 @@ { "name": "s_p", "type": "int", "values": [ 1.0 ] }, { "name": "JINC2_WINDOW_SINC", "type": "vec4", "values": [ 0.42, 0.0, 0.0, 0.0 ] }, { "name": "JINC2_SINC", "type": "vec4", "values": [ 0.92, 0.0, 0.0, 0.0 ] }, - { "name": "JINC2_AR_STRENGTH", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "JINC2_AR_STRENGTH", "type": "vec4", "values": [ 0.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass0.json b/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass0.json index 5985117f040..5fafed7db61 100644 --- a/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass0.json +++ b/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass0.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass1.json b/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass1.json index aa79d7c4bff..71a7cf79f0f 100644 --- a/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass1.json +++ b/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass1.json @@ -54,6 +54,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass2.json b/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass2.json index 971c566700a..14167a60182 100644 --- a/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass2.json +++ b/bgfx/effects/xbr/super-xbr/super-2xbr-3d-pass2.json @@ -54,6 +54,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass0.json b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass0.json index 7dc86e9bc72..3ed3e8f3271 100644 --- a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass0.json +++ b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass0.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass1.json b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass1.json index 5ddeecd317c..be3298b885f 100644 --- a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass1.json +++ b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass1.json @@ -54,6 +54,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass2.json b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass2.json index 366d1439deb..20150120e74 100644 --- a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass2.json +++ b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass2.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass3.json b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass3.json index 34b228a09b5..9a32be411c1 100644 --- a/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass3.json +++ b/bgfx/effects/xbr/super-xbr/super-4xbr-3d-pass3.json @@ -54,6 +54,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass0.json b/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass0.json index a19662e5d88..62a4f8b9f56 100644 --- a/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass0.json +++ b/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass0.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass1.json b/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass1.json index 4ee5ee1883e..4aac522e6a3 100644 --- a/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass1.json +++ b/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass1.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass2.json b/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass2.json index 66a6bfd119c..9fa30957734 100644 --- a/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass2.json +++ b/bgfx/effects/xbr/super-xbr/super-xbr-fast-pass2.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-xbr-pass0.json b/bgfx/effects/xbr/super-xbr/super-xbr-pass0.json index 4ac9b63240f..2d241982aa5 100644 --- a/bgfx/effects/xbr/super-xbr/super-xbr-pass0.json +++ b/bgfx/effects/xbr/super-xbr/super-xbr-pass0.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-xbr-pass1.json b/bgfx/effects/xbr/super-xbr/super-xbr-pass1.json index 8fca027bee5..f5f295d1971 100644 --- a/bgfx/effects/xbr/super-xbr/super-xbr-pass1.json +++ b/bgfx/effects/xbr/super-xbr/super-xbr-pass1.json @@ -54,6 +54,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/super-xbr/super-xbr-pass2.json b/bgfx/effects/xbr/super-xbr/super-xbr-pass2.json index 6b4be14029d..eaada276eed 100644 --- a/bgfx/effects/xbr/super-xbr/super-xbr-pass2.json +++ b/bgfx/effects/xbr/super-xbr/super-xbr-pass2.json @@ -53,6 +53,7 @@ { "name": "XBR_EDGE_STR", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_WEIGHT", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_ANTI_RINGING", "type": "vec4", "values": [ 1.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-sharp.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-sharp.json index 946fcc690b8..96d328a6c56 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-sharp.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-sharp.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2-gamma.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2-gamma.json index 2983832c94e..e3ba992ceae 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2-gamma.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2-gamma.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2.json index 8de360f9eb8..b71953038ee 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v2.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4-gamma.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4-gamma.json index 2baacce4369..64a94019247 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4-gamma.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4-gamma.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4.json index a04487306f0..f42fc494446 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4b.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4b.json index 31d86e690b8..f325524492c 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4b.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v4b.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v5-gamma.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v5-gamma.json index e4dac4b9782..a20b247d92b 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v5-gamma.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid-v5-gamma.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid.json b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid.json index 1f810bf23cb..2b16dbe230f 100644 --- a/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid.json +++ b/bgfx/effects/xbr/xbr-hybrid/2xbr-hybrid.json @@ -29,7 +29,8 @@ "vertex": "chains/xbr/xbr-hybrid/vs_2xbr-hybrid", "fragment": "chains/xbr/xbr-hybrid/fs_2xbr-hybrid", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv1-noblend.json b/bgfx/effects/xbr/xbr-lv1-noblend.json index 890e934e3b2..4ada03e4bc2 100644 --- a/bgfx/effects/xbr/xbr-lv1-noblend.json +++ b/bgfx/effects/xbr/xbr-lv1-noblend.json @@ -51,6 +51,7 @@ { "name": "decal", "type": "int", "values": [ 1.0 ] }, { "name": "XBR_Y_WEIGHT", "type": "vec4", "values": [ 48.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 15.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-3d.json b/bgfx/effects/xbr/xbr-lv2-3d.json index 2d3e28d0d5b..f1ec4256659 100644 --- a/bgfx/effects/xbr/xbr-lv2-3d.json +++ b/bgfx/effects/xbr/xbr-lv2-3d.json @@ -55,6 +55,7 @@ { "name": "XBR_LV1_COEFFICIENT", "type": "vec4", "values": [ 0.5, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_RES", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-fast.json b/bgfx/effects/xbr/xbr-lv2-fast.json index 1b1b4b593ad..6fcd1dcc975 100644 --- a/bgfx/effects/xbr/xbr-lv2-fast.json +++ b/bgfx/effects/xbr/xbr-lv2-fast.json @@ -53,6 +53,7 @@ { "name": "XBR_Y_WEIGHT", "type": "vec4", "values": [ 48.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 25.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-a-pass0.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-a-pass0.json index b2f4668b45f..0024671680e 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-a-pass0.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-a-pass0.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass0.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass0.json index f900518f72d..a0c163fc46b 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass0.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass0.json @@ -51,6 +51,7 @@ { "name": "decal", "type": "int", "values": [ 1.0 ] }, { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 4.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass1.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass1.json index 32fc96476d9..ff5ef543275 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass1.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-accuracy-pass1.json @@ -48,10 +48,11 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, - { "name": "XBR_SCALE", "type": "vec4", "values": [ 4.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, + { "name": "XBR_SCALE", "type": "vec4", "values": [ 4.0, 0.0, 0.0, 0.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-b-pass0.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-b-pass0.json index 7a6a60045e2..299d53a62e2 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-b-pass0.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-b-pass0.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-c-pass0.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-c-pass0.json index c9e93b92e07..1b06bf9e19c 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-c-pass0.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-c-pass0.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-d-pass0.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-d-pass0.json index 9979b3d11b6..993c6469e02 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-d-pass0.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-d-pass0.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-noblend-pass1.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-noblend-pass1.json index edf4ead94ed..4ff249ec181 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-noblend-pass1.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-noblend-pass1.json @@ -48,9 +48,10 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-pass1.json b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-pass1.json index 0b6938a4e77..bd5d94f7da1 100644 --- a/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-pass1.json +++ b/bgfx/effects/xbr/xbr-lv2-multipass/xbr-lv2-pass1.json @@ -48,10 +48,11 @@ "vertex": "chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1", "fragment": "chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_target_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_target_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2-noblend.json b/bgfx/effects/xbr/xbr-lv2-noblend.json index 8ea58baffe2..1a3a906309f 100644 --- a/bgfx/effects/xbr/xbr-lv2-noblend.json +++ b/bgfx/effects/xbr/xbr-lv2-noblend.json @@ -51,6 +51,7 @@ { "name": "decal", "type": "int", "values": [ 1.0 ] }, { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 0.6, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv2.json b/bgfx/effects/xbr/xbr-lv2.json index c974920b334..1cb0db3d8aa 100644 --- a/bgfx/effects/xbr/xbr-lv2.json +++ b/bgfx/effects/xbr/xbr-lv2.json @@ -53,6 +53,7 @@ { "name": "XBR_Y_WEIGHT", "type": "vec4", "values": [ 48.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 25.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass0.json b/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass0.json index ad9d884cc16..3cdcc58fd2a 100644 --- a/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass0.json +++ b/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass0.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0", "fragment": "chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass1.json b/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass1.json index a7bafa1205f..8184b6a84cc 100644 --- a/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass1.json +++ b/bgfx/effects/xbr/xbr-lv3-multipass/xbr-lv3-pass1.json @@ -48,10 +48,11 @@ "vertex": "chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1", "fragment": "chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_target_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_target_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv3-noblend.json b/bgfx/effects/xbr/xbr-lv3-noblend.json index 319a8db5a90..3ba6f6359e8 100644 --- a/bgfx/effects/xbr/xbr-lv3-noblend.json +++ b/bgfx/effects/xbr/xbr-lv3-noblend.json @@ -53,6 +53,7 @@ { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 10.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_EQ_THRESHOLD2", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-lv3.json b/bgfx/effects/xbr/xbr-lv3.json index 60498cba169..8a25ea0fbeb 100644 --- a/bgfx/effects/xbr/xbr-lv3.json +++ b/bgfx/effects/xbr/xbr-lv3.json @@ -57,6 +57,7 @@ { "name": "XBR_EQ_THRESHOLD", "type": "vec4", "values": [ 10.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_EQ_THRESHOLD2", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, { "name": "XBR_LV2_COEFFICIENT", "type": "vec4", "values": [ 2.0, 0.0, 0.0, 0.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass1.json b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass1.json index 20d2d41840d..746b53c44d9 100644 --- a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass1.json +++ b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass1.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1", "fragment": "chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass2.json b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass2.json index c57fb7ba331..bdaf8462948 100644 --- a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass2.json +++ b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass2.json @@ -48,7 +48,8 @@ "vertex": "chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2", "fragment": "chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size0", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass3.json b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass3.json index ba9b179d39a..da8b4716cb4 100644 --- a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass3.json +++ b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass3.json @@ -48,8 +48,9 @@ "vertex": "chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3", "fragment": "chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass4.json b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass4.json index 0547b5eef8b..675e02496e1 100644 --- a/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass4.json +++ b/bgfx/effects/xbr/xbr-mlv4-multipass/xbr-mlv4-pass4.json @@ -48,9 +48,10 @@ "vertex": "chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4", "fragment": "chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4", "uniforms": [ - { "name": "decal", "type": "int", "values": [ 1.0 ] }, - { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, - { "name": "u_target_size", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, - { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } + { "name": "decal", "type": "int", "values": [ 1.0 ] }, + { "name": "ORIG_texture", "type": "int", "values": [ 1.0 ] }, + { "name": "u_target_size", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_tex_size1", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] }, + { "name": "u_inv_view_dims", "type": "vec4", "values": [ 1.0, 1.0, 0.0, 0.0 ] } ] } diff --git a/bgfx/shaders/dx11/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/dx11/chains/crt-geom/fs_crt-geom.bin index 1e10cfa3910..a04f43c158f 100644 Binary files a/bgfx/shaders/dx11/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/dx11/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/dx11/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/dx11/chains/crt-geom/fs_gaussx.bin index 5f795218358..ba0632f44e3 100644 Binary files a/bgfx/shaders/dx11/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/dx11/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/dx11/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/dx11/chains/crt-geom/fs_gaussy.bin index 118e6f0f38d..8256d175e92 100644 Binary files a/bgfx/shaders/dx11/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/dx11/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/dx11/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/dx11/chains/crt-geom/fs_lowpass.bin index e91c1929938..00578e69472 100644 Binary files a/bgfx/shaders/dx11/chains/crt-geom/fs_lowpass.bin and b/bgfx/shaders/dx11/chains/crt-geom/fs_lowpass.bin differ diff --git a/bgfx/shaders/dx11/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/dx11/chains/crt-geom/fs_mipmap8.bin index 0864119c134..5014bb8fb4e 100644 Binary files a/bgfx/shaders/dx11/chains/crt-geom/fs_mipmap8.bin and b/bgfx/shaders/dx11/chains/crt-geom/fs_mipmap8.bin differ diff --git a/bgfx/shaders/dx11/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/dx11/chains/crt-geom/fs_phosphor_apply.bin index 13223fc1760..28f69506b4c 100644 Binary files a/bgfx/shaders/dx11/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/dx11/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin b/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin index f0afa387857..ebb0d800d78 100644 Binary files a/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin and b/bgfx/shaders/dx11/chains/hlsl/fs_scanline.bin differ diff --git a/bgfx/shaders/dx11/chains/misc/vs_resize_blit.bin b/bgfx/shaders/dx11/chains/misc/vs_resize_blit.bin new file mode 100644 index 00000000000..a2e8597f8a0 Binary files /dev/null and b/bgfx/shaders/dx11/chains/misc/vs_resize_blit.bin differ diff --git a/bgfx/shaders/dx9/chains/blurs/vs_smart-blur.bin b/bgfx/shaders/dx9/chains/blurs/vs_smart-blur.bin index 780d19ef057..d46c96d548c 100644 Binary files a/bgfx/shaders/dx9/chains/blurs/vs_smart-blur.bin and b/bgfx/shaders/dx9/chains/blurs/vs_smart-blur.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/dx9/chains/crt-geom/fs_crt-geom.bin index 1585db0801f..ba91955a7e2 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/dx9/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/dx9/chains/crt-geom/fs_gaussx.bin index b58b9e7ff43..b104317e368 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/dx9/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/dx9/chains/crt-geom/fs_gaussy.bin index e28567e6b60..cd491a41032 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/dx9/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/dx9/chains/crt-geom/fs_lowpass.bin index dac4b5405b2..30639e37083 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/fs_lowpass.bin and b/bgfx/shaders/dx9/chains/crt-geom/fs_lowpass.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/dx9/chains/crt-geom/fs_mipmap8.bin index 8f1ab318d1c..dbf10fccab9 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/fs_mipmap8.bin and b/bgfx/shaders/dx9/chains/crt-geom/fs_mipmap8.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/dx9/chains/crt-geom/fs_phosphor_apply.bin index 0f7e463da7e..184bbe70ea0 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/dx9/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_crt-geom.bin index 5b29c618573..14822336a8d 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_crt-geom.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_crt-geom.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_gaussx.bin index 6a8d78fc4f2..bfb81ff0df2 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_gaussx.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_gaussx.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_gaussy.bin index 182bd456635..5df864837eb 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_gaussy.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_gaussy.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_lowpass.bin index 380fdc6013d..825a970fc48 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_lowpass.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_lowpass.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_mipmap8.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_mipmap8.bin index af9290274ee..5250f665c68 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_mipmap8.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_mipmap8.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_apply.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_apply.bin index af9290274ee..5250f665c68 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_apply.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_apply.bin differ diff --git a/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_update.bin b/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_update.bin index af9290274ee..5250f665c68 100644 Binary files a/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_update.bin and b/bgfx/shaders/dx9/chains/crt-geom/vs_phosphor_update.bin differ diff --git a/bgfx/shaders/dx9/chains/crt/vs_crt-caligari.bin b/bgfx/shaders/dx9/chains/crt/vs_crt-caligari.bin index 43a2ae72515..771748125db 100644 Binary files a/bgfx/shaders/dx9/chains/crt/vs_crt-caligari.bin and b/bgfx/shaders/dx9/chains/crt/vs_crt-caligari.bin differ diff --git a/bgfx/shaders/dx9/chains/default/vs_blit.bin b/bgfx/shaders/dx9/chains/default/vs_blit.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/default/vs_blit.bin and b/bgfx/shaders/dx9/chains/default/vs_blit.bin differ diff --git a/bgfx/shaders/dx9/chains/eagle/vs_eagle.bin b/bgfx/shaders/dx9/chains/eagle/vs_eagle.bin index d9fff7cd56c..a41e65bb2f1 100644 Binary files a/bgfx/shaders/dx9/chains/eagle/vs_eagle.bin and b/bgfx/shaders/dx9/chains/eagle/vs_eagle.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin b/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin index ccc119eb73e..e9362d0a3f0 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin and b/bgfx/shaders/dx9/chains/hlsl/fs_scanline.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin b/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_chroma.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_color.bin b/bgfx/shaders/dx9/chains/hlsl/vs_color.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_color.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_color.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin index 5dc8dd1f3a3..1f4bd3ac1e4 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_deconverge.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin b/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_defocus.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin b/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_distortion.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_decode.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_ntsc_encode.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_phosphor.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_post.bin b/bgfx/shaders/dx9/chains/hlsl/vs_post.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_post.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_post.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin b/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_prescale.bin differ diff --git a/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin b/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin and b/bgfx/shaders/dx9/chains/hlsl/vs_scanline.bin differ diff --git a/bgfx/shaders/dx9/chains/hqx/vs_hq2x.bin b/bgfx/shaders/dx9/chains/hqx/vs_hq2x.bin index 780d19ef057..d46c96d548c 100644 Binary files a/bgfx/shaders/dx9/chains/hqx/vs_hq2x.bin and b/bgfx/shaders/dx9/chains/hqx/vs_hq2x.bin differ diff --git a/bgfx/shaders/dx9/chains/hqx/vs_hq3x.bin b/bgfx/shaders/dx9/chains/hqx/vs_hq3x.bin index 780d19ef057..d46c96d548c 100644 Binary files a/bgfx/shaders/dx9/chains/hqx/vs_hq3x.bin and b/bgfx/shaders/dx9/chains/hqx/vs_hq3x.bin differ diff --git a/bgfx/shaders/dx9/chains/hqx/vs_hq4x.bin b/bgfx/shaders/dx9/chains/hqx/vs_hq4x.bin index 780d19ef057..d46c96d548c 100644 Binary files a/bgfx/shaders/dx9/chains/hqx/vs_hq4x.bin and b/bgfx/shaders/dx9/chains/hqx/vs_hq4x.bin differ diff --git a/bgfx/shaders/dx9/chains/lcd-grid/vs_lcd-grid.bin b/bgfx/shaders/dx9/chains/lcd-grid/vs_lcd-grid.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/lcd-grid/vs_lcd-grid.bin and b/bgfx/shaders/dx9/chains/lcd-grid/vs_lcd-grid.bin differ diff --git a/bgfx/shaders/dx9/chains/lcd-grid/vs_persistence.bin b/bgfx/shaders/dx9/chains/lcd-grid/vs_persistence.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/lcd-grid/vs_persistence.bin and b/bgfx/shaders/dx9/chains/lcd-grid/vs_persistence.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_blit.bin b/bgfx/shaders/dx9/chains/misc/vs_blit.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_blit.bin and b/bgfx/shaders/dx9/chains/misc/vs_blit.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/dx9/chains/misc/vs_bob-and-ghost-deinterlace.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_bob-and-ghost-deinterlace.bin and b/bgfx/shaders/dx9/chains/misc/vs_bob-and-ghost-deinterlace.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass0.bin b/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass0.bin index 2f330106c3f..238ecd482e6 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass0.bin and b/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass1.bin b/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass1.bin index 60af0a98e73..d363289831a 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass1.bin and b/bgfx/shaders/dx9/chains/misc/vs_deposterize-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_lut.bin b/bgfx/shaders/dx9/chains/misc/vs_lut.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_lut.bin and b/bgfx/shaders/dx9/chains/misc/vs_lut.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_resize_blit.bin b/bgfx/shaders/dx9/chains/misc/vs_resize_blit.bin new file mode 100644 index 00000000000..03006933eac Binary files /dev/null and b/bgfx/shaders/dx9/chains/misc/vs_resize_blit.bin differ diff --git a/bgfx/shaders/dx9/chains/misc/vs_saturation.bin b/bgfx/shaders/dx9/chains/misc/vs_saturation.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/misc/vs_saturation.bin and b/bgfx/shaders/dx9/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_gaussian.bin b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_gaussian.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_gaussian.bin and b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_gaussian.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin index e3b5241acc6..abe6b3514e8 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin and b/bgfx/shaders/dx9/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_gaussian.bin b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_gaussian.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_gaussian.bin and b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_gaussian.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin index d9676ed3311..0754642bb2d 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin and b/bgfx/shaders/dx9/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_gaussian.bin b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_gaussian.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_gaussian.bin and b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_gaussian.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin index a051a6d376a..d9ce111d5c4 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin and b/bgfx/shaders/dx9/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_gaussian.bin b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_gaussian.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_gaussian.bin and b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_gaussian.bin differ diff --git a/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin index b4f3e7bcfd0..62fc9135626 100644 Binary files a/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin and b/bgfx/shaders/dx9/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/dx9/chains/unfiltered/vs_blit.bin b/bgfx/shaders/dx9/chains/unfiltered/vs_blit.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/unfiltered/vs_blit.bin and b/bgfx/shaders/dx9/chains/unfiltered/vs_blit.bin differ diff --git a/bgfx/shaders/dx9/chains/warp/vs_dilation-horizontal-fast.bin b/bgfx/shaders/dx9/chains/warp/vs_dilation-horizontal-fast.bin index 0e6844337b8..7be8faab20c 100644 Binary files a/bgfx/shaders/dx9/chains/warp/vs_dilation-horizontal-fast.bin and b/bgfx/shaders/dx9/chains/warp/vs_dilation-horizontal-fast.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin index a67d73b0dfa..1d461f0c026 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin index a67d73b0dfa..1d461f0c026 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin index a67d73b0dfa..1d461f0c026 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass0.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass0.bin index 30f63433650..009f6618e77 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass1.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass1.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass2.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass2.bin index a67d73b0dfa..1d461f0c026 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass2.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass3.bin b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass3.bin index a67d73b0dfa..1d461f0c026 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass3.bin and b/bgfx/shaders/dx9/chains/xbr/super-xbr/vs_super-xbr-pass3.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv1-noblend.bin index 33e357f842d..d1a689bc346 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv1-noblend.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv1-noblend.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin index 5e0648c188c..c9a4047e7c6 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-fast.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-fast.bin index 780d19ef057..d46c96d548c 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-fast.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-noblend.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-noblend.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-noblend.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3-noblend.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3-noblend.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3-noblend.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3.bin b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3.bin and b/bgfx/shaders/dx9/chains/xbr/vs_xbr-lv3.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin index 8aea6ea01f9..14a0feb5440 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin index 8aea6ea01f9..14a0feb5440 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin index 8aea6ea01f9..14a0feb5440 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin b/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin index 1676ea1abca..59e71fcee17 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin index 1cabd5f6cde..2939c936339 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin index 387f2fc6ec2..6a4b29d8582 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin index ee5666c8abe..18041141f82 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin differ diff --git a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin index ee5666c8abe..18041141f82 100644 Binary files a/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin and b/bgfx/shaders/dx9/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin differ diff --git a/bgfx/shaders/dx9/vs_gui.bin b/bgfx/shaders/dx9/vs_gui.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/vs_gui.bin and b/bgfx/shaders/dx9/vs_gui.bin differ diff --git a/bgfx/shaders/dx9/vs_screen.bin b/bgfx/shaders/dx9/vs_screen.bin index 44fedbcd87f..6d9a5d006b2 100644 Binary files a/bgfx/shaders/dx9/vs_screen.bin and b/bgfx/shaders/dx9/vs_screen.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom-deluxe.bin index 5c2140607f7..d9d15c110be 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom-deluxe.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom-deluxe.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom.bin index c7ff79043b5..7f4972aa957 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/essl/chains/crt-geom/fs_gaussx.bin index d65593f24ce..f860b6d7d91 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/essl/chains/crt-geom/fs_gaussy.bin index e0ad4c1f8d1..4047001d330 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/essl/chains/crt-geom/fs_lowpass.bin index fe6b98444b7..b76f1377566 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_lowpass.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_lowpass.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/essl/chains/crt-geom/fs_mipmap8.bin index 99a33cb2781..3400d3c10a7 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_mipmap8.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_mipmap8.bin differ diff --git a/bgfx/shaders/essl/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/essl/chains/crt-geom/fs_phosphor_apply.bin index 90252fafe60..31a606a78fa 100644 Binary files a/bgfx/shaders/essl/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/essl/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin b/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin index 7dc2ad1da82..2212e74858d 100644 Binary files a/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin and b/bgfx/shaders/essl/chains/hlsl/fs_scanline.bin differ diff --git a/bgfx/shaders/essl/chains/misc/vs_resize_blit.bin b/bgfx/shaders/essl/chains/misc/vs_resize_blit.bin new file mode 100644 index 00000000000..11b96a1ecab Binary files /dev/null and b/bgfx/shaders/essl/chains/misc/vs_resize_blit.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin index 4a8d4e1ec97..e910c2e4103 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom-deluxe.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin index bee9e6fddd9..8acfbd2fa86 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin index 360275169a1..e05cd0edda4 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin index dc708579ed8..0680565a702 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_lowpass.bin index b84a4651682..f61fc18c400 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_lowpass.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_lowpass.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin index 56761cd09fc..302ee4696bd 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_mipmap8.bin differ diff --git a/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin index ed591cdb74a..36f4e53db50 100644 Binary files a/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/glsl/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin b/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin index 25d42039661..5c118f422df 100644 Binary files a/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin and b/bgfx/shaders/glsl/chains/hlsl/fs_scanline.bin differ diff --git a/bgfx/shaders/glsl/chains/misc/vs_resize_blit.bin b/bgfx/shaders/glsl/chains/misc/vs_resize_blit.bin new file mode 100644 index 00000000000..2264dedad06 Binary files /dev/null and b/bgfx/shaders/glsl/chains/misc/vs_resize_blit.bin differ diff --git a/bgfx/shaders/metal/chains/blurs/vs_smart-blur.bin b/bgfx/shaders/metal/chains/blurs/vs_smart-blur.bin index 081cc6a4618..86b33b05bb4 100644 Binary files a/bgfx/shaders/metal/chains/blurs/vs_smart-blur.bin and b/bgfx/shaders/metal/chains/blurs/vs_smart-blur.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin index bf5015ba647..51ceac96266 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin index 8da81640e8a..d5f64af3b82 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin index 42ed26c98fb..bbed407f988 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin index 116f974c38f..c525c38c379 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin index 6051416b617..2eac3b48e76 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin index cc33a49c79f..319ee24f1e9 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin index d61f4a1d536..5e01b879485 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin index 384123124d8..2a43debc10f 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin and b/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/metal/chains/crt-geom/vs_gaussx.bin index 64c78091750..43076649d28 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/vs_gaussx.bin and b/bgfx/shaders/metal/chains/crt-geom/vs_gaussx.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/metal/chains/crt-geom/vs_gaussy.bin index 67c78694efb..3bcc44a1005 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/vs_gaussy.bin and b/bgfx/shaders/metal/chains/crt-geom/vs_gaussy.bin differ diff --git a/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin index 12f6d160d12..d9894d4dd79 100644 Binary files a/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin and b/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin differ diff --git a/bgfx/shaders/metal/chains/eagle/vs_eagle.bin b/bgfx/shaders/metal/chains/eagle/vs_eagle.bin index c9bc2774304..63eb9922ed6 100644 Binary files a/bgfx/shaders/metal/chains/eagle/vs_eagle.bin and b/bgfx/shaders/metal/chains/eagle/vs_eagle.bin differ diff --git a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin index 49f2a795d4f..870318aedef 100644 Binary files a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin and b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin differ diff --git a/bgfx/shaders/metal/chains/hqx/vs_hq2x.bin b/bgfx/shaders/metal/chains/hqx/vs_hq2x.bin index 4347fa482e0..9ebceaa0f42 100644 Binary files a/bgfx/shaders/metal/chains/hqx/vs_hq2x.bin and b/bgfx/shaders/metal/chains/hqx/vs_hq2x.bin differ diff --git a/bgfx/shaders/metal/chains/hqx/vs_hq3x.bin b/bgfx/shaders/metal/chains/hqx/vs_hq3x.bin index 4347fa482e0..9ebceaa0f42 100644 Binary files a/bgfx/shaders/metal/chains/hqx/vs_hq3x.bin and b/bgfx/shaders/metal/chains/hqx/vs_hq3x.bin differ diff --git a/bgfx/shaders/metal/chains/hqx/vs_hq4x.bin b/bgfx/shaders/metal/chains/hqx/vs_hq4x.bin index 4347fa482e0..9ebceaa0f42 100644 Binary files a/bgfx/shaders/metal/chains/hqx/vs_hq4x.bin and b/bgfx/shaders/metal/chains/hqx/vs_hq4x.bin differ diff --git a/bgfx/shaders/metal/chains/misc/vs_deposterize-pass0.bin b/bgfx/shaders/metal/chains/misc/vs_deposterize-pass0.bin index 9b5be751de6..212b9cc7bc4 100644 Binary files a/bgfx/shaders/metal/chains/misc/vs_deposterize-pass0.bin and b/bgfx/shaders/metal/chains/misc/vs_deposterize-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/misc/vs_deposterize-pass1.bin b/bgfx/shaders/metal/chains/misc/vs_deposterize-pass1.bin index 60b22be7cef..186b0046f4d 100644 Binary files a/bgfx/shaders/metal/chains/misc/vs_deposterize-pass1.bin and b/bgfx/shaders/metal/chains/misc/vs_deposterize-pass1.bin differ diff --git a/bgfx/shaders/metal/chains/misc/vs_resize_blit.bin b/bgfx/shaders/metal/chains/misc/vs_resize_blit.bin new file mode 100644 index 00000000000..a8250049a99 Binary files /dev/null and b/bgfx/shaders/metal/chains/misc/vs_resize_blit.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin index c648c0a3f22..be9408377bb 100644 Binary files a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin and b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin index c648c0a3f22..be9408377bb 100644 Binary files a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin and b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin index c648c0a3f22..be9408377bb 100644 Binary files a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin and b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass0.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass0.bin index d15cb4b3552..f27a0f14d6a 100644 Binary files a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass0.bin and b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass2.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass2.bin index c648c0a3f22..be9408377bb 100644 Binary files a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass2.bin and b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass2.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass3.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass3.bin index c648c0a3f22..be9408377bb 100644 Binary files a/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass3.bin and b/bgfx/shaders/metal/chains/xbr/super-xbr/vs_super-xbr-pass3.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin index 2b1a3ec0d82..565610e8da9 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin index 4ada44c964b..9d797cc3e2d 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-fast.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-fast.bin index 081cc6a4618..86b33b05bb4 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-fast.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-noblend.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-noblend.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-noblend.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv2.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3-noblend.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3-noblend.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3-noblend.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3.bin and b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv3.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin index ce2ae31904b..916f7b8ca09 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin and b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin index f600a3f74cb..19b377d8bc5 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin index f600a3f74cb..19b377d8bc5 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin index f600a3f74cb..19b377d8bc5 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin index 8c3124f12c5..a8ab0abeac0 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin and b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin index 3ef69d17bd3..bc0c8512550 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin and b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin index 25dab0a9d70..2592472dc3b 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin and b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin differ diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin index 9ebdf5141b3..52668f70798 100644 Binary files a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin and b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin differ diff --git a/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin b/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin index 2a9584f62dd..7238fd819ec 100644 Binary files a/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin and b/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin index d1294df79f9..d52174eeff3 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin index 712e3625792..b3aff9dc8f1 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin index e60e999d61e..5a91cf496c5 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin index ccb7b712ecc..c5d3e076f5d 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin index c8231a11e7d..fcfc5b0ee79 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin index 8ab4a6ae508..2cd1fde6aec 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin index ff0c2ec9cf8..9b08f757938 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin and b/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin index f0075fd0eee..24f865500bd 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin index 386197c82da..05e763ebf91 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin index 2fce758cf26..8e74e19daba 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin index 32e06663dd4..542bb67cf15 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin index 2ed1f77a862..3b47db73a64 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin index 2ed1f77a862..3b47db73a64 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin differ diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin index 2ed1f77a862..3b47db73a64 100644 Binary files a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin and b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin differ diff --git a/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin b/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin index bf12ac2d0c8..ab3465118e6 100644 Binary files a/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin and b/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin differ diff --git a/bgfx/shaders/spirv/chains/default/vs_blit.bin b/bgfx/shaders/spirv/chains/default/vs_blit.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/default/vs_blit.bin and b/bgfx/shaders/spirv/chains/default/vs_blit.bin differ diff --git a/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin b/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin index c18d0f948c6..9a32aa27658 100644 Binary files a/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin and b/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin b/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin index 2a4b0a345b9..00d4bb35a79 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin and b/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin b/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_color.bin b/bgfx/shaders/spirv/chains/hlsl/vs_color.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_color.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_color.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin index ed52ee7e605..4eb834bbe51 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin b/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin b/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_post.bin b/bgfx/shaders/spirv/chains/hlsl/vs_post.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_post.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_post.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin b/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin differ diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin b/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin and b/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin differ diff --git a/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin b/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin index 9387e8c197e..5d296c42188 100644 Binary files a/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin and b/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin differ diff --git a/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin b/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin index 9387e8c197e..5d296c42188 100644 Binary files a/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin and b/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin differ diff --git a/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin b/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin index 9387e8c197e..5d296c42188 100644 Binary files a/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin and b/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin differ diff --git a/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin b/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin and b/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin differ diff --git a/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin b/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin and b/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_blit.bin b/bgfx/shaders/spirv/chains/misc/vs_blit.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/misc/vs_blit.bin and b/bgfx/shaders/spirv/chains/misc/vs_blit.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin and b/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin index d8017922e51..0024dba789f 100644 Binary files a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin and b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin index 667da07e71e..b7818d6e2b3 100644 Binary files a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin and b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_lut.bin b/bgfx/shaders/spirv/chains/misc/vs_lut.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/misc/vs_lut.bin and b/bgfx/shaders/spirv/chains/misc/vs_lut.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_resize_blit.bin b/bgfx/shaders/spirv/chains/misc/vs_resize_blit.bin new file mode 100644 index 00000000000..4e55cef0200 Binary files /dev/null and b/bgfx/shaders/spirv/chains/misc/vs_resize_blit.bin differ diff --git a/bgfx/shaders/spirv/chains/misc/vs_saturation.bin b/bgfx/shaders/spirv/chains/misc/vs_saturation.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/misc/vs_saturation.bin and b/bgfx/shaders/spirv/chains/misc/vs_saturation.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin and b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin index 9810f826948..aa81a42a167 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin and b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin and b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin index a4a89bb041a..43fa0fd4eea 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin and b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin and b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin index 447093dde11..0ff1b5f29fb 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin and b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin and b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin differ diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin index d11ed4ca88e..25af7b0785d 100644 Binary files a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin and b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin differ diff --git a/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin b/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin and b/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin differ diff --git a/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin b/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin index 23b146622cb..469d10d9b4f 100644 Binary files a/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin and b/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin index 40761797c56..eefd37ce066 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin index 40761797c56..eefd37ce066 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin index 40761797c56..eefd37ce066 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin index f967fec69dc..2749ffbc6f7 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin index 40761797c56..eefd37ce066 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin index 40761797c56..eefd37ce066 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin and b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin index 6e75ff5493a..2a1ee3ea491 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin index 5ef41af60f4..56609308932 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin index 2a9584f62dd..7238fd819ec 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin and b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin index d3daa19310f..d527ee5e75a 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin index 4c3cc75e37d..b359a7275e4 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin index 4c3cc75e37d..b359a7275e4 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin index 4c3cc75e37d..b359a7275e4 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin index b880786f8a4..fe4f84b422c 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin index 14c40d9e628..d0fce814f7f 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin index 6ff1b372a0e..f4e4b2d27b9 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin index c347029fcf7..31497730af8 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin differ diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin index fad1c265ba9..c77d8f7efbe 100644 Binary files a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin and b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin differ diff --git a/bgfx/shaders/spirv/vs_gui.bin b/bgfx/shaders/spirv/vs_gui.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/vs_gui.bin and b/bgfx/shaders/spirv/vs_gui.bin differ diff --git a/bgfx/shaders/spirv/vs_screen.bin b/bgfx/shaders/spirv/vs_screen.bin index cb5fd46391f..89288358461 100644 Binary files a/bgfx/shaders/spirv/vs_screen.bin and b/bgfx/shaders/spirv/vs_screen.bin differ diff --git a/hlsl/bloom.fx b/hlsl/bloom.fx index 42c65e6a45b..330d441bb96 100644 --- a/hlsl/bloom.fx +++ b/hlsl/bloom.fx @@ -308,7 +308,7 @@ float3 GetNoiseFactor(float3 n, float random) float4 ps_main(PS_INPUT Input) : COLOR { - float3 texel = tex2D(DiffuseSampler, Input.TexCoord).rgb; + float4 texel = tex2D(DiffuseSampler, Input.TexCoord); float3 texelA = tex2D(BloomSamplerA, Input.BloomCoord.xy).rgb; float3 texelB = tex2D(BloomSamplerB, Input.BloomCoord.xy).rgb; @@ -346,7 +346,7 @@ float4 ps_main(PS_INPUT Input) : COLOR { float3 bloom = float3(0.0f, 0.0f, 0.0f); - texel *= Level0Weight; + texel.rgb *= Level0Weight; if (!VectorScreen) { @@ -381,7 +381,7 @@ float4 ps_main(PS_INPUT Input) : COLOR bloom *= BloomScale; - float3 bloomOverdrive = max(0.0f, texel + bloom - 1.0f) * BloomOverdrive; + float3 bloomOverdrive = max(0.0f, texel.rgb + bloom - 1.0f) * BloomOverdrive; bloom.r += bloomOverdrive.g * 0.5f; bloom.r += bloomOverdrive.b * 0.5f; @@ -393,20 +393,20 @@ float4 ps_main(PS_INPUT Input) : COLOR float2 NoiseCoord = Input.TexCoord; float3 NoiseFactor = GetNoiseFactor(bloom, random(NoiseCoord)); - blend = texel + bloom * NoiseFactor; + blend = texel.rgb + bloom * NoiseFactor; } // darken else { - texelA = min(texel, texelA); - texelB = min(texel, texelB); - texelC = min(texel, texelC); - texelD = min(texel, texelD); - texelE = min(texel, texelE); - texelF = min(texel, texelF); - texelG = min(texel, texelG); - texelH = min(texel, texelH); + texelA = min(texel.rgb, texelA); + texelB = min(texel.rgb, texelB); + texelC = min(texel.rgb, texelC); + texelD = min(texel.rgb, texelD); + texelE = min(texel.rgb, texelE); + texelF = min(texel.rgb, texelF); + texelG = min(texel.rgb, texelG); + texelH = min(texel.rgb, texelH); blend = texel * Level0Weight; blend = lerp(blend, texelA, Level1Weight * BloomScale); @@ -419,7 +419,7 @@ float4 ps_main(PS_INPUT Input) : COLOR blend = lerp(blend, texelH, Level8Weight * BloomScale); } - return float4(blend, 1.0f); + return float4(blend, texel.a); } //----------------------------------------------------------------------------- diff --git a/hlsl/color.fx b/hlsl/color.fx index 79f55260d4f..3c13fc8d400 100644 --- a/hlsl/color.fx +++ b/hlsl/color.fx @@ -52,6 +52,7 @@ struct PS_INPUT uniform float2 ScreenDims; uniform float2 SourceDims; +uniform float3 PrimTint = float3(1.0f, 1.0f, 1.0f); VS_OUTPUT vs_main(VS_INPUT Input) { @@ -67,6 +68,7 @@ VS_OUTPUT vs_main(VS_INPUT Input) Output.TexCoord += 0.5f / SourceDims; // half texel offset correction (DX9) Output.Color = Input.Color; + Output.Color.rgb *= PrimTint; return Output; } @@ -102,7 +104,7 @@ float4 ps_main(PS_INPUT Input) : COLOR float3 OutChroma = OutTexel - OutLuma; float3 Saturated = OutLuma + OutChroma * Saturation; - return float4(Saturated, BaseTexel.a); + return float4(Saturated * Input.Color.rgb, BaseTexel.a); } //----------------------------------------------------------------------------- diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx index f1cfa8fb686..1262426620e 100644 --- a/hlsl/deconverge.fx +++ b/hlsl/deconverge.fx @@ -108,11 +108,11 @@ VS_OUTPUT vs_main(VS_INPUT Input) float4 ps_main(PS_INPUT Input) : COLOR { - float r = tex2D(DiffuseSampler, float2(Input.TexCoordX.x, Input.TexCoordY.x)).r; - float g = tex2D(DiffuseSampler, float2(Input.TexCoordX.y, Input.TexCoordY.y)).g; - float b = tex2D(DiffuseSampler, float2(Input.TexCoordX.z, Input.TexCoordY.z)).b; + float2 ra = tex2D(DiffuseSampler, float2(Input.TexCoordX.x, Input.TexCoordY.x)).ra; + float2 ga = tex2D(DiffuseSampler, float2(Input.TexCoordX.y, Input.TexCoordY.y)).ga; + float2 ba = tex2D(DiffuseSampler, float2(Input.TexCoordX.z, Input.TexCoordY.z)).ba; - return float4(r, g, b, 1.0f); + return float4(ra.x, ga.x, ba.x, ra.y + ga.y + ba.y); } //----------------------------------------------------------------------------- diff --git a/hlsl/distortion.fx b/hlsl/distortion.fx index 3dd1dbd44b6..29835df368c 100644 --- a/hlsl/distortion.fx +++ b/hlsl/distortion.fx @@ -152,7 +152,7 @@ float GetSpotAddend(float2 coord, float amount) float2 spotOffset = float2(-0.25f, 0.25f); // normalized screen canvas ratio - float2 CanvasRatio = SwapXY + float2 CanvasRatio = SwapXY ? float2(1.0f, QuadDims.x / QuadDims.y) : float2(1.0f, QuadDims.y / QuadDims.x); @@ -284,13 +284,11 @@ float4 ps_main(PS_INPUT Input) : COLOR if (BaseCoord.x < 0.0f - TexelDims.x || BaseCoord.y < 0.0f - TexelDims.y || BaseCoord.x > 1.0f + TexelDims.x || BaseCoord.y > 1.0f + TexelDims.y) { - // we don't use the clip function, because we don't clear the render target before - return float4(0.0f, 0.0f, 0.0f, 1.0f); + discard; } // Color float4 BaseColor = tex2D(DiffuseSampler, BaseCoord); - BaseColor.a = 1.0f; // Vignetting Simulation float2 VignetteCoord = QuadCoord; @@ -332,4 +330,4 @@ technique DefaultTechnique VertexShader = compile vs_3_0 vs_main(); PixelShader = compile ps_3_0 ps_main(); } -} \ No newline at end of file +} diff --git a/hlsl/downsample.fx b/hlsl/downsample.fx index c069b0ad10e..866901cb4fe 100644 --- a/hlsl/downsample.fx +++ b/hlsl/downsample.fx @@ -91,14 +91,12 @@ VS_OUTPUT vs_main(VS_INPUT Input) float4 ps_main(PS_INPUT Input) : COLOR { - float3 texel0 = tex2D(DiffuseSampler, Input.TexCoord01.xy).rgb; - float3 texel1 = tex2D(DiffuseSampler, Input.TexCoord01.zw).rgb; - float3 texel2 = tex2D(DiffuseSampler, Input.TexCoord23.xy).rgb; - float3 texel3 = tex2D(DiffuseSampler, Input.TexCoord23.zw).rgb; + float4 texel0 = tex2D(DiffuseSampler, Input.TexCoord01.xy); + float4 texel1 = tex2D(DiffuseSampler, Input.TexCoord01.zw); + float4 texel2 = tex2D(DiffuseSampler, Input.TexCoord23.xy); + float4 texel3 = tex2D(DiffuseSampler, Input.TexCoord23.zw); - float3 outTexel = (texel0 + texel1 + texel2 + texel3) / 4.0; - - return float4(outTexel, 1.0f); + return (texel0 + texel1 + texel2 + texel3) * 0.25; } //----------------------------------------------------------------------------- diff --git a/hlsl/focus.fx b/hlsl/focus.fx index 6758d51fdc3..4d768890279 100644 --- a/hlsl/focus.fx +++ b/hlsl/focus.fx @@ -82,7 +82,7 @@ uniform float2 Defocus = float2(0.0f, 0.0f); // now this pass is applied only once with offsets of 0.25, 0.55, 1.0, 1.6 to achieve the same appearance as before till a maximum defocus of 2.0 static const float2 CoordOffset8[8] = { - // 0.075x² + 0.225x + 0.25 + // 0.075x� + 0.225x + 0.25 float2(-1.60f, 0.25f), float2(-1.00f, -0.55f), float2(-0.55f, 1.00f), @@ -100,16 +100,13 @@ float4 ps_main(PS_INPUT Input) : COLOR float2 DefocusTexelDims = Defocus * TexelDims; - float3 texel = tex2D(DiffuseSampler, Input.TexCoord).rgb; - float samples = 1.0f; - + float4 texel = tex2D(DiffuseSampler, Input.TexCoord); for (int i = 0; i < 8; i++) { - texel += tex2D(DiffuseSampler, Input.TexCoord + CoordOffset8[i] * DefocusTexelDims).rgb; - samples += 1.0f; + texel += tex2D(DiffuseSampler, Input.TexCoord + CoordOffset8[i] * DefocusTexelDims); } - return float4(texel / samples, 1.0f); + return texel / 9.0f; } //----------------------------------------------------------------------------- diff --git a/hlsl/post.fx b/hlsl/post.fx index ed9dfff9e30..c5d78b8a9b1 100644 --- a/hlsl/post.fx +++ b/hlsl/post.fx @@ -206,14 +206,12 @@ float4 ps_main(PS_INPUT Input) : COLOR // Color float4 BaseColor = tex2D(DiffuseSampler, BaseCoord); - BaseColor.a = 1.0; // clip border if (BaseCoord.x < 0.0 || BaseCoord.y < 0.0 || BaseCoord.x > 1.0 || BaseCoord.y > 1.0) { - // we don't use the clip function, because we don't clear the render target before - return float4(0.0, 0.0, 0.0, 1.0); + discard; } // Color Compression (may not affect bloom) diff --git a/hlsl/prescale.fx b/hlsl/prescale.fx index 3f52c20b464..1529fb08c5a 100644 --- a/hlsl/prescale.fx +++ b/hlsl/prescale.fx @@ -25,6 +25,17 @@ sampler DiffuseSampler = sampler_state AddressW = CLAMP; }; +sampler PointSampler = sampler_state +{ + Texture = ; + MipFilter = POINT; + MinFilter = POINT; + MagFilter = POINT; + AddressU = CLAMP; + AddressV = CLAMP; + AddressW = CLAMP; +}; + //----------------------------------------------------------------------------- // Vertex Definitions //----------------------------------------------------------------------------- @@ -93,6 +104,15 @@ float4 ps_main(PS_INPUT Input) : COLOR return tex2D(DiffuseSampler, TexCoord); } +//----------------------------------------------------------------------------- +// Pre-scale Pixel Shader (point sampling) +//----------------------------------------------------------------------------- + +float4 ps_point_main(PS_INPUT Input) : COLOR +{ + return tex2D(PointSampler, Input.TexCoord); +} + //----------------------------------------------------------------------------- // Pre-scale Technique //----------------------------------------------------------------------------- @@ -107,3 +127,14 @@ technique DefaultTechnique PixelShader = compile ps_3_0 ps_main(); } } + +technique PointTechnique +{ + pass Pass0 + { + Lighting = FALSE; + + VertexShader = compile vs_3_0 vs_main(); + PixelShader = compile ps_3_0 ps_point_main(); + } +} diff --git a/hlsl/primary.fx b/hlsl/primary.fx index 998a4b8716a..73dab1a7cbe 100644 --- a/hlsl/primary.fx +++ b/hlsl/primary.fx @@ -30,6 +30,17 @@ sampler DiffuseSampler = sampler_state AddressW = CLAMP; }; +sampler DiffuseWrapSampler = sampler_state +{ + Texture = ; + MipFilter = LINEAR; + MinFilter = LINEAR; + MagFilter = LINEAR; + AddressU = WRAP; + AddressV = WRAP; + AddressW = WRAP; +}; + sampler2D LutSampler = sampler_state { Texture = ; @@ -181,6 +192,16 @@ float4 ps_ui_main(PS_INPUT Input) : COLOR return BaseTexel; } +float4 ps_ui_wrap_main(PS_INPUT Input) : COLOR +{ + float4 BaseTexel = tex2D(DiffuseWrapSampler, Input.TexCoord); + BaseTexel *= Input.Color; + + if (UiLutEnable) + BaseTexel.rgb = apply_lut(BaseTexel.rgb); + return BaseTexel; +} + //----------------------------------------------------------------------------- // Primary Techniques //----------------------------------------------------------------------------- @@ -217,3 +238,14 @@ technique UiTechnique PixelShader = compile ps_2_0 ps_ui_main(); } } + +technique UiWrapTechnique +{ + pass Pass0 + { + Lighting = FALSE; + + VertexShader = compile vs_2_0 vs_ui_main(); + PixelShader = compile ps_2_0 ps_ui_wrap_main(); + } +} diff --git a/hlsl/scanline.fx b/hlsl/scanline.fx index 5dd4869fe1c..ec9eaa8d9b2 100644 --- a/hlsl/scanline.fx +++ b/hlsl/scanline.fx @@ -116,17 +116,14 @@ float2 GetAdjustedCoords(float2 coord) float4 ps_main(PS_INPUT Input) : COLOR { - float2 BaseCoord = GetAdjustedCoords(Input.TexCoord); - // Color - float4 BaseColor = tex2D(DiffuseSampler, BaseCoord); - BaseColor.a = 1.0f; + float4 BaseColor = tex2D(DiffuseSampler, Input.TexCoord); // clip border - if (BaseCoord.x < 0.0f || BaseCoord.y < 0.0f || - BaseCoord.x > 1.0f || BaseCoord.y > 1.0f) + if (Input.TexCoord.x < 0.0f || Input.TexCoord.y < 0.0f || + Input.TexCoord.x > 1.0f || Input.TexCoord.y > 1.0f) { - // we don't use the clip function, because we don't clear the render target before + // return black for the area outside the screen return float4(0.0f, 0.0f, 0.0f, 1.0f); } @@ -135,7 +132,7 @@ float4 ps_main(PS_INPUT Input) : COLOR float ColorBrightness = 0.299f * BaseColor.r + 0.587f * BaseColor.g + 0.114 * BaseColor.b; - float ScanlineCoord = BaseCoord.y; + float ScanlineCoord = Input.TexCoord.y; ScanlineCoord += SwapXY ? QuadDims.x <= SourceDims.x * 2.0f ? 0.5f / QuadDims.x // uncenter scanlines if the quad is less than twice the size of the source diff --git a/src/devices/machine/laserdsc.cpp b/src/devices/machine/laserdsc.cpp index 4184e3e7677..34964b27e3b 100644 --- a/src/devices/machine/laserdsc.cpp +++ b/src/devices/machine/laserdsc.cpp @@ -192,8 +192,10 @@ uint32_t laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bi screen.container().empty(); // add the video texture - if (m_videoenable) - screen.container().add_quad(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0xff,0xff,0xff), m_videotex, PRIMFLAG_BLENDMODE(BLENDMODE_NONE) | PRIMFLAG_SCREENTEX(1)); + rgb_t videocolor = 0xffffffff; // Fully visible, white + if (!m_videoenable) + videocolor = 0xff000000; // Blank the texture's RGB of the texture + screen.container().add_quad(0.0f, 0.0f, 1.0f, 1.0f, videocolor, m_videotex, PRIMFLAG_BLENDMODE(BLENDMODE_NONE) | PRIMFLAG_SCREENTEX(1)); // add the overlay if (m_overenable && overbitmap.valid()) diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 89281b11dd2..a02f39f841e 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -431,6 +431,7 @@ void render_texture::get_scaled(u32 dwidth, u32 dheight, render_texinfo &texinfo texinfo.base = m_bitmap->raw_pixptr(m_sbounds.top(), m_sbounds.left()); texinfo.rowpixels = m_bitmap->rowpixels(); texinfo.width = swidth; + texinfo.width_margin = m_sbounds.left(); texinfo.height = sheight; // palette will be set later texinfo.seqid = ++m_curseq; diff --git a/src/emu/render.h b/src/emu/render.h index 1229aef4869..2faa5f46394 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -157,6 +157,7 @@ struct render_texinfo void * base; // base of the data u32 rowpixels; // pixels per row u32 width; // width of the image + u32 width_margin; // left margin of the scaled bounds, if applicable u32 height; // height of the image u32 seqid; // sequence ID u64 unique_id; // unique identifier to pass to osd diff --git a/src/osd/modules/render/bgfx/blendreader.cpp b/src/osd/modules/render/bgfx/blendreader.cpp index 9e7ddb17ce3..53cd57a9f4a 100644 --- a/src/osd/modules/render/bgfx/blendreader.cpp +++ b/src/osd/modules/render/bgfx/blendreader.cpp @@ -44,8 +44,11 @@ uint64_t blend_reader::read_from_value(const Value& value) uint64_t equation = get_enum_from_value(value, "equation", BGFX_STATE_BLEND_EQUATION_ADD, EQUATION_NAMES, EQUATION_COUNT); uint64_t srccolor = get_enum_from_value(value, "srcColor", BGFX_STATE_BLEND_ONE, FUNCTION_NAMES, FUNCTION_COUNT); uint64_t dstcolor = get_enum_from_value(value, "dstColor", BGFX_STATE_BLEND_ZERO, FUNCTION_NAMES, FUNCTION_COUNT); - uint64_t srcalpha = get_enum_from_value(value, "srcAlpha", BGFX_STATE_BLEND_ONE, FUNCTION_NAMES, FUNCTION_COUNT); - uint64_t dstalpha = get_enum_from_value(value, "dstAlpha", BGFX_STATE_BLEND_ZERO, FUNCTION_NAMES, FUNCTION_COUNT); - - return BGFX_STATE_BLEND_EQUATION(equation) | BGFX_STATE_BLEND_FUNC_SEPARATE(srccolor, dstcolor, srcalpha, dstalpha); + if (value.HasMember("srcAlpha") && value.HasMember("dstAlpha")) + { + uint64_t srcalpha = get_enum_from_value(value, "srcAlpha", BGFX_STATE_BLEND_ONE, FUNCTION_NAMES, FUNCTION_COUNT); + uint64_t dstalpha = get_enum_from_value(value, "dstAlpha", BGFX_STATE_BLEND_ZERO, FUNCTION_NAMES, FUNCTION_COUNT); + return BGFX_STATE_BLEND_EQUATION(equation) | BGFX_STATE_BLEND_FUNC_SEPARATE(srccolor, dstcolor, srcalpha, dstalpha); + } + return BGFX_STATE_BLEND_EQUATION(equation) | BGFX_STATE_BLEND_FUNC(srccolor, dstcolor); } diff --git a/src/osd/modules/render/bgfx/chain.cpp b/src/osd/modules/render/bgfx/chain.cpp index b677569a67f..80c688d5014 100644 --- a/src/osd/modules/render/bgfx/chain.cpp +++ b/src/osd/modules/render/bgfx/chain.cpp @@ -78,7 +78,7 @@ void bgfx_chain::repopulate_targets() } } -void bgfx_chain::process(chain_manager::screen_prim &prim, int view, int screen, texture_manager& textures, osd_window& window, uint64_t blend) +void bgfx_chain::process(chain_manager::screen_prim &prim, int view, int screen, texture_manager& textures, osd_window& window) { screen_device_enumerator screen_iterator(window.machine().root_device()); screen_device* screen_device = screen_iterator.byindex(screen); @@ -108,11 +108,12 @@ void bgfx_chain::process(chain_manager::screen_prim &prim, int view, int screen, } int current_view = view; - for (bgfx_chain_entry* entry : m_entries) + for (size_t i = 0; i < m_entries.size(); i++) { - if (!entry->skip()) + if (!m_entries[i]->skip()) { - entry->submit(current_view, prim, textures, screen_count, screen_width, screen_height, screen_scale_x, screen_scale_y, screen_offset_x, screen_offset_y, rotation_type, swap_xy, blend, screen); + m_entries[i]->submit(current_view, prim, textures, screen_count, screen_width, screen_height, screen_scale_x, screen_scale_y, screen_offset_x, screen_offset_y, + rotation_type, swap_xy, screen); current_view++; } } @@ -145,7 +146,7 @@ uint32_t bgfx_chain::applicable_passes() return applicable_passes; } -void bgfx_chain::insert_effect(uint32_t index, bgfx_effect *effect, std::string name, std::string source, chain_manager &chains) +void bgfx_chain::insert_effect(uint32_t index, bgfx_effect *effect, const bool apply_tint, std::string name, std::string source, chain_manager &chains) { auto *clear = new clear_state(BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, 0, 1.0f, 0); std::vector suppressors; @@ -164,11 +165,15 @@ void bgfx_chain::insert_effect(uint32_t index, bgfx_effect *effect, std::string uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_tex_size1", bgfx::UniformType::Vec4), values, 4)); uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_inv_tex_size0", bgfx::UniformType::Vec4), values, 4)); uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_inv_tex_size1", bgfx::UniformType::Vec4), values, 4)); + uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_tex_bounds0", bgfx::UniformType::Vec4), values, 4)); + uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_tex_bounds1", bgfx::UniformType::Vec4), values, 4)); + uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_inv_tex_bounds0", bgfx::UniformType::Vec4), values, 4)); + uniforms.push_back(new bgfx_value_uniform(new bgfx_uniform("u_inv_tex_bounds1", bgfx::UniformType::Vec4), values, 4)); - m_entries.insert(m_entries.begin() + index, new bgfx_chain_entry(name, effect, clear, suppressors, inputs, uniforms, m_targets, "screen", false)); + m_entries.insert(m_entries.begin() + index, new bgfx_chain_entry(name, effect, clear, suppressors, inputs, uniforms, m_targets, "screen", apply_tint)); const uint32_t screen_width = chains.targets().width(TARGET_STYLE_GUEST, m_screen_index); const uint32_t screen_height = chains.targets().height(TARGET_STYLE_GUEST, m_screen_index); m_targets.destroy_target("screen", m_screen_index); - m_targets.create_target("screen", bgfx::TextureFormat::BGRA8, screen_width, screen_height, TARGET_STYLE_GUEST, true, false, 1, m_screen_index); + m_targets.create_target("screen", bgfx::TextureFormat::BGRA8, screen_width, screen_height, 1, 1, TARGET_STYLE_GUEST, true, false, 1, m_screen_index); } diff --git a/src/osd/modules/render/bgfx/chain.h b/src/osd/modules/render/bgfx/chain.h index b8f5d2db21d..2e86daaef81 100644 --- a/src/osd/modules/render/bgfx/chain.h +++ b/src/osd/modules/render/bgfx/chain.h @@ -30,7 +30,7 @@ public: bgfx_chain(std::string name, std::string author, bool transform, target_manager& targets, std::vector sliders, std::vector params, std::vector entries, std::vector target_list, uint32_t screen_index); ~bgfx_chain(); - void process(chain_manager::screen_prim &prim, int view, int screen, texture_manager& textures, osd_window &window, uint64_t blend = 0L); + void process(chain_manager::screen_prim &prim, int view, int screen, texture_manager& textures, osd_window &window); void repopulate_targets(); // Getters @@ -45,7 +45,7 @@ public: // Setters void set_has_converter(bool has_converter) { m_has_converter = has_converter; } void set_has_adjuster(bool has_adjuster) { m_has_adjuster = has_adjuster; } - void insert_effect(uint32_t index, bgfx_effect *effect, std::string name, std::string source, chain_manager &chains); + void insert_effect(uint32_t index, bgfx_effect *effect, const bool apply_tint, std::string name, std::string source, chain_manager &chains); private: std::string m_name; diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp index 45c0b805882..c3f3ee3a8e3 100644 --- a/src/osd/modules/render/bgfx/chainentry.cpp +++ b/src/osd/modules/render/bgfx/chainentry.cpp @@ -30,7 +30,8 @@ #include "render.h" -bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_state* clear, std::vector suppressors, std::vector inputs, std::vector uniforms, target_manager& targets, std::string output, bool apply_tint) +bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_state* clear, std::vector suppressors, std::vector inputs, + std::vector uniforms, target_manager& targets, std::string output, bool apply_tint) : m_name(name) , m_effect(effect) , m_clear(clear) @@ -55,12 +56,18 @@ bgfx_chain_entry::~bgfx_chain_entry() delete uniform; } m_uniforms.clear(); - delete m_clear; + if (m_clear) + { + delete m_clear; + } } -void bgfx_chain_entry::submit(int view, chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t screen_width, uint16_t screen_height, float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, uint32_t rotation_type, bool swap_xy, uint64_t blend, int32_t screen) +void bgfx_chain_entry::submit(int view, chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t screen_width, uint16_t screen_height, + float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, uint32_t rotation_type, bool swap_xy, int32_t screen) { - if (!setup_view(textures, view, screen_width, screen_height, screen)) + uint16_t view_width = screen_width; + uint16_t view_height = screen_height; + if (!setup_view(textures, view, screen_width, screen_height, screen, view_width, view_height)) { return; } @@ -73,18 +80,19 @@ void bgfx_chain_entry::submit(int view, chain_manager::screen_prim &prim, textur uint32_t tint = 0xffffffff; if (m_apply_tint) { - const auto a = (uint8_t)std::round(prim.m_prim->color.a * 255); - const auto r = (uint8_t)std::round(prim.m_prim->color.r * 255); - const auto g = (uint8_t)std::round(prim.m_prim->color.g * 255); - const auto b = (uint8_t)std::round(prim.m_prim->color.b * 255); + const uint8_t a = (uint8_t)std::round(prim.m_prim->color.a * 255); + const uint8_t r = (uint8_t)std::round(prim.m_prim->color.r * 255); + const uint8_t g = (uint8_t)std::round(prim.m_prim->color.g * 255); + const uint8_t b = (uint8_t)std::round(prim.m_prim->color.b * 255); tint = (a << 24) | (b << 16) | (g << 8) | r; } bgfx::TransientVertexBuffer buffer; - put_screen_buffer(prim.m_screen_width, prim.m_screen_height, tint, &buffer); + put_screen_buffer(view_width, view_height, tint, &buffer); bgfx::setVertexBuffer(0, &buffer); - setup_auto_uniforms(prim, textures, screen_count, screen_width, screen_height, screen_scale_x, screen_scale_y, screen_offset_x, screen_offset_y, rotation_type, swap_xy, screen); + setup_auto_uniforms(prim, textures, screen_count, view_width, view_height, screen_width, screen_height, screen_scale_x, screen_scale_y, screen_offset_x, screen_offset_y, + rotation_type, swap_xy, screen); for (bgfx_entry_uniform* uniform : m_uniforms) { @@ -94,7 +102,7 @@ void bgfx_chain_entry::submit(int view, chain_manager::screen_prim &prim, textur } } - m_effect->submit(view, blend); + m_effect->submit(view); if (m_targets.target(screen, m_output) != nullptr) { @@ -102,6 +110,43 @@ void bgfx_chain_entry::submit(int view, chain_manager::screen_prim &prim, textur } } +void bgfx_chain_entry::setup_auto_uniforms(chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t view_width, uint16_t view_height, + uint16_t screen_width, uint16_t screen_height, float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, + uint32_t rotation_type, bool swap_xy, int32_t screen) +{ + setup_viewsize_uniforms(view_width, view_height); + setup_screensize_uniforms(textures, screen_width, screen_height, screen); + setup_screenscale_uniforms(screen_scale_x, screen_scale_y); + setup_screenoffset_uniforms(screen_offset_x, screen_offset_y); + setup_screencount_uniforms(screen_count); + setup_sourcesize_uniform(prim); + setup_targetsize_uniform(screen); + setup_targetscale_uniform(screen); + setup_rotationtype_uniform(rotation_type); + setup_swapxy_uniform(swap_xy); + setup_quaddims_uniform(prim); + setup_screenindex_uniform(screen); +} + +void bgfx_chain_entry::setup_viewsize_uniforms(uint16_t view_width, uint16_t view_height) +{ + float width(view_width); + float height(view_height); + bgfx_uniform* view_dims = m_effect->uniform("u_view_dims"); + if (view_dims != nullptr) + { + float values[2] = { width, height }; + view_dims->set(values, sizeof(float) * 2); + } + + bgfx_uniform* inv_view_dims = m_effect->uniform("u_inv_view_dims"); + if (inv_view_dims != nullptr) + { + float values[2] = { -1.0f / width, 1.0f / height }; + inv_view_dims->set(values, sizeof(float) * 2); + } +} + void bgfx_chain_entry::setup_screensize_uniforms(texture_manager& textures, uint16_t screen_width, uint16_t screen_height, int32_t screen) { float width = screen_width; @@ -235,22 +280,8 @@ void bgfx_chain_entry::setup_screenindex_uniform(int32_t screen) const } } -void bgfx_chain_entry::setup_auto_uniforms(chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t screen_width, uint16_t screen_height, float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, uint32_t rotation_type, bool swap_xy, int32_t screen) -{ - setup_screensize_uniforms(textures, screen_width, screen_height, screen); - setup_screenscale_uniforms(screen_scale_x, screen_scale_y); - setup_screenoffset_uniforms(screen_offset_x, screen_offset_y); - setup_screencount_uniforms(screen_count); - setup_sourcesize_uniform(prim); - setup_targetsize_uniform(screen); - setup_targetscale_uniform(screen); - setup_rotationtype_uniform(rotation_type); - setup_swapxy_uniform(swap_xy); - setup_quaddims_uniform(prim); - setup_screenindex_uniform(screen); -} - -bool bgfx_chain_entry::setup_view(texture_manager &textures, int view, uint16_t screen_width, uint16_t screen_height, int32_t screen) const +bool bgfx_chain_entry::setup_view(texture_manager &textures, int view, uint16_t screen_width, uint16_t screen_height, int32_t screen, + uint16_t &out_view_width, uint16_t &out_view_height) const { bgfx::FrameBufferHandle handle = BGFX_INVALID_HANDLE; uint16_t width = screen_width; @@ -269,11 +300,13 @@ bool bgfx_chain_entry::setup_view(texture_manager &textures, int view, uint16_t bgfx::setViewFrameBuffer(view, handle); bgfx::setViewRect(view, 0, 0, width, height); + out_view_width = width; + out_view_height = height; const bgfx::Caps* caps = bgfx::getCaps(); std::string name = m_inputs[0]->texture() + std::to_string(screen); - const float right_ratio = (float)textures.provider(name)->width() / textures.provider(name)->rowpixels(); + const float right_ratio = float(textures.provider(name)->width()) / textures.provider(name)->rowpixels(); float projMat[16]; bx::mtxOrtho(projMat, 0.0f, right_ratio, 1.0f, 0.0f, 0.0f, 100.0f, 0.0f, caps->homogeneousDepth); @@ -307,14 +340,6 @@ void bgfx_chain_entry::put_screen_buffer(uint16_t screen_width, uint16_t screen_ v[0] = v[1] = 1; v[2] = v[3] = 0; } - else if (renderer_type == bgfx::RendererType::Direct3D9) - { - for (int i = 0; i < 4; i++) - { - u[i] += 0.5f / screen_width; - v[i] += 0.5f / screen_height; - } - } vertex[0].m_x = x[0]; vertex[0].m_y = y[0]; diff --git a/src/osd/modules/render/bgfx/chainentry.h b/src/osd/modules/render/bgfx/chainentry.h index 3fb1dd54ca6..a7504187879 100644 --- a/src/osd/modules/render/bgfx/chainentry.h +++ b/src/osd/modules/render/bgfx/chainentry.h @@ -34,10 +34,12 @@ class target_manager; class bgfx_chain_entry { public: - bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_state* clear, std::vector suppressors, std::vector inputs, std::vector uniforms, target_manager& targets, std::string output, bool apply_tint); + bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_state* clear, std::vector suppressors, std::vector inputs, + std::vector uniforms, target_manager& targets, std::string output, bool apply_tint); ~bgfx_chain_entry(); - void submit(int view, chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t screen_width, uint16_t screen_height, float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, uint32_t rotation_type, bool swap_xy, uint64_t blend, int32_t screen); + void submit(int view, chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t screen_width, uint16_t screen_height, + float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, uint32_t rotation_type, bool swap_xy, int32_t screen); // Getters std::string name() const { return m_name; } @@ -45,7 +47,10 @@ public: bool skip(); private: - void setup_auto_uniforms(chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t screen_width, uint16_t screen_height, float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, uint32_t rotation_type, bool swap_xy, int32_t screen); + void setup_auto_uniforms(chain_manager::screen_prim &prim, texture_manager& textures, uint16_t screen_count, uint16_t view_width, uint16_t view_height, + uint16_t screen_width, uint16_t screen_height, float screen_scale_x, float screen_scale_y, float screen_offset_x, float screen_offset_y, + uint32_t rotation_type, bool swap_xy, int32_t screen); + void setup_viewsize_uniforms(uint16_t view_width, uint16_t view_height); void setup_screensize_uniforms(texture_manager& textures, uint16_t screen_width, uint16_t screen_height, int32_t screen); void setup_screenscale_uniforms(float screen_scale_x, float screen_scale_y); void setup_screenoffset_uniforms(float screen_offset_x, float screen_offset_y); @@ -58,7 +63,8 @@ private: void setup_quaddims_uniform(chain_manager::screen_prim &prim) const; void setup_screenindex_uniform(int32_t screen) const; - bool setup_view(texture_manager& textures, int view, uint16_t screen_width, uint16_t screen_height, int32_t screen) const; + bool setup_view(texture_manager& textures, int view, uint16_t screen_width, uint16_t screen_height, int32_t screen, + uint16_t &out_view_width, uint16_t &out_view_height) const; void put_screen_buffer(uint16_t screen_width, uint16_t screen_height, uint32_t screen_tint, bgfx::TransientVertexBuffer* buffer) const; std::string m_name; diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp index b4279dc4ed9..6559c346f46 100644 --- a/src/osd/modules/render/bgfx/chainmanager.cpp +++ b/src/osd/modules/render/bgfx/chainmanager.cpp @@ -44,39 +44,58 @@ using namespace rapidjson; +int32_t chain_manager::s_old_chain_selections[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; +bool chain_manager::s_reinit_cookie = false; chain_manager::screen_prim::screen_prim(render_primitive *prim) { m_prim = prim; - m_screen_width = (uint16_t)floorf(prim->get_full_quad_width() + 0.5f); - m_screen_height = (uint16_t)floorf(prim->get_full_quad_height() + 0.5f); - m_quad_width = (uint16_t)floorf(prim->get_quad_width() + 0.5f); - m_quad_height = (uint16_t)floorf(prim->get_quad_height() + 0.5f); - m_tex_width = (float)prim->texture.width; - m_tex_height = (float)prim->texture.height; + m_screen_width = uint16_t(floorf(prim->get_full_quad_width() + 0.5f)); + m_screen_height = uint16_t(floorf(prim->get_full_quad_height() + 0.5f)); + m_quad_width = uint16_t(floorf(prim->get_quad_width() + 0.5f)); + m_quad_height = uint16_t(floorf(prim->get_quad_height() + 0.5f)); + m_tex_width = prim->texture.width; + m_tex_height = prim->texture.height; m_rowpixels = prim->texture.rowpixels; m_palette_length = prim->texture.palette_length; m_flags = prim->flags; } -chain_manager::chain_manager(running_machine& machine, osd_options& options, texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t window_index, slider_dirty_notifier& slider_notifier) +chain_manager::chain_manager(running_machine& machine, osd_options& options, texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t window_index, + slider_dirty_notifier& slider_notifier, uint16_t user_prescale, uint16_t max_prescale_size) : m_machine(machine) , m_options(options) , m_textures(textures) , m_targets(targets) , m_effects(effects) , m_window_index(window_index) + , m_user_prescale(user_prescale) + , m_max_prescale_size(max_prescale_size) , m_slider_notifier(slider_notifier) , m_screen_count(0) + , m_default_chain_index(-1) { m_converters.clear(); refresh_available_chains(); parse_chain_selections(options.bgfx_screen_chains()); init_texture_converters(); + + if (s_reinit_cookie) + { + for (uint32_t i = 0; i < std::size(s_old_chain_selections); i++) + { + set_current_chain(i, s_old_chain_selections[i]); + } + } } chain_manager::~chain_manager() { + for (uint32_t i = 0; i < std::size(s_old_chain_selections); i++) + { + s_old_chain_selections[i] = i < m_current_chain.size() ? m_current_chain[i] : -1; + } + s_reinit_cookie = true; destroy_chains(); } @@ -90,6 +109,20 @@ void chain_manager::init_texture_converters() m_adjuster = m_effects.get_or_load_effect(m_options, "misc/bcg_adjust"); } +void chain_manager::get_default_chain_info(std::string &out_chain_name, int32_t &out_chain_index) +{ + if (m_default_chain_index == -1) + { + out_chain_index = CHAIN_NONE; + out_chain_name = ""; + return; + } + + out_chain_index = m_default_chain_index; + out_chain_name = "default"; + return; +} + void chain_manager::refresh_available_chains() { m_available_chains.clear(); @@ -97,6 +130,16 @@ void chain_manager::refresh_available_chains() const std::string chains_path = util::string_format("%s" PATH_SEPARATOR "chains", m_options.bgfx_path()); find_available_chains(chains_path, ""); + if (m_default_chain_index == -1) + { + for (size_t i = 0; i < m_available_chains.size(); i++) + { + if (m_available_chains[i].m_name == "default") + { + m_default_chain_index = int32_t(i); + } + } + } destroy_unloaded_chains(); } @@ -115,8 +158,7 @@ void chain_manager::destroy_unloaded_chains() { delete m_screen_chains[i]; m_screen_chains[i] = nullptr; - m_chain_names[i] = ""; - m_current_chain[i] = CHAIN_NONE; + get_default_chain_info(m_chain_names[i], m_current_chain[i]); break; } } @@ -203,7 +245,7 @@ bgfx_chain* chain_manager::load_chain(std::string name, uint32_t screen_index) return nullptr; } - bgfx_chain* chain = chain_reader::read_from_value(document, name + ": ", *this, screen_index); + bgfx_chain* chain = chain_reader::read_from_value(document, name + ": ", *this, screen_index, m_user_prescale, m_max_prescale_size); if (chain == nullptr) { @@ -323,7 +365,7 @@ bgfx_chain* chain_manager::screen_chain(uint32_t screen) void chain_manager::process_screen_quad(uint32_t view, uint32_t screen, screen_prim &prim, osd_window& window) { - const bool any_targets_rebuilt = m_targets.update_target_sizes(screen, prim.m_tex_width, prim.m_tex_height, TARGET_STYLE_GUEST); + const bool any_targets_rebuilt = m_targets.update_target_sizes(screen, prim.m_tex_width, prim.m_tex_height, TARGET_STYLE_GUEST, m_user_prescale, m_max_prescale_size); if (any_targets_rebuilt) { for (bgfx_chain* chain : m_screen_chains) @@ -336,7 +378,7 @@ void chain_manager::process_screen_quad(uint32_t view, uint32_t screen, screen_p } bgfx_chain* chain = screen_chain(screen); - chain->process(prim, view, screen, m_textures, window, bgfx_util::get_blend_state(PRIMFLAG_GET_BLENDMODE(prim.m_flags))); + chain->process(prim, view, screen, m_textures, window); view += chain->applicable_passes(); } @@ -363,7 +405,7 @@ uint32_t chain_manager::count_screens(render_primitive* prim) if (screen_count > 0) { update_screen_count(screen_count); - m_targets.update_screen_count(screen_count); + m_targets.update_screen_count(screen_count, m_user_prescale, m_max_prescale_size); } if (screen_count < m_screen_prims.size()) @@ -385,8 +427,12 @@ void chain_manager::update_screen_count(uint32_t screen_count) while (m_screen_chains.size() < m_screen_count) { m_screen_chains.push_back(nullptr); - m_chain_names.push_back(""); - m_current_chain.push_back(CHAIN_NONE); + + int32_t chain_index = CHAIN_NONE; + std::string chain_name = ""; + get_default_chain_info(chain_name, chain_index); + m_chain_names.push_back(chain_name); + m_current_chain.push_back(chain_index); } // Ensure we have a screen chain selection slider per screen @@ -399,11 +445,20 @@ void chain_manager::update_screen_count(uint32_t screen_count) } } +void chain_manager::set_current_chain(uint32_t screen, int32_t chain_index) +{ + if (chain_index < m_available_chains.size() && screen < m_current_chain.size() && screen < m_chain_names.size()) + { + m_current_chain[screen] = chain_index; + m_chain_names[screen] = m_available_chains[chain_index].m_name; + } +} + int32_t chain_manager::slider_changed(int id, std::string *str, int32_t newval) { if (newval != SLIDER_NOCHANGE) { - m_current_chain[id] = newval; + set_current_chain(id, newval); std::vector> settings = slider_settings(); reload_chains(); @@ -485,24 +540,24 @@ uint32_t chain_manager::update_screen_textures(uint32_t view, render_primitive * int width_div_factor = 1; int width_mul_factor = 1; const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, prim.m_flags & PRIMFLAG_TEXFORMAT_MASK, - prim.m_rowpixels, tex_height, prim.m_prim->texture.palette, prim.m_prim->texture.base, pitch, width_div_factor, width_mul_factor); + prim.m_rowpixels, prim.m_prim->texture.width_margin, tex_height, prim.m_prim->texture.palette, prim.m_prim->texture.base, pitch, width_div_factor, width_mul_factor); if (texture == nullptr) { uint32_t flags = BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT; if (!PRIMFLAG_GET_TEXWRAP(prim.m_flags)) flags |= BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP; - bgfx_texture *texture = new bgfx_texture(full_name, dst_format, tex_width, tex_height, mem, flags, pitch, prim.m_rowpixels, width_div_factor, width_mul_factor); + bgfx_texture *texture = new bgfx_texture(full_name, dst_format, tex_width, prim.m_prim->texture.width_margin, tex_height, mem, flags, pitch, prim.m_rowpixels, width_div_factor, width_mul_factor); m_textures.add_provider(full_name, texture); if (prim.m_prim->texture.palette) { - uint16_t palette_width = (uint16_t)std::min(prim.m_palette_length, 256U); - uint16_t palette_height = (uint16_t)std::max((prim.m_palette_length + 255) / 256, 1U); + uint16_t palette_width = uint16_t(std::min(prim.m_palette_length, 256U)); + uint16_t palette_height = uint16_t(std::max((prim.m_palette_length + 255) / 256, 1U)); m_palette_temp.resize(palette_width * palette_height * 4); memcpy(&m_palette_temp[0], prim.m_prim->texture.palette, prim.m_palette_length * 4); const bgfx::Memory *palmem = bgfx::copy(&m_palette_temp[0], palette_width * palette_height * 4); - palette = new bgfx_texture(palette_name, bgfx::TextureFormat::BGRA8, palette_width, palette_height, palmem, BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT, palette_width * 4); + palette = new bgfx_texture(palette_name, bgfx::TextureFormat::BGRA8, palette_width, 0, palette_height, palmem, BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT, palette_width * 4); m_textures.add_provider(palette_name, palette); } @@ -523,12 +578,12 @@ uint32_t chain_manager::update_screen_textures(uint32_t view, render_primitive * } else { - texture->update(mem, pitch); + texture->update(mem, pitch, prim.m_prim->texture.width_margin); if (prim.m_prim->texture.palette) { - uint16_t palette_width = (uint16_t)std::min(prim.m_palette_length, 256U); - uint16_t palette_height = (uint16_t)std::max((prim.m_palette_length + 255) / 256, 1U); + uint16_t palette_width = uint16_t(std::min(prim.m_palette_length, 256U)); + uint16_t palette_height = uint16_t(std::max((prim.m_palette_length + 255) / 256, 1U)); const uint32_t palette_size = palette_width * palette_height * 4; m_palette_temp.resize(palette_size); memcpy(&m_palette_temp[0], prim.m_prim->texture.palette, prim.m_palette_length * 4); @@ -540,7 +595,7 @@ uint32_t chain_manager::update_screen_textures(uint32_t view, render_primitive * } else { - palette = new bgfx_texture(palette_name, bgfx::TextureFormat::BGRA8, palette_width, palette_height, palmem, BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT, palette_width * 4); + palette = new bgfx_texture(palette_name, bgfx::TextureFormat::BGRA8, palette_width, 0, palette_height, palmem, BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT, palette_width * 4); m_textures.add_provider(palette_name, palette); while (screen >= m_screen_palettes.size()) { @@ -551,15 +606,17 @@ uint32_t chain_manager::update_screen_textures(uint32_t view, render_primitive * } } + const bool has_tint = (prim.m_prim->color.a != 1.0f) || (prim.m_prim->color.r != 1.0f) || (prim.m_prim->color.g != 1.0f) || (prim.m_prim->color.b != 1.0f); bgfx_chain* chain = screen_chain(screen); if (chain && needs_adjust && !chain->has_adjuster()) { - chain->insert_effect(chain->has_converter() ? 1 : 0, m_adjuster, "XXadjust", needs_conversion ? "screen" : "source", *this); + const bool apply_tint = !needs_conversion && has_tint; + chain->insert_effect(chain->has_converter() ? 1 : 0, m_adjuster, apply_tint, "XXadjust", needs_conversion ? "screen" : "source", *this); chain->set_has_adjuster(true); } if (chain && needs_conversion && !chain->has_converter()) { - chain->insert_effect(0, m_converters[src_format], "XXconvert", "source", *this); + chain->insert_effect(0, m_converters[src_format], has_tint, "XXconvert", "source", *this); chain->set_has_converter(true); } } @@ -587,7 +644,7 @@ uint32_t chain_manager::process_screen_chains(uint32_t view, osd_window& window) std::swap(screen_width, screen_height); } - const bool any_targets_rebuilt = m_targets.update_target_sizes(screen_index, screen_width, screen_height, TARGET_STYLE_NATIVE); + const bool any_targets_rebuilt = m_targets.update_target_sizes(screen_index, screen_width, screen_height, TARGET_STYLE_NATIVE, m_user_prescale, m_max_prescale_size); if (any_targets_rebuilt) { for (bgfx_chain* chain : m_screen_chains) diff --git a/src/osd/modules/render/bgfx/chainmanager.h b/src/osd/modules/render/bgfx/chainmanager.h index 01e567653b8..e63fa9d6db5 100644 --- a/src/osd/modules/render/bgfx/chainmanager.h +++ b/src/osd/modules/render/bgfx/chainmanager.h @@ -63,14 +63,15 @@ public: uint16_t m_screen_height = 0; uint16_t m_quad_width = 0; uint16_t m_quad_height = 0; - float m_tex_width = 0.0F; - float m_tex_height = 0.0F; + float m_tex_width = 0.0f; + float m_tex_height = 0.0f; int m_rowpixels = 0; uint32_t m_palette_length = 0; uint32_t m_flags = 0; }; - chain_manager(running_machine& machine, osd_options& options, texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t window_index, slider_dirty_notifier& slider_notifier); + chain_manager(running_machine& machine, osd_options& options, texture_manager& textures, target_manager& targets, effect_manager& effects, uint32_t window_index, + slider_dirty_notifier& slider_notifier, uint16_t user_prescale, uint16_t max_prescale_size); ~chain_manager(); uint32_t update_screen_textures(uint32_t view, render_primitive *starting_prim, osd_window& window); @@ -104,6 +105,7 @@ private: void init_texture_converters(); + void get_default_chain_info(std::string &out_chain_name, int32_t &out_chain_index); void refresh_available_chains(); void destroy_unloaded_chains(); void find_available_chains(std::string root, std::string path); @@ -112,6 +114,7 @@ private: void update_screen_count(uint32_t screen_count); + void set_current_chain(uint32_t screen, int32_t chain_index); int32_t slider_changed(int id, std::string *str, int32_t newval); void create_selection_slider(uint32_t screen_index); bool needs_sliders(); @@ -125,8 +128,11 @@ private: target_manager& m_targets; effect_manager& m_effects; uint32_t m_window_index; + uint16_t m_user_prescale; + uint16_t m_max_prescale_size; slider_dirty_notifier& m_slider_notifier; uint32_t m_screen_count; + int32_t m_default_chain_index; std::vector m_available_chains; std::vector m_screen_chains; std::vector m_chain_names; @@ -140,6 +146,9 @@ private: std::vector m_screen_prims; std::vector m_palette_temp; + static int32_t s_old_chain_selections[16]; + static bool s_reinit_cookie; + static inline constexpr uint32_t CHAIN_NONE = 0; }; diff --git a/src/osd/modules/render/bgfx/chainreader.cpp b/src/osd/modules/render/bgfx/chainreader.cpp index 92e30df0b33..7d92c641695 100644 --- a/src/osd/modules/render/bgfx/chainreader.cpp +++ b/src/osd/modules/render/bgfx/chainreader.cpp @@ -22,7 +22,7 @@ #include "slider.h" #include "parameter.h" -bgfx_chain* chain_reader::read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index) +bgfx_chain* chain_reader::read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index, uint16_t user_prescale, uint16_t max_prescale_size) { if (!validate_parameters(value, prefix)) { @@ -96,7 +96,7 @@ bgfx_chain* chain_reader::read_from_value(const Value& value, std::string prefix // TODO: Move into its own reader for (uint32_t i = 0; i < target_array.Size(); i++) { - bgfx_target* target = target_reader::read_from_value(target_array[i], prefix + "targets[" + std::to_string(i) + "]: ", chains, screen_index); + bgfx_target* target = target_reader::read_from_value(target_array[i], prefix + "targets[" + std::to_string(i) + "]: ", chains, screen_index, user_prescale, max_prescale_size); if (target == nullptr) { return nullptr; diff --git a/src/osd/modules/render/bgfx/chainreader.h b/src/osd/modules/render/bgfx/chainreader.h index a2fa3ba28a5..6201409edfa 100644 --- a/src/osd/modules/render/bgfx/chainreader.h +++ b/src/osd/modules/render/bgfx/chainreader.h @@ -19,7 +19,7 @@ class chain_manager; class chain_reader : public state_reader { public: - static bgfx_chain* read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index); + static bgfx_chain* read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index, uint16_t user_prescale, uint16_t max_prescale_size); private: static bool validate_parameters(const Value& value, std::string prefix); diff --git a/src/osd/modules/render/bgfx/effect.cpp b/src/osd/modules/render/bgfx/effect.cpp index c5ea8555dce..a7f69e326f9 100644 --- a/src/osd/modules/render/bgfx/effect.cpp +++ b/src/osd/modules/render/bgfx/effect.cpp @@ -13,8 +13,9 @@ #include "modules/osdmodule.h" #include "osdcore.h" -bgfx_effect::bgfx_effect(uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx::ShaderHandle fragment_shader, std::vector uniforms) - : m_state(state) +bgfx_effect::bgfx_effect(std::string name, uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx::ShaderHandle fragment_shader, std::vector uniforms) + : m_name(name) + , m_state(state) { m_program_handle = bgfx::createProgram(vertex_shader, fragment_shader, false); @@ -47,7 +48,10 @@ void bgfx_effect::submit(int view, uint64_t blend) { (uniform_pair.second)->upload(); } - bgfx::setState(m_state | blend); + + const uint64_t final_state = (blend != ~0ULL) ? ((m_state & ~BGFX_STATE_BLEND_MASK) | blend) : m_state; + + bgfx::setState(final_state); bgfx::submit(view, m_program_handle); } diff --git a/src/osd/modules/render/bgfx/effect.h b/src/osd/modules/render/bgfx/effect.h index ca1be77c73d..6dd88b3585c 100644 --- a/src/osd/modules/render/bgfx/effect.h +++ b/src/osd/modules/render/bgfx/effect.h @@ -22,14 +22,15 @@ class bgfx_uniform; class bgfx_effect { public: - bgfx_effect(uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx::ShaderHandle fragment_shader, std::vector uniforms); + bgfx_effect(std::string name, uint64_t state, bgfx::ShaderHandle vertex_shader, bgfx::ShaderHandle fragment_shader, std::vector uniforms); ~bgfx_effect(); - void submit(int view, uint64_t blend = 0L); + void submit(int view, uint64_t blend = ~0ULL); bgfx_uniform *uniform(std::string name); bool is_valid() { return m_program_handle.idx != bgfx::kInvalidHandle; } private: + std::string m_name; uint64_t m_state; bgfx::ProgramHandle m_program_handle; std::map m_uniforms; diff --git a/src/osd/modules/render/bgfx/effectmanager.cpp b/src/osd/modules/render/bgfx/effectmanager.cpp index ba86e00adf0..1a29d743cfb 100644 --- a/src/osd/modules/render/bgfx/effectmanager.cpp +++ b/src/osd/modules/render/bgfx/effectmanager.cpp @@ -93,7 +93,7 @@ bgfx_effect* effect_manager::load_effect(osd_options &options, std::string name) return nullptr; } - bgfx_effect* effect = effect_reader::read_from_value(document, "Effect '" + name + "': ", options, m_shaders); + bgfx_effect* effect = effect_reader::read_from_value(name, document, "Effect '" + name + "': ", options, m_shaders); if (effect == nullptr) { diff --git a/src/osd/modules/render/bgfx/effectreader.cpp b/src/osd/modules/render/bgfx/effectreader.cpp index 36acee2f9ea..f65eb9f97ae 100644 --- a/src/osd/modules/render/bgfx/effectreader.cpp +++ b/src/osd/modules/render/bgfx/effectreader.cpp @@ -17,7 +17,7 @@ #include "uniformreader.h" #include "uniform.h" -bgfx_effect *effect_reader::read_from_value(const Value& value, std::string prefix, osd_options &options, shader_manager& shaders) +bgfx_effect *effect_reader::read_from_value(std::string name, const Value& value, std::string prefix, osd_options &options, shader_manager& shaders) { uint64_t flags = 0; std::string vertex_name; @@ -37,7 +37,7 @@ bgfx_effect *effect_reader::read_from_value(const Value& value, std::string pref return nullptr; } - bgfx_effect *effect = new bgfx_effect(flags, vertex_shader, fragment_shader, uniforms); + bgfx_effect *effect = new bgfx_effect(name, flags, vertex_shader, fragment_shader, uniforms); if (effect->is_valid()) { return effect; diff --git a/src/osd/modules/render/bgfx/effectreader.h b/src/osd/modules/render/bgfx/effectreader.h index 095f06a56ea..9ecffda51f3 100644 --- a/src/osd/modules/render/bgfx/effectreader.h +++ b/src/osd/modules/render/bgfx/effectreader.h @@ -26,7 +26,7 @@ class shader_manager; class effect_reader : public state_reader { public: - static bgfx_effect *read_from_value(const Value& value, std::string prefix, osd_options &options, shader_manager& shaders); + static bgfx_effect *read_from_value(std::string name, const Value& value, std::string prefix, osd_options &options, shader_manager& shaders); static bool validate_value(const Value& value, std::string prefix, osd_options &options); private: diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp index db12144e952..154252db04f 100644 --- a/src/osd/modules/render/bgfx/inputpair.cpp +++ b/src/osd/modules/render/bgfx/inputpair.cpp @@ -56,20 +56,31 @@ void bgfx_input_pair::bind(bgfx_effect *effect, const int32_t screen) const if (!provider) return; + float rowpixels(provider->rowpixels()); + float width_margin(provider->width_margin()); + float height(provider->height()); + bgfx_uniform *tex_size = effect->uniform("u_tex_size" + std::to_string(m_index)); if (tex_size && provider) { - float values[2] = { float(provider->rowpixels()), float(provider->height()) }; + float values[2] = { rowpixels, height }; tex_size->set(values, sizeof(float) * 2); } bgfx_uniform *inv_tex_size = effect->uniform("u_inv_tex_size" + std::to_string(m_index)); if (inv_tex_size && provider) { - float values[2] = { 1.0f / float(provider->rowpixels()), 1.0f / float(provider->height()) }; + float values[2] = { 1.0f / rowpixels, 1.0f / height }; inv_tex_size->set(values, sizeof(float) * 2); } + bgfx_uniform *tex_bounds = effect->uniform("u_tex_bounds" + std::to_string(m_index)); + if (tex_bounds && provider) + { + float values[4] = { width_margin / rowpixels, 0.0f, 1.0f + width_margin / rowpixels, 1.0f }; + tex_bounds->set(values, sizeof(float) * 4); + } + bgfx::setTexture(m_index, effect->uniform(m_sampler)->handle(), chains().textures().handle(name)); } diff --git a/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc b/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc index 1b967f894d4..40b0947da38 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/blurs/vs_smart-blur.sc @@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc index 72705bdcb83..5b8a633a642 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom-deluxe.sc @@ -28,9 +28,9 @@ uniform vec4 rasterbloom; uniform vec4 blurwidth; -vec3 texblur(vec2 c) +vec4 texblur(vec2 c) { - vec3 col = pow(texture2D(blur_texture,c).rgb, vec3_splat(CRTgamma.x)); + vec4 col = pow(texture2D(blur_texture,c), vec4(vec3_splat(CRTgamma.x),1.0)); // taper the blur texture outside its border with a gaussian float w = blurwidth.x / 320.0; c = min(c, vec2_splat(1.0)-c) * aspect.xy * vec2_splat(1.0/w); @@ -38,7 +38,7 @@ vec3 texblur(vec2 c) // approximation of erf gives smooth step // (convolution of gaussian with step) c = (step(0.0,c)-vec2_splat(0.5)) * sqrt(vec2_splat(1.0)-e2c) * (vec2_splat(1.0) + vec2_splat(0.1749)*e2c) + vec2_splat(0.5); - return col * vec3_splat( c.x * c.y ); + return col * vec4_splat( c.x * c.y ); } void main() @@ -125,16 +125,16 @@ void main() weights_prev=weights_prev+scanlineWeights(uv_ratio.y+1.0, col_prev)/3.0; weights_next=weights_next+scanlineWeights(uv_ratio.y-1.0, col_next)/3.0; #endif - vec3 mul_res = (col * weights + col_prev * weights_prev + col_next * weights_next).rgb; + vec4 mul_res = col * weights + col_prev * weights_prev + col_next * weights_next; // halation and corners - vec3 blur = texblur(xy0); + vec4 blur = texblur(xy0); // include factor of rbloom: // (probably imperceptible) brightness reduction when raster grows - mul_res = mix(mul_res, blur, halation.x) * vec3_splat(cval*rbloom); + mul_res = mix(mul_res, blur, halation.x) * vec4_splat(cval*rbloom); // Shadow mask - vec3 cout = apply_shadow_mask(v_texCoord.xy, mul_res); + vec3 cout = apply_shadow_mask(v_texCoord.xy, mul_res.rgb); // Convert the image gamma for display on our output device. cout = linear_to_output(cout); diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc index c096ebca7e0..9ff0da25057 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_crt-geom.sc @@ -90,13 +90,13 @@ void main() weights=weights+scanlineWeights(abs(uv_ratio.y), col)/3.0; weights2=weights2+scanlineWeights(abs(1.0-uv_ratio.y), col2)/3.0; #endif - vec3 mul_res = (col * weights + col2 * weights2).rgb * vec3_splat(cval); + vec4 mul_res = col * weights + col2 * weights2 * vec4_splat(cval); // Shadow mask - vec3 cout = apply_shadow_mask(v_texCoord.xy, mul_res); + vec3 cout = apply_shadow_mask(v_texCoord.xy, mul_res.rgb); // Convert the image gamma for display on our output device. cout = linear_to_output(cout); - gl_FragColor = vec4(cout,1.0); + gl_FragColor = vec4(cout,mul_res.a); } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc index 74faf15a740..6290ae330eb 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussx.sc @@ -6,33 +6,33 @@ uniform vec4 u_gamma; uniform vec4 u_tex_size0; SAMPLER2D(s_tex, 0); -#define TEX2D(v) pow(texture2D(s_tex, v).rgb, vec3_splat(u_gamma.x)) +#define TEX2D(v) pow(texture2D(s_tex, v), vec4(vec3_splat(u_gamma.x), 1.0)) void main() { - vec3 sum = vec3_splat(0.0); + vec4 sum = vec4_splat(0.0); float onex = 1.0/u_tex_size0.x; - sum += TEX2D(v_texCoord + vec2(-8.0 * onex, 0.0)) * vec3_splat(v_coeffs2.w); - sum += TEX2D(v_texCoord + vec2(-7.0 * onex, 0.0)) * vec3_splat(v_coeffs2.z); - sum += TEX2D(v_texCoord + vec2(-6.0 * onex, 0.0)) * vec3_splat(v_coeffs2.y); - sum += TEX2D(v_texCoord + vec2(-5.0 * onex, 0.0)) * vec3_splat(v_coeffs2.x); - sum += TEX2D(v_texCoord + vec2(-4.0 * onex, 0.0)) * vec3_splat(v_coeffs.w); - sum += TEX2D(v_texCoord + vec2(-3.0 * onex, 0.0)) * vec3_splat(v_coeffs.z); - sum += TEX2D(v_texCoord + vec2(-2.0 * onex, 0.0)) * vec3_splat(v_coeffs.y); - sum += TEX2D(v_texCoord + vec2(-1.0 * onex, 0.0)) * vec3_splat(v_coeffs.x); + sum += TEX2D(v_texCoord + vec2(-8.0 * onex, 0.0)) * vec4_splat(v_coeffs2.w); + sum += TEX2D(v_texCoord + vec2(-7.0 * onex, 0.0)) * vec4_splat(v_coeffs2.z); + sum += TEX2D(v_texCoord + vec2(-6.0 * onex, 0.0)) * vec4_splat(v_coeffs2.y); + sum += TEX2D(v_texCoord + vec2(-5.0 * onex, 0.0)) * vec4_splat(v_coeffs2.x); + sum += TEX2D(v_texCoord + vec2(-4.0 * onex, 0.0)) * vec4_splat(v_coeffs.w); + sum += TEX2D(v_texCoord + vec2(-3.0 * onex, 0.0)) * vec4_splat(v_coeffs.z); + sum += TEX2D(v_texCoord + vec2(-2.0 * onex, 0.0)) * vec4_splat(v_coeffs.y); + sum += TEX2D(v_texCoord + vec2(-1.0 * onex, 0.0)) * vec4_splat(v_coeffs.x); sum += TEX2D(v_texCoord); - sum += TEX2D(v_texCoord + vec2(+1.0 * onex, 0.0)) * vec3_splat(v_coeffs.x); - sum += TEX2D(v_texCoord + vec2(+2.0 * onex, 0.0)) * vec3_splat(v_coeffs.y); - sum += TEX2D(v_texCoord + vec2(+3.0 * onex, 0.0)) * vec3_splat(v_coeffs.z); - sum += TEX2D(v_texCoord + vec2(+4.0 * onex, 0.0)) * vec3_splat(v_coeffs.w); - sum += TEX2D(v_texCoord + vec2(+5.0 * onex, 0.0)) * vec3_splat(v_coeffs2.x); - sum += TEX2D(v_texCoord + vec2(+6.0 * onex, 0.0)) * vec3_splat(v_coeffs2.y); - sum += TEX2D(v_texCoord + vec2(+7.0 * onex, 0.0)) * vec3_splat(v_coeffs2.z); - sum += TEX2D(v_texCoord + vec2(+8.0 * onex, 0.0)) * vec3_splat(v_coeffs2.w); + sum += TEX2D(v_texCoord + vec2(+1.0 * onex, 0.0)) * vec4_splat(v_coeffs.x); + sum += TEX2D(v_texCoord + vec2(+2.0 * onex, 0.0)) * vec4_splat(v_coeffs.y); + sum += TEX2D(v_texCoord + vec2(+3.0 * onex, 0.0)) * vec4_splat(v_coeffs.z); + sum += TEX2D(v_texCoord + vec2(+4.0 * onex, 0.0)) * vec4_splat(v_coeffs.w); + sum += TEX2D(v_texCoord + vec2(+5.0 * onex, 0.0)) * vec4_splat(v_coeffs2.x); + sum += TEX2D(v_texCoord + vec2(+6.0 * onex, 0.0)) * vec4_splat(v_coeffs2.y); + sum += TEX2D(v_texCoord + vec2(+7.0 * onex, 0.0)) * vec4_splat(v_coeffs2.z); + sum += TEX2D(v_texCoord + vec2(+8.0 * onex, 0.0)) * vec4_splat(v_coeffs2.w); float norm = 1.0 / (1.0 + 2.0*(v_coeffs.x+v_coeffs.y+v_coeffs.z+v_coeffs.w +v_coeffs2.x+v_coeffs2.y+v_coeffs2.z+v_coeffs2.w)); - gl_FragColor = vec4( pow(sum*vec3_splat(norm), vec3_splat(1.0/u_gamma.x)), 1.0 ); + gl_FragColor = pow(sum*vec4_splat(norm), vec4(vec3_splat(1.0/u_gamma.x), 1.0)); } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc index c4fa73cdcce..9f4eace6cbe 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_gaussy.sc @@ -6,33 +6,33 @@ uniform vec4 u_gamma; uniform vec4 u_tex_size0; SAMPLER2D(s_tex, 0); -#define TEX2D(v) pow(texture2D(s_tex, v).rgb, vec3_splat(u_gamma.x)) +#define TEX2D(v) pow(texture2D(s_tex, v), vec4(vec3_splat(u_gamma.x), 1.0)) void main() { - vec3 sum = vec3_splat(0.0); + vec4 sum = vec4_splat(0.0); float oney = 1.0/u_tex_size0.y; - sum += TEX2D(v_texCoord + vec2(0.0, -8.0 * oney)) * vec3_splat(v_coeffs2.w); - sum += TEX2D(v_texCoord + vec2(0.0, -7.0 * oney)) * vec3_splat(v_coeffs2.z); - sum += TEX2D(v_texCoord + vec2(0.0, -6.0 * oney)) * vec3_splat(v_coeffs2.y); - sum += TEX2D(v_texCoord + vec2(0.0, -5.0 * oney)) * vec3_splat(v_coeffs2.x); - sum += TEX2D(v_texCoord + vec2(0.0, -4.0 * oney)) * vec3_splat(v_coeffs.w); - sum += TEX2D(v_texCoord + vec2(0.0, -3.0 * oney)) * vec3_splat(v_coeffs.z); - sum += TEX2D(v_texCoord + vec2(0.0, -2.0 * oney)) * vec3_splat(v_coeffs.y); - sum += TEX2D(v_texCoord + vec2(0.0, -1.0 * oney)) * vec3_splat(v_coeffs.x); + sum += TEX2D(v_texCoord + vec2(0.0, -8.0 * oney)) * vec4_splat(v_coeffs2.w); + sum += TEX2D(v_texCoord + vec2(0.0, -7.0 * oney)) * vec4_splat(v_coeffs2.z); + sum += TEX2D(v_texCoord + vec2(0.0, -6.0 * oney)) * vec4_splat(v_coeffs2.y); + sum += TEX2D(v_texCoord + vec2(0.0, -5.0 * oney)) * vec4_splat(v_coeffs2.x); + sum += TEX2D(v_texCoord + vec2(0.0, -4.0 * oney)) * vec4_splat(v_coeffs.w); + sum += TEX2D(v_texCoord + vec2(0.0, -3.0 * oney)) * vec4_splat(v_coeffs.z); + sum += TEX2D(v_texCoord + vec2(0.0, -2.0 * oney)) * vec4_splat(v_coeffs.y); + sum += TEX2D(v_texCoord + vec2(0.0, -1.0 * oney)) * vec4_splat(v_coeffs.x); sum += TEX2D(v_texCoord); - sum += TEX2D(v_texCoord + vec2(0.0, +1.0 * oney)) * vec3_splat(v_coeffs.x); - sum += TEX2D(v_texCoord + vec2(0.0, +2.0 * oney)) * vec3_splat(v_coeffs.y); - sum += TEX2D(v_texCoord + vec2(0.0, +3.0 * oney)) * vec3_splat(v_coeffs.z); - sum += TEX2D(v_texCoord + vec2(0.0, +4.0 * oney)) * vec3_splat(v_coeffs.w); - sum += TEX2D(v_texCoord + vec2(0.0, +5.0 * oney)) * vec3_splat(v_coeffs2.x); - sum += TEX2D(v_texCoord + vec2(0.0, +6.0 * oney)) * vec3_splat(v_coeffs2.y); - sum += TEX2D(v_texCoord + vec2(0.0, +7.0 * oney)) * vec3_splat(v_coeffs2.z); - sum += TEX2D(v_texCoord + vec2(0.0, +8.0 * oney)) * vec3_splat(v_coeffs2.w); + sum += TEX2D(v_texCoord + vec2(0.0, +1.0 * oney)) * vec4_splat(v_coeffs.x); + sum += TEX2D(v_texCoord + vec2(0.0, +2.0 * oney)) * vec4_splat(v_coeffs.y); + sum += TEX2D(v_texCoord + vec2(0.0, +3.0 * oney)) * vec4_splat(v_coeffs.z); + sum += TEX2D(v_texCoord + vec2(0.0, +4.0 * oney)) * vec4_splat(v_coeffs.w); + sum += TEX2D(v_texCoord + vec2(0.0, +5.0 * oney)) * vec4_splat(v_coeffs2.x); + sum += TEX2D(v_texCoord + vec2(0.0, +6.0 * oney)) * vec4_splat(v_coeffs2.y); + sum += TEX2D(v_texCoord + vec2(0.0, +7.0 * oney)) * vec4_splat(v_coeffs2.z); + sum += TEX2D(v_texCoord + vec2(0.0, +8.0 * oney)) * vec4_splat(v_coeffs2.w); float norm = 1.0 / (1.0 + 2.0*(v_coeffs.x+v_coeffs.y+v_coeffs.z+v_coeffs.w +v_coeffs2.x+v_coeffs2.y+v_coeffs2.z+v_coeffs2.w)); - gl_FragColor = vec4( pow(sum*vec3_splat(norm), vec3_splat(1.0/u_gamma.x)), 1.0 ); + gl_FragColor = pow(sum*vec4_splat(norm), vec4(vec3_splat(1.0/u_gamma.x), 1.0)); } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc index 2f48bbac321..37ab685957c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_lowpass.sc @@ -33,5 +33,5 @@ void main() sum +=sample_screen(v_texCoord+vec2(-7.0*onex,0.0))*vec3_splat(v_lpcoeffs2.w); sum +=sample_screen(v_texCoord+vec2( 7.0*onex,0.0))*vec3_splat(v_lpcoeffs2.w); - gl_FragColor = vec4( sum, 1.0 ); + gl_FragColor = vec4( sum, texture2D(s_screen, v_texCoord).a ); } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc index 0f86bdbc7ba..2e0f8038053 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_mipmap8.sc @@ -22,7 +22,7 @@ uniform vec4 u_smooth; const vec2 v05 = vec2(0.5,0.5); // pix has integer coordinates -> average four pixels using bilinear filtering -vec3 sample_screen(vec2 pix) +vec4 sample_screen(vec2 pix) { vec2 border = step(-0.5, u_tex_size0.xy - pix); float weight = border.x * border.y; @@ -34,12 +34,12 @@ vec3 sample_screen(vec2 pix) border = clamp(u_tex_size0.xy-x,0.0,1.0); weight *= border.x * border.y; - vec3 tex = texture2D(s_screen, x / u_tex_size0.xy).rgb; + vec4 tex = texture2D(s_screen, x / u_tex_size0.xy); - return tex * vec3_splat(weight); + return tex * vec4_splat(weight); } -vec3 sample_mipmap(vec2 pix, vec2 offset, vec2 size) +vec4 sample_mipmap(vec2 pix, vec2 offset, vec2 size) { vec2 border = step(-0.5, size - pix) * step(-0.5, pix); float weight = border.x * border.y; @@ -51,9 +51,9 @@ vec3 sample_mipmap(vec2 pix, vec2 offset, vec2 size) border = clamp(size-x,0.0,1.0); weight *= border.x * border.y; - vec3 tex = texture2D(s_mipmap, (x + offset) / u_tex_size0.xy).rgb; + vec4 tex = texture2D(s_mipmap, (x + offset) / u_tex_size0.xy); - return tex * vec3_splat(weight); + return tex * vec4_splat(weight); } void main() @@ -66,7 +66,7 @@ void main() // sample 4x4 grid // each sample uses bilinear filtering to average a 2x2 region // overall reduction by 8x8 - vec3 tex = ( sample_screen(x + vec2(-3.0,-3.0)) + vec4 tex = ( sample_screen(x + vec2(-3.0,-3.0)) + sample_screen(x + vec2(-3.0,-1.0)) + sample_screen(x + vec2(-3.0, 1.0)) + sample_screen(x + vec2(-3.0, 3.0)) @@ -113,7 +113,7 @@ void main() if (fc) x = vec2(4.0,4.0); - vec3 tex = ( sample_mipmap(x + vec2(-3.0,-3.0),offset0,newsize) + vec4 tex = ( sample_mipmap(x + vec2(-3.0,-3.0),offset0,newsize) + sample_mipmap(x + vec2(-3.0,-1.0),offset0,newsize) + sample_mipmap(x + vec2(-3.0, 1.0),offset0,newsize) + sample_mipmap(x + vec2(-3.0, 3.0),offset0,newsize) @@ -133,16 +133,16 @@ void main() if (fc) { // this sample yields average over the whole screen // apply a compensation for the zeros included in the 8^n average float f = fac*fac / (u_tex_size0.x * u_tex_size0.y); - vec3 col = tex * vec3_splat(f); + vec4 col = tex * vec4_splat(f); if (v_texCoord.y * u_tex_size1.y < ( offset0.y + u_tex_size1.y ) * 0.5) { - gl_FragColor = vec4(col,1.0); + gl_FragColor = col; } else { // we are near (1,1): in this region include the temporal filter vec4 old = texture2D(s_mipmap, v_texCoord.xy); - gl_FragColor = vec4(mix(col,old.rgb,u_smooth.x),1.0); + gl_FragColor = mix(col,old,u_smooth.x); } } else { - gl_FragColor = vec4(tex.rgb,1.0); + gl_FragColor = tex; } } } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc index c45fb8f883f..f7e116696cb 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/fs_phosphor_apply.sc @@ -28,15 +28,15 @@ void main() vec4 screen = texture2D(s_screen, v_texCoord); vec4 phosphor = texture2D(s_phosphor, v_texCoord); - vec3 cscrn = pow(screen.rgb, vec3_splat(u_gamma.x)); - vec3 cphos = pow(phosphor.rgb, vec3_splat(u_gamma.x)); + vec4 cscrn = pow(screen, vec4(vec3_splat(u_gamma.x), 1.0)); + vec4 cphos = pow(phosphor, vec4(vec3_splat(u_gamma.x), 1.0)); // encode the upper 2 bits of the time elapsed in the lower 2 bits of b float t = 255.0*phosphor.a + fract(phosphor.b*255.0/4.0)*1024.0; - cphos *= vec3_splat( u_phosphor_amplitude.x * decay(t) ); + cphos *= vec4_splat( u_phosphor_amplitude.x * decay(t) ); - vec3 col = pow(cscrn + cphos, vec3_splat(1.0/u_gamma.x)); + vec4 col = pow(cscrn + cphos, vec4(vec3_splat(1.0/u_gamma.x), 1.0)); - gl_FragColor = vec4(col, 1.0); + gl_FragColor = col; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc index cc3ed09aa14..03bcc7499f6 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_crt-geom.sc @@ -19,78 +19,82 @@ uniform vec4 R; uniform vec4 angle; uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; uniform vec4 u_rotation_type; #define FIX(c) max(abs(c), 1e-5) float intersect(vec2 xy , vec2 sinangle, vec2 cosangle) { - float A = dot(xy,xy)+d.x*d.x; - float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x); - float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y; - return (-B-sqrt(B*B-4.0*A*C))/(2.0*A); + float A = dot(xy,xy)+d.x*d.x; + float B = 2.0*(R.x*(dot(xy,sinangle)-d.x*cosangle.x*cosangle.y)-d.x*d.x); + float C = d.x*d.x + 2.0*R.x*d.x*cosangle.x*cosangle.y; + return (-B-sqrt(B*B-4.0*A*C))/(2.0*A); } vec2 bkwtrans(vec2 xy, vec2 sinangle, vec2 cosangle) { - float c = intersect(xy, sinangle, cosangle); - vec2 pt = vec2_splat(c)*xy; - pt -= vec2_splat(-R.x)*sinangle; - pt /= vec2_splat(R.x); - vec2 tang = sinangle/cosangle; - vec2 poc = pt/cosangle; - float A = dot(tang,tang)+1.0; - float B = -2.0*dot(poc,tang); - float C = dot(poc,poc)-1.0; - float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A); - vec2 uv = (pt-a*sinangle)/cosangle; - float r = FIX(R.x*acos(a)); - return uv*r/sin(r/R.x); + float c = intersect(xy, sinangle, cosangle); + vec2 pt = vec2_splat(c)*xy; + pt -= vec2_splat(-R.x)*sinangle; + pt /= vec2_splat(R.x); + vec2 tang = sinangle/cosangle; + vec2 poc = pt/cosangle; + float A = dot(tang,tang)+1.0; + float B = -2.0*dot(poc,tang); + float C = dot(poc,poc)-1.0; + float a = (-B+sqrt(B*B-4.0*A*C))/(2.0*A); + vec2 uv = (pt-a*sinangle)/cosangle; + float r = FIX(R.x*acos(a)); + return uv*r/sin(r/R.x); } vec2 fwtrans(vec2 uv, vec2 sinangle, vec2 cosangle) { - float r = FIX(sqrt(dot(uv,uv))); - uv *= sin(r/R.x)/r; - float x = 1.0-cos(r/R.x); - float D = d.x/R.x + x*cosangle.x*cosangle.y+dot(uv,sinangle); - return d.x*(uv*cosangle-x*sinangle)/D; + float r = FIX(sqrt(dot(uv,uv))); + uv *= sin(r/R.x)/r; + float x = 1.0-cos(r/R.x); + float D = d.x/R.x + x*cosangle.x*cosangle.y+dot(uv,sinangle); + return d.x*(uv*cosangle-x*sinangle)/D; } vec3 maxscale(vec2 sinangle, vec2 cosangle) { - vec2 c = bkwtrans(-R.x * sinangle / (1.0 + R.x/d.x*cosangle.x*cosangle.y), sinangle, cosangle); - vec2 a = vec2(0.5,0.5)*aspect.xy; - vec2 lo = vec2(fwtrans(vec2(-a.x,c.y), sinangle, cosangle).x, - fwtrans(vec2(c.x,-a.y), sinangle, cosangle).y)/aspect.xy; - vec2 hi = vec2(fwtrans(vec2(+a.x,c.y), sinangle, cosangle).x, - fwtrans(vec2(c.x,+a.y), sinangle, cosangle).y)/aspect.xy; - return vec3((hi+lo)*aspect.xy*0.5,max(hi.x-lo.x,hi.y-lo.y)); + vec2 c = bkwtrans(-R.x * sinangle / (1.0 + R.x/d.x*cosangle.x*cosangle.y), sinangle, cosangle); + vec2 a = vec2(0.5,0.5)*aspect.xy; + vec2 lo = vec2(fwtrans(vec2(-a.x,c.y), sinangle, cosangle).x, + fwtrans(vec2(c.x,-a.y), sinangle, cosangle).y)/aspect.xy; + vec2 hi = vec2(fwtrans(vec2(+a.x,c.y), sinangle, cosangle).x, + fwtrans(vec2(c.x,+a.y), sinangle, cosangle).y)/aspect.xy; + return vec3((hi+lo)*aspect.xy*0.5,max(hi.x-lo.x,hi.y-lo.y)); } void main() { - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; - // Precalculate a bunch of useful values we'll need in the fragment - // shader. - vec2 ang; - // if (u_rotation_type.x < 0.5) - // ang = vec2(0.0,angle.x); - // else if (u_rotation_type.x < 1.5) - // ang = vec2(angle.x,0.0); - // else if (u_rotation_type.x < 2.5) - // ang = vec2(0.0,-angle.x); - // else - // ang = vec2(-angle.x,0.0); - ang = angle.xy; - v_sinangle = sin(ang); - v_cosangle = cos(ang); - v_stretch = maxscale(v_sinangle, v_cosangle); + // Precalculate a bunch of useful values we'll need in the fragment + // shader. + vec2 ang; + // if (u_rotation_type.x < 0.5) + // ang = vec2(0.0,angle.x); + // else if (u_rotation_type.x < 1.5) + // ang = vec2(angle.x,0.0); + // else if (u_rotation_type.x < 2.5) + // ang = vec2(0.0,-angle.x); + // else + // ang = vec2(-angle.x,0.0); + ang = angle.xy; + v_sinangle = sin(ang); + v_cosangle = cos(ang); + v_stretch = maxscale(v_sinangle, v_cosangle); - // The size of one texel, in texture-coordinates. - v_one = 1.0 / u_tex_size0.xy; + // The size of one texel, in texture-coordinates. + v_one = 1.0 / u_tex_size0.xy; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc index e9969187c94..e6e41ff8578 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussx.sc @@ -4,16 +4,20 @@ $output v_texCoord, v_coeffs, v_coeffs2 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; uniform vec4 u_width; uniform vec4 u_aspect; void main() { - float wid = u_width.x*u_tex_size0.x/(320.*u_aspect.x); - v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid)); - v_coeffs2 = exp(vec4(25.,36.,49.,64.)*vec4_splat(-1.0/wid/wid)); + float wid = u_width.x*u_tex_size0.x/(320.*u_aspect.x); + v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid)); + v_coeffs2 = exp(vec4(25.,36.,49.,64.)*vec4_splat(-1.0/wid/wid)); - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc index 0b7ff9b411f..db01c6df634 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_gaussy.sc @@ -4,16 +4,20 @@ $output v_texCoord, v_coeffs, v_coeffs2 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; uniform vec4 u_width; uniform vec4 u_aspect; void main() { - float wid = u_width.x*u_tex_size0.y/(320.*u_aspect.y); - v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid)); - v_coeffs2 = exp(vec4(25.,36.,49.,64.)*vec4_splat(-1.0/wid/wid)); + float wid = u_width.x*u_tex_size0.y/(320.*u_aspect.y); + v_coeffs = exp(vec4(1.,4.,9.,16.)*vec4_splat(-1.0/wid/wid)); + v_coeffs2 = exp(vec4(25.,36.,49.,64.)*vec4_splat(-1.0/wid/wid)); - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc index 4d948a63a89..b9e92b4b4b4 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_lowpass.sc @@ -4,46 +4,50 @@ $output v_texCoord, v_lpcoeffs1, v_lpcoeffs2 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; uniform vec4 u_lowpass_cutoff; uniform vec4 u_lowpass_width; void main() { - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; - // interpret the cutoff and width as target resolutions in pixels per scanline - // include factor of 1/2 because max frequency at given resolution is Nyquist - float a = 0.5 * u_lowpass_cutoff.x / u_tex_size0.x; - float b = 0.5 * u_lowpass_width.x / u_tex_size0.x; - float w0 = (a-0.5*b); - float w1 = (a+0.5*b); + // interpret the cutoff and width as target resolutions in pixels per scanline + // include factor of 1/2 because max frequency at given resolution is Nyquist + float a = 0.5 * u_lowpass_cutoff.x / u_tex_size0.x; + float b = 0.5 * u_lowpass_width.x / u_tex_size0.x; + float w0 = (a-0.5*b); + float w1 = (a+0.5*b); - float two_pi = 6.283185307179586; - vec3 n1 = vec3(1.0,2.0,3.0); - vec4 n2 = vec4(4.0,5.0,6.0,7.0); + float two_pi = 6.283185307179586; + vec3 n1 = vec3(1.0,2.0,3.0); + vec4 n2 = vec4(4.0,5.0,6.0,7.0); - // target frequency response: - // 1 for w < w0 - // 0 for w > w1 - // linearly decreasing for w0 < w < w1 - // this will be approximated by including the lowest Fourier modes - if (w0 > 0.5) { // no filtering - v_lpcoeffs1 = vec4(1.0,0.0,0.0,0.0); - v_lpcoeffs2 = vec4_splat(0.0); - } else if (w1 > 0.5) { // don't reach zero - // here the target has a nonzero response at the Nyquist frequency - v_lpcoeffs1.x = w1 + w0 - (w1 - 0.5)*(w1 - 0.5)/(w1 - w0); - v_lpcoeffs1.yzw = 2.0 / ( two_pi*two_pi*(w1-w0)*n1*n1 ) * ( cos(two_pi*w0*n1) - cos(two_pi*0.5*n1) ); - v_lpcoeffs2 = 2.0 / ( two_pi*two_pi*(w1-w0)*n2*n2 ) * ( cos(two_pi*w0*n2) - cos(two_pi*0.5*n2) ); - } else if (w1 == w0) { // sharp cutoff - v_lpcoeffs1.x = 2.0 * w0; - v_lpcoeffs1.yzw = 2.0 / ( two_pi * n1 ) * sin(two_pi*w0*n1); - v_lpcoeffs2 = 2.0 / ( two_pi * n2 ) * sin(two_pi*w0*n2); - } else { - v_lpcoeffs1.x = w1 + w0; - v_lpcoeffs1.yzw = 2.0 / ( two_pi*two_pi*(w1-w0)*n1*n1 ) * ( cos(two_pi*w0*n1) - cos(two_pi*w1*n1) ); - v_lpcoeffs2 = 2.0 / ( two_pi*two_pi*(w1-w0)*n2*n2 ) * ( cos(two_pi*w0*n2) - cos(two_pi*w1*n2) ); - } + // target frequency response: + // 1 for w < w0 + // 0 for w > w1 + // linearly decreasing for w0 < w < w1 + // this will be approximated by including the lowest Fourier modes + if (w0 > 0.5) { // no filtering + v_lpcoeffs1 = vec4(1.0,0.0,0.0,0.0); + v_lpcoeffs2 = vec4_splat(0.0); + } else if (w1 > 0.5) { // don't reach zero + // here the target has a nonzero response at the Nyquist frequency + v_lpcoeffs1.x = w1 + w0 - (w1 - 0.5)*(w1 - 0.5)/(w1 - w0); + v_lpcoeffs1.yzw = 2.0 / ( two_pi*two_pi*(w1-w0)*n1*n1 ) * ( cos(two_pi*w0*n1) - cos(two_pi*0.5*n1) ); + v_lpcoeffs2 = 2.0 / ( two_pi*two_pi*(w1-w0)*n2*n2 ) * ( cos(two_pi*w0*n2) - cos(two_pi*0.5*n2) ); + } else if (w1 == w0) { // sharp cutoff + v_lpcoeffs1.x = 2.0 * w0; + v_lpcoeffs1.yzw = 2.0 / ( two_pi * n1 ) * sin(two_pi*w0*n1); + v_lpcoeffs2 = 2.0 / ( two_pi * n2 ) * sin(two_pi*w0*n2); + } else { + v_lpcoeffs1.x = w1 + w0; + v_lpcoeffs1.yzw = 2.0 / ( two_pi*two_pi*(w1-w0)*n1*n1 ) * ( cos(two_pi*w0*n1) - cos(two_pi*w1*n1) ); + v_lpcoeffs2 = 2.0 / ( two_pi*two_pi*(w1-w0)*n2*n2 ) * ( cos(two_pi*w0*n2) - cos(two_pi*w1*n2) ); + } } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc index bdd09148403..ba73cd682fa 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_mipmap8.sc @@ -3,9 +3,14 @@ $output v_texCoord #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc index bdd09148403..ba73cd682fa 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_apply.sc @@ -3,9 +3,14 @@ $output v_texCoord #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc index bdd09148403..ba73cd682fa 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt-geom/vs_phosphor_update.sc @@ -3,9 +3,14 @@ $output v_texCoord #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { - // Do the standard vertex processing. - gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); - v_texCoord = a_texcoord0; + // Do the standard vertex processing. + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + v_texCoord = a_texcoord0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc b/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc index 6dead210d9e..ce22c1e7200 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/crt/vs_crt-caligari.sc @@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_color0 // Autos uniform vec4 u_source_size; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; onex = vec2(1.0 / u_source_size.x, 0.0); diff --git a/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/default/vs_blit.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc b/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc index 1ab076dfa73..095d5d562e0 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/eagle/vs_eagle.sc @@ -14,10 +14,14 @@ $output v_color0, texCoord, t1, t2, t3, t4, t5, t6, t7, t8 // Autos uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_color0 = a_color0; vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc index 5942c75bab6..2126398062b 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/fs_scanline.sc @@ -37,34 +37,15 @@ SAMPLER2D(s_shadow, 1); // Scanline Pixel Shader //----------------------------------------------------------------------------- -vec2 GetAdjustedCoords(vec2 coord) -{ - // center coordinates - coord -= 0.5; - - // apply screen scale - coord *= u_screen_scale.xy; - - // un-center coordinates - coord += 0.5; - - // apply screen offset - coord += u_screen_offset.xy; - - return coord; -} - void main() { - vec2 BaseCoord = GetAdjustedCoords(v_texcoord0); - // Color - vec4 BaseColor = texture2D(s_tex, BaseCoord); + vec4 BaseColor = texture2D(s_tex, v_texcoord0); // Clamp - if (BaseCoord.x < 0.0 || BaseCoord.y < 0.0 || BaseCoord.x > 1.0 || BaseCoord.y > 1.0) + if (v_texcoord0.x < 0.0 || v_texcoord0.y < 0.0 || v_texcoord0.x > 1.0 || v_texcoord0.y > 1.0) { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); } else { @@ -76,7 +57,7 @@ void main() float ColorBrightness = 0.299 * BaseColor.r + 0.587 * BaseColor.g + 0.114 * BaseColor.b; - float ScanCoord = BaseCoord.y; + float ScanCoord = v_texcoord0.y; ScanCoord += u_swap_xy.x > 0.0 ? u_quad_dims.x <= u_source_dims.x * 2.0 ? 0.5 / u_quad_dims.x // uncenter scanlines if the quad is less than twice the size of the source diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_chroma.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_color.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc index b77d85d1ea8..55c2f0e2e34 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_deconverge.sc @@ -8,6 +8,7 @@ $output v_color0, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3 // Autos uniform vec4 u_source_size; +uniform vec4 u_inv_view_dims; // User-supplied uniform vec4 u_converge_red; @@ -20,6 +21,9 @@ uniform vec4 u_radial_converge_blue; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif vec2 half_value = vec2(0.5, 0.5); diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_defocus.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_distortion.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_decode.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_ntsc_encode.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_phosphor.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_post.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_prescale.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hlsl/vs_scanline.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc index dcff07b17f5..727f5763857 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq2x.sc @@ -8,10 +8,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0 // Autos uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_color0 = a_color0; vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc index dcff07b17f5..727f5763857 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq3x.sc @@ -8,10 +8,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0 // Autos uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_color0 = a_color0; vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc index dcff07b17f5..727f5763857 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/hqx/vs_hq4x.sc @@ -8,10 +8,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0 // Autos uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_color0 = a_color0; vec2 ps = vec2(1.0, 1.0) / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_lcd-grid.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/lcd-grid/vs_persistence.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_blit.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_bob-and-ghost-deinterlace.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc index f46bf23b063..1ed054f1b9a 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass0.sc @@ -14,10 +14,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif vec2 ps = vec2(1.0 / u_tex_size0.xy); float dx = ps.x; diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc index 486edf97c5c..69a23cb477c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_deposterize-pass1.sc @@ -14,10 +14,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif vec2 ps = vec2(1.0 / u_tex_size0.xy); float dx = ps.x; diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_lut.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc new file mode 100644 index 00000000000..0a9f2f178e1 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_resize_blit.sc @@ -0,0 +1,21 @@ +$input a_position, a_texcoord0, a_color0 +$output v_texcoord0, v_color0 + +// license:BSD-3-Clause +// copyright-holders:Dario Manesku + +#include "common.sh" + +uniform vec4 u_inv_view_dims; +uniform vec4 u_tex_bounds0; + +void main() +{ + gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif + + v_texcoord0 = a_texcoord0 * (u_tex_bounds0.zw - u_tex_bounds0.xy) + u_tex_bounds0.xy; + v_color0 = a_color0; +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/misc/vs_saturation.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_gaussian.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc index f071beaaa26..68ee1c25e92 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_horizontal/vs_offset_sat.sc @@ -9,9 +9,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0 * vec2(0.16666666 * 0.9, 1.0 * 0.8) + vec2(0.1, 0.1); v_color0 = a_color0; -} \ No newline at end of file +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_gaussian.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc index a9f6649c1e5..17853450538 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_left_vertical/vs_offset_sat.sc @@ -9,9 +9,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.1); v_color0 = a_color0; -} \ No newline at end of file +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_gaussian.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc index a473bc4123c..d7b2bbe0f8c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_horizontal/vs_offset_sat.sc @@ -9,9 +9,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0 * vec2(0.16666666 * 0.9, 1.0 * 0.8) + vec2(0.9 - 0.16666666 * 0.9, 0.1); v_color0 = a_color0; -} \ No newline at end of file +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_gaussian.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc index 8af6a293d8e..9e8aede6ea8 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/pillarbox_right_vertical/vs_offset_sat.sc @@ -9,9 +9,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0 * vec2(1.0 * 0.8, 0.685185 * 0.9) + vec2(0.1, 0.9 - 0.685185 * 0.9); v_color0 = a_color0; -} \ No newline at end of file +} diff --git a/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/unfiltered/vs_blit.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc index 9433c8359be..7e7200067b0 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/warp/vs_dilation-horizontal-fast.sc @@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_custom-jinc2-sharper.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc index 1c3ee6a8f23..335c9ef8b4c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc index c5bd41ee120..338cadbe4b7 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.sc @@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc index c5bd41ee120..338cadbe4b7 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.sc @@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc index 5827f1999b8..21e16b595e4 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.sc @@ -32,9 +32,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc index 60637684154..fc33723ec9d 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.sc @@ -32,9 +32,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc index 2cfe541e2b8..a8ec5539c0b 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.sc @@ -32,9 +32,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc index d10c9c24665..8352137204e 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass0.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc index 5827f1999b8..21e16b595e4 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass1.sc @@ -32,9 +32,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc index 9ae87c8a7ea..8f2d3277665 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass2.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc index 9ae87c8a7ea..8f2d3277665 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/super-xbr/vs_super-xbr-pass3.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_color #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc index 3e97446a880..de23993d020 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv1-noblend.sc @@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc index a3bb4330f45..7992b9eee51 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-3d.sc @@ -9,10 +9,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco uniform vec4 XBR_RES; uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = XBR_RES.xx / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc index 38e92865308..48e9664b766 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-fast.sc @@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc index cfc1a7cfc47..5bcf3e31f5a 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2-noblend.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc index ce6e411b75d..22e993426ed 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv2.sc @@ -7,10 +7,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc index 114f1669ad1..5957004443c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3-noblend.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc index 3d72da14478..a5ee8cee547 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/vs_xbr-lv3.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc index c09b7b66d1c..35cc742cff1 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc index 2be09e52908..3a9b0e56b1c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc index 2ec42c6585d..c08e3988e24 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc index f40310aa1b9..8c2b0aec4cd 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc index e363aba2eb4..d7328857ffd 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc index 8f9c58be4c1..48ebe4f0a54 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc index f40310aa1b9..8c2b0aec4cd 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc index c09b7b66d1c..35cc742cff1 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.sc @@ -43,10 +43,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; vec2 ps = 1.0 / u_tex_size0.xy; diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc index 59ffb0a026a..15490257390 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.sc @@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc index 5c20062823a..f63eb7b2391 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc index fbb10ec9ea5..db8c513319b 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0 #include "common.sh" uniform vec4 u_tex_size1; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc index afdcf872331..0c317f16cc7 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.sc @@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc index ba0da15a70d..fbcf72fd706 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.sc @@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc index bfd5e4a6414..e75cc78ac8c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.sc @@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc index b85cca1828d..56cebbd6540 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.sc @@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0 #include "common.sh" uniform vec4 u_tex_size1; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc index 11042eab09a..c35e62e81ac 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.sc @@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0 #include "common.sh" uniform vec4 u_tex_size1; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc index 80dd11d7ad9..8ae8f8df41c 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.sc @@ -34,10 +34,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc index 7932ba25f15..439005d2941 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.sc @@ -32,10 +32,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_color0 uniform vec4 u_tex_size1; uniform vec4 u_target_dims; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A3 B3 C3 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc index 1edfd8632ad..24f3b396cc2 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A3 B3 C3 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc index 92cf6b60b87..1d67bb87ebe 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4, v_texco #include "common.sh" uniform vec4 u_tex_size0; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A1 B1 C1 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc index a6926a41f8b..2c85859340b 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size1; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A3 B3 C3 diff --git a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc index 29fec2f1759..5e62a75a12e 100644 --- a/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc +++ b/src/osd/modules/render/bgfx/shaders/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.sc @@ -33,10 +33,14 @@ $output v_texcoord0, v_texcoord1, v_color0 #include "common.sh" uniform vec4 u_tex_size1; +uniform vec4 u_inv_view_dims; void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; // A3 B3 C3 diff --git a/src/osd/modules/render/bgfx/shaders/vs_gui.sc b/src/osd/modules/render/bgfx/shaders/vs_gui.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_gui.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_gui.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/shaders/vs_screen.sc b/src/osd/modules/render/bgfx/shaders/vs_screen.sc index 405ef8feb3b..df2b37f203c 100644 --- a/src/osd/modules/render/bgfx/shaders/vs_screen.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_screen.sc @@ -6,9 +6,14 @@ $output v_texcoord0, v_color0 #include "common.sh" +uniform vec4 u_inv_view_dims; + void main() { gl_Position = mul(u_viewProj, vec4(a_position.xy, 0.0, 1.0)); +#if BGFX_SHADER_LANGUAGE_HLSL && BGFX_SHADER_LANGUAGE_HLSL <= 300 + gl_Position.xy += u_inv_view_dims.xy * gl_Position.w; +#endif v_texcoord0 = a_texcoord0; v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/statereader.cpp b/src/osd/modules/render/bgfx/statereader.cpp index 51b08fea864..0faef68aa7c 100644 --- a/src/osd/modules/render/bgfx/statereader.cpp +++ b/src/osd/modules/render/bgfx/statereader.cpp @@ -22,6 +22,14 @@ bool state_reader::V_READER_CHECK(bool condition, const util::format_argument_pa return condition; } +bool state_reader::V_READER_WARN(bool condition, const util::format_argument_pack &args) +{ + if (!condition) + osd_printf_warning("Warning: %s\n", util::string_format(args)); + + return condition; +} + uint64_t state_reader::get_enum_from_value(const Value& value, std::string name, const uint64_t default_value, const string_to_enum* enums, const int count) { if (value.HasMember(name.c_str())) @@ -112,7 +120,7 @@ float state_reader::get_float(const Value& value, const std::string name, const { if (value.HasMember(name.c_str())) { - return (float)value[name.c_str()].GetDouble(); + return float(value[name.c_str()].GetDouble()); } return default_value; } @@ -123,7 +131,7 @@ void state_reader::get_float(const Value& value, const std::string name, float* { if (count == 1) { - *out = (float) value[name.c_str()].GetDouble(); + *out = float(value[name.c_str()].GetDouble()); return; } else @@ -141,7 +149,7 @@ void state_reader::get_vec_values(const Value& value_array, float* data, const u { for (unsigned int i = 0; i < count && i < value_array.Size(); i++) { - data[i] = (float) value_array[i].GetDouble(); + data[i] = float(value_array[i].GetDouble()); } } diff --git a/src/osd/modules/render/bgfx/statereader.h b/src/osd/modules/render/bgfx/statereader.h index 0c452aabee8..6af02bbbd66 100644 --- a/src/osd/modules/render/bgfx/statereader.h +++ b/src/osd/modules/render/bgfx/statereader.h @@ -53,8 +53,15 @@ protected: return V_READER_CHECK(condition, util::make_format_argument_pack(std::forward(fmt), std::forward(args)...)); } + template + static bool READER_WARN(bool condition, Format &&fmt, Params &&... args) + { + return V_READER_WARN(condition, util::make_format_argument_pack(std::forward(fmt), std::forward(args)...)); + } + private: static bool V_READER_CHECK(bool condition, const util::format_argument_pack &args); + static bool V_READER_WARN(bool condition, const util::format_argument_pack &args); static void get_vec_values(const Value& value_array, float* data, const unsigned int count); }; diff --git a/src/osd/modules/render/bgfx/target.cpp b/src/osd/modules/render/bgfx/target.cpp index f900f4f99fb..dd9169cb6cd 100644 --- a/src/osd/modules/render/bgfx/target.cpp +++ b/src/osd/modules/render/bgfx/target.cpp @@ -10,13 +10,16 @@ #include "target.h" -bgfx_target::bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen) +bgfx_target::bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint16_t xprescale, uint16_t yprescale, + uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen) : m_name(name) , m_format(format) , m_targets(nullptr) , m_textures(nullptr) , m_width(width) , m_height(height) + , m_xprescale(xprescale) + , m_yprescale(yprescale) , m_double_buffer(double_buffer) , m_style(style) , m_filter(filter) @@ -39,10 +42,10 @@ bgfx_target::bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uin m_targets = new bgfx::FrameBufferHandle[m_page_count]; for (int page = 0; page < m_page_count; page++) { - m_textures[page] = bgfx::createTexture2D(m_width, m_height, false, 1, format, wrap_mode | filter_mode | BGFX_TEXTURE_RT); + m_textures[page] = bgfx::createTexture2D(m_width * xprescale, m_height * yprescale, false, 1, format, wrap_mode | filter_mode | BGFX_TEXTURE_RT); assert(m_textures[page].idx != 0xffff); - m_textures[m_page_count + page] = bgfx::createTexture2D(m_width, m_height, false, 1, bgfx::TextureFormat::D32F, depth_flags | BGFX_TEXTURE_RT); + m_textures[m_page_count + page] = bgfx::createTexture2D(m_width * xprescale, m_height * yprescale, false, 1, bgfx::TextureFormat::D32F, depth_flags | BGFX_TEXTURE_RT); assert(m_textures[m_page_count + page].idx != 0xffff); bgfx::TextureHandle handles[2] = { m_textures[page], m_textures[m_page_count + page] }; @@ -62,6 +65,8 @@ bgfx_target::bgfx_target(void *handle, uint16_t width, uint16_t height) , m_textures(nullptr) , m_width(width) , m_height(height) + , m_xprescale(1) + , m_yprescale(1) , m_double_buffer(false) , m_style(TARGET_STYLE_CUSTOM) , m_filter(false) diff --git a/src/osd/modules/render/bgfx/target.h b/src/osd/modules/render/bgfx/target.h index c00fc669337..5b979373971 100644 --- a/src/osd/modules/render/bgfx/target.h +++ b/src/osd/modules/render/bgfx/target.h @@ -27,7 +27,8 @@ enum class bgfx_target : public bgfx_texture_handle_provider { public: - bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen); + bgfx_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint16_t xprescale, uint16_t yprescale, + uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen); bgfx_target(void *handle, uint16_t width, uint16_t height); virtual ~bgfx_target(); @@ -42,13 +43,16 @@ public: bool filter() const { return m_filter; } uint16_t scale() const { return m_scale; } uint32_t screen_index() const { return m_screen; } + uint16_t raw_width() const { return m_width; } + uint16_t raw_height() const { return m_height; } // bgfx_texture_handle_provider virtual bgfx::TextureHandle texture() const override; virtual bool is_target() const override { return true; } - virtual uint16_t width() const override { return m_width; } - virtual uint16_t height() const override { return m_height; } - virtual uint16_t rowpixels() const override { return m_width; } + virtual uint16_t width() const override { return m_width * m_xprescale; } + virtual uint16_t width_margin() const override { return 0; } + virtual uint16_t height() const override { return m_height * m_yprescale; } + virtual uint16_t rowpixels() const override { return m_width * m_xprescale; } virtual int width_div_factor() const override { return 1; } virtual int width_mul_factor() const override { return 1; } @@ -62,6 +66,8 @@ private: uint16_t m_width; uint16_t m_height; + uint16_t m_xprescale; + uint16_t m_yprescale; bool m_double_buffer; uint32_t m_style; diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp index dfd5b2adbd1..38ef04b61f9 100644 --- a/src/osd/modules/render/bgfx/targetmanager.cpp +++ b/src/osd/modules/render/bgfx/targetmanager.cpp @@ -11,14 +11,14 @@ #include -#include - #include "modules/lib/osdobj_common.h" +#include "bgfxutil.h" #include "targetmanager.h" - #include "target.h" +#include + const int32_t target_manager::MAX_SCREENS = 100; target_manager::target_manager(texture_manager& textures) @@ -45,7 +45,8 @@ target_manager::~target_manager() } } -bgfx_target* target_manager::create_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen) +bgfx_target* target_manager::create_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint16_t xprescale, uint16_t yprescale, + uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen) { std::string full_name = name + std::to_string(screen); @@ -53,7 +54,7 @@ bgfx_target* target_manager::create_target(std::string name, bgfx::TextureFormat if (iter != m_targets.end()) destroy_target(name, screen); - bgfx_target *target = new bgfx_target(name, format, width, height, style, double_buffer, filter, scale, screen); + bgfx_target *target = new bgfx_target(name, format, width, height, xprescale, yprescale, style, double_buffer, filter, scale, screen); m_targets[full_name] = target; m_textures.add_provider(full_name, target); @@ -88,7 +89,7 @@ bgfx_target* target_manager::target(uint32_t screen, std::string name) return m_targets[full_name]; } -bool target_manager::update_target_sizes(uint32_t screen, uint16_t width, uint16_t height, uint32_t style) +bool target_manager::update_target_sizes(uint32_t screen, uint16_t width, uint16_t height, uint32_t style, uint16_t user_prescale, uint16_t max_prescale_size) { if (style == TARGET_STYLE_CUSTOM) return false; @@ -103,14 +104,14 @@ bool target_manager::update_target_sizes(uint32_t screen, uint16_t width, uint16 if (width != sizes[screen].width() || height != sizes[screen].height()) { sizes[screen] = osd_dim(width, height); - rebuild_targets(screen, style); + rebuild_targets(screen, style, user_prescale, max_prescale_size); return true; } return false; } -void target_manager::rebuild_targets(uint32_t screen, uint32_t style) +void target_manager::rebuild_targets(uint32_t screen, uint32_t style, uint16_t user_prescale, uint16_t max_prescale_size) { if (style == TARGET_STYLE_CUSTOM) return; @@ -135,13 +136,16 @@ void target_manager::rebuild_targets(uint32_t screen, uint32_t style) const uint16_t scale = target->scale(); const uint16_t width(sizes[screen].width()); const uint16_t height(sizes[screen].height()); + uint16_t xprescale = user_prescale; + uint16_t yprescale = user_prescale; + bgfx_util::find_prescale_factor(width, height, max_prescale_size, xprescale, yprescale); destroy_target(name, screen); - create_target(name, format, width, height, style, double_buffered, filter, scale, screen); + create_target(name, format, width, height, xprescale, yprescale, style, double_buffered, filter, scale, screen); } } -void target_manager::update_screen_count(uint32_t count) +void target_manager::update_screen_count(uint32_t count, uint16_t user_prescale, uint16_t max_prescale_size) { // Ensure that there's an entry to fill while (count > m_native_dims.size()) @@ -157,26 +161,26 @@ void target_manager::update_screen_count(uint32_t count) { for (uint32_t screen = old_count; screen < m_screen_count; screen++) { - create_target_if_nonexistent(screen, "output", false, false, TARGET_STYLE_NATIVE); + create_output_if_nonexistent(screen, user_prescale, max_prescale_size); } } } } -void target_manager::create_target_if_nonexistent(uint32_t screen, std::string name, bool double_buffered, bool filter, uint32_t style) +void target_manager::create_output_if_nonexistent(uint32_t screen, uint16_t user_prescale, uint16_t max_prescale_size) { - if (style == TARGET_STYLE_CUSTOM) return; - - if (m_targets.find(name + std::to_string(screen)) != m_targets.end()) + if (m_targets.find("output" + std::to_string(screen)) != m_targets.end()) { return; } - std::vector& sizes = style == TARGET_STYLE_GUEST ? m_guest_dims : m_native_dims; - uint16_t width(sizes[screen].width()); - uint16_t height(sizes[screen].height()); + uint16_t width(m_native_dims[screen].width()); + uint16_t height(m_native_dims[screen].height()); + uint16_t xprescale = user_prescale; + uint16_t yprescale = user_prescale; + bgfx_util::find_prescale_factor(width, height, max_prescale_size, xprescale, yprescale); - create_target(name, bgfx::TextureFormat::BGRA8, width, height, style, double_buffered, filter, 1, screen); + create_target("output", bgfx::TextureFormat::BGRA8, width, height, xprescale, yprescale, TARGET_STYLE_NATIVE, false, false, 1, screen); } uint16_t target_manager::width(uint32_t style, uint32_t screen) diff --git a/src/osd/modules/render/bgfx/targetmanager.h b/src/osd/modules/render/bgfx/targetmanager.h index fa44e2c1bd6..e3406722eda 100644 --- a/src/osd/modules/render/bgfx/targetmanager.h +++ b/src/osd/modules/render/bgfx/targetmanager.h @@ -30,12 +30,13 @@ public: target_manager(texture_manager& textures); ~target_manager(); - bgfx_target* create_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen); + bgfx_target* create_target(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint16_t xprescale, uint16_t yprescale, + uint32_t style, bool double_buffer, bool filter, uint16_t scale, uint32_t screen); void destroy_target(std::string name, uint32_t screen = -1); bgfx_target* create_backbuffer(void *handle, uint16_t width, uint16_t height); - bool update_target_sizes(uint32_t screen, uint16_t width, uint16_t height, uint32_t style); - void update_screen_count(uint32_t count); + bool update_target_sizes(uint32_t screen, uint16_t width, uint16_t height, uint32_t style, uint16_t user_prescale, uint16_t max_prescale_size); + void update_screen_count(uint32_t count, uint16_t user_prescale, uint16_t max_prescale_size); // Getters bgfx_target* target(uint32_t screen, std::string name); @@ -43,8 +44,8 @@ public: uint16_t height(uint32_t style, uint32_t screen); private: - void rebuild_targets(uint32_t screen, uint32_t style); - void create_target_if_nonexistent(uint32_t screen, std::string name, bool double_buffered, bool filter, uint32_t style); + void rebuild_targets(uint32_t screen, uint32_t style, uint16_t user_prescale, uint16_t max_prescale_size); + void create_output_if_nonexistent(uint32_t screen, uint16_t user_prescale, uint16_t max_prescale_size); std::map m_targets; texture_manager& m_textures; diff --git a/src/osd/modules/render/bgfx/targetreader.cpp b/src/osd/modules/render/bgfx/targetreader.cpp index e66a147d7ba..549ab78fca6 100644 --- a/src/osd/modules/render/bgfx/targetreader.cpp +++ b/src/osd/modules/render/bgfx/targetreader.cpp @@ -10,6 +10,7 @@ #include +#include "bgfxutil.h" #include "chainmanager.h" #include "target.h" @@ -21,7 +22,7 @@ const target_reader::string_to_enum target_reader::STYLE_NAMES[target_reader::ST { "custom", TARGET_STYLE_CUSTOM } }; -bgfx_target* target_reader::read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index) +bgfx_target* target_reader::read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index, uint16_t user_prescale, uint16_t max_prescale_size) { if (!validate_parameters(value, prefix)) { @@ -37,20 +38,40 @@ bgfx_target* target_reader::read_from_value(const Value& value, std::string pref { scale = int(floor(value["scale"].GetDouble() + 0.5)); } + bool use_user_prescale = get_bool(value, "user_prescale", false); uint16_t width = 0; uint16_t height = 0; + uint16_t xprescale = 1; + uint16_t yprescale = 1; switch (mode) { case TARGET_STYLE_GUEST: + { width = chains.targets().width(TARGET_STYLE_GUEST, screen_index); height = chains.targets().height(TARGET_STYLE_GUEST, screen_index); + + if (use_user_prescale) + { + xprescale = user_prescale; + yprescale = user_prescale; + bgfx_util::find_prescale_factor(width, height, max_prescale_size, xprescale, yprescale); + } break; + } case TARGET_STYLE_NATIVE: width = chains.targets().width(TARGET_STYLE_NATIVE, screen_index); height = chains.targets().height(TARGET_STYLE_NATIVE, screen_index); + + if (use_user_prescale) + { + xprescale = user_prescale; + yprescale = user_prescale; + bgfx_util::find_prescale_factor(width, height, max_prescale_size, xprescale, yprescale); + } break; case TARGET_STYLE_CUSTOM: + READER_WARN(!value.HasMember("user_prescale"), (prefix + "Target '" + target_name + "': user_prescale parameter is not used for custom-type render targets.\n").c_str()); if (!READER_CHECK(value.HasMember("width"), (prefix + "Target '" + target_name + "': Must have numeric value 'width'\n").c_str())) return nullptr; if (!READER_CHECK(value["width"].IsNumber(), (prefix + "Target '" + target_name + "': Value 'width' must be a number\n").c_str())) return nullptr; if (!READER_CHECK(value.HasMember("height"), (prefix + "Target '" + target_name + "': Must have numeric value 'height'\n").c_str())) return nullptr; @@ -60,7 +81,7 @@ bgfx_target* target_reader::read_from_value(const Value& value, std::string pref break; } - return chains.targets().create_target(target_name, bgfx::TextureFormat::BGRA8, width, height, mode, double_buffer, bilinear, scale, screen_index); + return chains.targets().create_target(target_name, bgfx::TextureFormat::BGRA8, width, height, xprescale, yprescale, mode, double_buffer, bilinear, scale, screen_index); } bool target_reader::validate_parameters(const Value& value, std::string prefix) @@ -71,6 +92,7 @@ bool target_reader::validate_parameters(const Value& value, std::string prefix) if (!READER_CHECK(value["mode"].IsString(), (prefix + "Value 'mode' must be a string (what screens does this apply to?)\n").c_str())) return false; if (!READER_CHECK(!value.HasMember("bilinear") || value["bilinear"].IsBool(), (prefix + "Value 'bilinear' must be a boolean\n").c_str())) return false; if (!READER_CHECK(!value.HasMember("doublebuffer") || value["doublebuffer"].IsBool(), (prefix + "Value 'doublebuffer' must be a boolean\n").c_str())) return false; + if (!READER_CHECK(!value.HasMember("user_prescale") || value["user_prescale"].IsBool(), (prefix + "Value 'user_prescale' must be a boolean\n").c_str())) return false; if (!READER_CHECK(!value.HasMember("scale") || value["scale"].IsNumber(), (prefix + "Value 'scale' must be a numeric value\n").c_str())) return false; return true; } diff --git a/src/osd/modules/render/bgfx/targetreader.h b/src/osd/modules/render/bgfx/targetreader.h index 7edf5e456fa..f77949c7ad4 100644 --- a/src/osd/modules/render/bgfx/targetreader.h +++ b/src/osd/modules/render/bgfx/targetreader.h @@ -21,7 +21,7 @@ class chain_manager; class target_reader : public state_reader { public: - static bgfx_target* read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index); + static bgfx_target* read_from_value(const Value& value, std::string prefix, chain_manager& chains, uint32_t screen_index, uint16_t user_prescale, uint16_t max_prescale_size); private: static bool validate_parameters(const Value& value, std::string prefix); diff --git a/src/osd/modules/render/bgfx/texture.cpp b/src/osd/modules/render/bgfx/texture.cpp index a504c625415..2ffa97c0b6f 100644 --- a/src/osd/modules/render/bgfx/texture.cpp +++ b/src/osd/modules/render/bgfx/texture.cpp @@ -10,10 +10,11 @@ #include "texture.h" -bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t flags, void* data) +bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t width_margin, uint16_t height, uint32_t flags, void* data) : m_name(name) , m_format(format) , m_width(width) + , m_width_margin(width_margin) , m_height(height) , m_rowpixels(width) , m_width_div_factor(1) @@ -35,10 +36,11 @@ bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, u } } -bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, const bgfx::Memory* data, uint32_t flags, uint16_t pitch, uint16_t rowpixels, int width_div_factor, int width_mul_factor) +bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t width_margin, uint16_t height, const bgfx::Memory* data, uint32_t flags, uint16_t pitch, uint16_t rowpixels, int width_div_factor, int width_mul_factor) : m_name(name) , m_format(format) , m_width(width) + , m_width_margin(width_margin) , m_height(height) , m_rowpixels(rowpixels ? rowpixels : width) , m_width_div_factor(width_div_factor) @@ -56,7 +58,8 @@ bgfx_texture::~bgfx_texture() bgfx::destroy(m_texture); } -void bgfx_texture::update(const bgfx::Memory *data, uint16_t pitch) +void bgfx_texture::update(const bgfx::Memory *data, uint16_t pitch, uint16_t width_margin) { + m_width_margin = width_margin; bgfx::updateTexture2D(m_texture, 0, 0, 0, 0, (m_rowpixels * m_width_mul_factor) / m_width_div_factor, m_height, data, pitch); } diff --git a/src/osd/modules/render/bgfx/texture.h b/src/osd/modules/render/bgfx/texture.h index 75fedcd3129..ced0604dfcf 100644 --- a/src/osd/modules/render/bgfx/texture.h +++ b/src/osd/modules/render/bgfx/texture.h @@ -20,8 +20,8 @@ class bgfx_texture : public bgfx_texture_handle_provider { public: - bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, uint32_t flags, void* data); - bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t height, const bgfx::Memory* data, uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP, uint16_t pitch = UINT16_MAX, uint16_t rowpixels = 0, int width_div_factor = 1, int width_mul_factor = 1); + bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t width_margin, uint16_t height, uint32_t flags, void* data); + bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint16_t width, uint16_t width_margin, uint16_t height, const bgfx::Memory* data, uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP, uint16_t pitch = UINT16_MAX, uint16_t rowpixels = 0, int width_div_factor = 1, int width_mul_factor = 1); virtual ~bgfx_texture(); // Getters @@ -32,17 +32,19 @@ public: virtual bgfx::TextureHandle texture() const override { return m_texture; } virtual bool is_target() const override { return false; } virtual uint16_t width() const override { return m_width; } + virtual uint16_t width_margin() const override { return m_width_margin; } virtual uint16_t height() const override { return m_height; } virtual uint16_t rowpixels() const override { return m_rowpixels; } virtual int width_div_factor() const override { return m_width_div_factor; } virtual int width_mul_factor() const override { return m_width_mul_factor; } - void update(const bgfx::Memory *data, uint16_t pitch = UINT16_MAX); + void update(const bgfx::Memory *data, uint16_t pitch = UINT16_MAX, uint16_t width_margin = 0); protected: std::string m_name; bgfx::TextureFormat::Enum m_format; uint16_t m_width; + uint16_t m_width_margin; uint16_t m_height; uint16_t m_rowpixels; int m_width_div_factor; diff --git a/src/osd/modules/render/bgfx/texturehandleprovider.h b/src/osd/modules/render/bgfx/texturehandleprovider.h index 14fb2fe892c..aa6a41157e2 100644 --- a/src/osd/modules/render/bgfx/texturehandleprovider.h +++ b/src/osd/modules/render/bgfx/texturehandleprovider.h @@ -23,6 +23,7 @@ public: virtual bgfx::TextureHandle texture() const = 0; virtual bool is_target() const = 0; virtual uint16_t width() const = 0; + virtual uint16_t width_margin() const = 0; virtual uint16_t height() const = 0; virtual uint16_t rowpixels() const = 0; virtual int width_div_factor() const = 0; diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp index 82225f87eb0..31b7c02e31b 100644 --- a/src/osd/modules/render/bgfx/texturemanager.cpp +++ b/src/osd/modules/render/bgfx/texturemanager.cpp @@ -50,9 +50,9 @@ void texture_manager::add_provider(std::string name, bgfx_texture_handle_provide } } -bgfx_texture* texture_manager::create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags) +bgfx_texture* texture_manager::create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t width_margin, uint32_t height, void* data, uint32_t flags) { - auto* texture = new bgfx_texture(name, format, width, height, flags, data); + auto* texture = new bgfx_texture(name, format, width, width_margin, height, flags, data); m_textures[name] = texture; return texture; } @@ -89,14 +89,14 @@ bgfx_texture* texture_manager::create_png_texture(std::string path, std::string { texture_name += std::to_string(screen); } - bgfx_texture* texture = create_texture(texture_name, bgfx::TextureFormat::BGRA8, width, height, data, flags); + bgfx_texture* texture = create_texture(texture_name, bgfx::TextureFormat::BGRA8, width, 0, height, data, flags); delete [] data; return texture; } -bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t format, int width, int height +bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t format, int width, int width_margin, int height , int rowpixels, const rgb_t *palette, void *base, uint32_t seqid, uint32_t flags, uint64_t key, uint64_t old_key) { bgfx::TextureHandle handle = BGFX_INVALID_HANDLE; @@ -126,8 +126,8 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form uint16_t pitch = width; int width_div_factor = 1; int width_mul_factor = 1; - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, rowpixels, height, palette, base, pitch, width_div_factor, width_mul_factor); - bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)((rowpixels * width_mul_factor) / width_div_factor), (uint16_t)height, mem, pitch); + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, rowpixels, width_margin, height, palette, base, pitch, width_div_factor, width_mul_factor); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, uint16_t((rowpixels * width_mul_factor) / width_div_factor), uint16_t(height), mem, pitch); return handle; } } @@ -156,8 +156,8 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form uint16_t pitch = width; int width_div_factor = 1; int width_mul_factor = 1; - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, rowpixels, height, palette, base, pitch, width_div_factor, width_mul_factor); - bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)((rowpixels * width_mul_factor) / width_div_factor), (uint16_t)height, mem, pitch); + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, rowpixels, width_margin, height, palette, base, pitch, width_div_factor, width_mul_factor); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, uint16_t((rowpixels * width_mul_factor) / width_div_factor), uint16_t(height), mem, pitch); return handle; } } @@ -169,10 +169,10 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form uint16_t pitch = width; int width_div_factor = 1; int width_mul_factor = 1; - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, rowpixels, height, palette, base, pitch, width_div_factor, width_mul_factor); - const uint16_t adjusted_width = (uint16_t)((rowpixels * width_mul_factor) / width_div_factor); + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, rowpixels, width_margin, height, palette, base, pitch, width_div_factor, width_mul_factor); + const uint16_t adjusted_width = uint16_t((rowpixels * width_mul_factor) / width_div_factor); handle = bgfx::createTexture2D(adjusted_width, height, false, 1, dst_format, flags, nullptr); - bgfx::updateTexture2D(handle, 0, 0, 0, 0, adjusted_width, (uint16_t)height, mem, pitch); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, adjusted_width, uint16_t(height), mem, pitch); m_mame_textures[key] = { handle, seqid, width, height }; return handle; diff --git a/src/osd/modules/render/bgfx/texturemanager.h b/src/osd/modules/render/bgfx/texturemanager.h index db71f07c0fa..904837e917b 100644 --- a/src/osd/modules/render/bgfx/texturemanager.h +++ b/src/osd/modules/render/bgfx/texturemanager.h @@ -30,12 +30,12 @@ public: texture_manager() { } ~texture_manager(); - bgfx_texture* create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data = nullptr, uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP); + bgfx_texture* create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t width_margin, uint32_t height, void* data = nullptr, uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP); bgfx_texture* create_png_texture(std::string path, std::string file_name, std::string texture_name, uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP, uint32_t screen = -1); void add_provider(std::string name, bgfx_texture_handle_provider* texture); void remove_provider(std::string name, bool delete_provider = false); - bgfx::TextureHandle create_or_update_mame_texture(uint32_t format, int width, int height - , int rowpixels, const rgb_t *palette, void *base, uint32_t seqid, uint32_t flags, uint64_t key, uint64_t old_key); + bgfx::TextureHandle create_or_update_mame_texture(uint32_t format, int width, int width_margin, int height, + int rowpixels, const rgb_t *palette, void *base, uint32_t seqid, uint32_t flags, uint64_t key, uint64_t old_key); // Getters bgfx::TextureHandle handle(std::string name); diff --git a/src/osd/modules/render/bgfx/uniformreader.cpp b/src/osd/modules/render/bgfx/uniformreader.cpp index f2bf1114ec6..e71ce34c282 100644 --- a/src/osd/modules/render/bgfx/uniformreader.cpp +++ b/src/osd/modules/render/bgfx/uniformreader.cpp @@ -37,7 +37,7 @@ bgfx_uniform* uniform_reader::read_from_value(const Value& value, std::string pr unsigned int index = 0; for (; index < type_size / 4 && index < value_array.Size(); index++) { - data[index] = (float)value_array[index].GetDouble(); + data[index] = float(value_array[index].GetDouble()); } for (; index < type_size / 4; index++) @@ -45,7 +45,7 @@ bgfx_uniform* uniform_reader::read_from_value(const Value& value, std::string pr data[index] = 0.0f; } - auto* uniform = new bgfx_uniform(name, type); + bgfx_uniform* uniform = new bgfx_uniform(name, type); uniform->set((void*)data, type_size); delete [] data; diff --git a/src/osd/modules/render/bgfx/view.h b/src/osd/modules/render/bgfx/view.h index a1793f89d0b..577663ea525 100644 --- a/src/osd/modules/render/bgfx/view.h +++ b/src/osd/modules/render/bgfx/view.h @@ -21,7 +21,7 @@ public: , m_view_height(0) , m_z_near(0.0f) , m_z_far(100.0f) - , m_clear_color(0) + , m_clear_color(0x000000ff) , m_clear_depth(1.0f) , m_clear_stencil(0) , m_do_clear_color(true) diff --git a/src/osd/modules/render/bgfxutil.cpp b/src/osd/modules/render/bgfxutil.cpp index e864cb98fb4..3d555bb60ad 100644 --- a/src/osd/modules/render/bgfxutil.cpp +++ b/src/osd/modules/render/bgfxutil.cpp @@ -14,10 +14,11 @@ #include "render.h" -const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::TextureFormat::Enum &dst_format, uint32_t src_format, int rowpixels, int height, const rgb_t *palette, void *base, uint16_t &out_pitch, int &width_div_factor, int &width_mul_factor) +const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::TextureFormat::Enum &dst_format, uint32_t src_format, int rowpixels, int width_margin, int height, const rgb_t *palette, void *base, uint16_t &out_pitch, int &width_div_factor, int &width_mul_factor) { bgfx::TextureInfo info; const bgfx::Memory *data = nullptr; + uint8_t *adjusted_base = (uint8_t *)base; switch (src_format) { @@ -28,7 +29,11 @@ const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::Text out_pitch = rowpixels * 2; bgfx::calcTextureSize(info, rowpixels / width_div_factor, height, 1, false, false, 1, dst_format); - data = bgfx::copy(base, info.storageSize); + if (width_margin) + { + adjusted_base -= width_margin * 2; + } + data = bgfx::copy(adjusted_base, info.storageSize); break; case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTE16): dst_format = bgfx::TextureFormat::R8; @@ -37,7 +42,11 @@ const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::Text out_pitch = rowpixels * 2; bgfx::calcTextureSize(info, rowpixels * width_mul_factor, height, 1, false, false, 1, dst_format); - data = bgfx::copy(base, info.storageSize); + if (width_margin) + { + adjusted_base -= width_margin * 2; + } + data = bgfx::copy(adjusted_base, info.storageSize); break; case PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32): case PRIMFLAG_TEXFORMAT(TEXFORMAT_RGB32): @@ -47,7 +56,11 @@ const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(bgfx::Text out_pitch = rowpixels * 4; bgfx::calcTextureSize(info, rowpixels, height, 1, false, false, 1, dst_format); - data = bgfx::copy(base, info.storageSize); + if (width_margin) + { + adjusted_base -= width_margin * 4; + } + data = bgfx::copy(adjusted_base, info.storageSize); break; } @@ -96,6 +109,7 @@ uint64_t bgfx_util::get_blend_state(uint32_t blend) case BLENDMODE_ALPHA: return BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA); case BLENDMODE_RGB_MULTIPLY: + //return BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_INV_SRC_COLOR, BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ZERO); return BGFX_STATE_BLEND_FUNC_SEPARATE(BGFX_STATE_BLEND_DST_COLOR, BGFX_STATE_BLEND_ZERO, BGFX_STATE_BLEND_DST_ALPHA, BGFX_STATE_BLEND_ZERO); case BLENDMODE_ADD: return BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_ONE); @@ -104,3 +118,15 @@ uint64_t bgfx_util::get_blend_state(uint32_t blend) } return 0L; } + +void bgfx_util::find_prescale_factor(uint16_t width, uint16_t height, uint16_t max_prescale_size, uint16_t &xprescale, uint16_t &yprescale) +{ + while (xprescale > 1 && width * xprescale > max_prescale_size) + { + xprescale--; + } + while (yprescale > 1 && height * yprescale > max_prescale_size) + { + yprescale--; + } +} diff --git a/src/osd/modules/render/bgfxutil.h b/src/osd/modules/render/bgfxutil.h index db07e7fba77..aa108a6fb3b 100644 --- a/src/osd/modules/render/bgfxutil.h +++ b/src/osd/modules/render/bgfxutil.h @@ -15,9 +15,10 @@ class bgfx_util { public: - static const bgfx::Memory* mame_texture_data_to_bgfx_texture_data(bgfx::TextureFormat::Enum &dst_format, uint32_t format, int rowpixels, int height, const rgb_t *palette, void *base, uint16_t &out_pitch, int &width_div_factor, int &width_mul_factor); + static const bgfx::Memory* mame_texture_data_to_bgfx_texture_data(bgfx::TextureFormat::Enum &dst_format, uint32_t format, int rowpixels, int width_margin, int height, const rgb_t *palette, void *base, uint16_t &out_pitch, int &width_div_factor, int &width_mul_factor); static const bgfx::Memory* mame_texture_data_to_bgra32(uint32_t src_format, int width, int height, int rowpixels, const rgb_t *palette, void *base); static uint64_t get_blend_state(uint32_t blend); + static void find_prescale_factor(uint16_t width, uint16_t height, uint16_t max_prescale_size, uint16_t &xprescale, uint16_t &yprescale); }; #endif // RENDER_BGFX_UTIL diff --git a/src/osd/modules/render/binpacker.h b/src/osd/modules/render/binpacker.h index 1fb84596eec..52efe4abb85 100644 --- a/src/osd/modules/render/binpacker.h +++ b/src/osd/modules/render/binpacker.h @@ -29,7 +29,7 @@ public: class packable_rectangle { public: - packable_rectangle() : m_hash(0), m_width(-1), m_height(-1) { } + packable_rectangle() = default; packable_rectangle(uint32_t hash, uint32_t format, int width, int height, int rowpixels, const rgb_t *palette, void *base) : m_hash(hash) , m_format(format) @@ -50,19 +50,19 @@ public: void* base() const { return m_base; } private: - uint32_t m_hash; - uint32_t m_format; - int m_width; - int m_height; - int m_rowpixels; - const rgb_t* m_palette; - void* m_base; + uint32_t m_hash = 0; + uint32_t m_format = 0; + int m_width = -1; + int m_height = -1; + int m_rowpixels = 0; + const rgb_t* m_palette = nullptr; + void* m_base = nullptr; }; class packed_rectangle { public: - packed_rectangle() : m_hash(0), m_format(0), m_width(-1), m_height(-1), m_x(-1), m_y(-1), m_rowpixels(0), m_palette(nullptr), m_base(nullptr) { } + packed_rectangle() = default; packed_rectangle(const packed_rectangle& rect) : m_hash(rect.m_hash) , m_format(rect.m_format) @@ -99,15 +99,15 @@ public: void* base() const { return m_base; } private: - uint32_t m_hash; - uint32_t m_format; - int m_width; - int m_height; - int m_x; - int m_y; - int m_rowpixels; - const rgb_t* m_palette; - void* m_base; + uint32_t m_hash = 0; + uint32_t m_format = 0; + int m_width = -1; + int m_height = -1; + int m_x = -1; + int m_y = -1; + int m_rowpixels = 0; + const rgb_t* m_palette = nullptr; + void* m_base = nullptr; }; bool pack(const std::vector& rects, std::vector>& packs, int pack_size); diff --git a/src/osd/modules/render/d3d/d3dcomm.h b/src/osd/modules/render/d3d/d3dcomm.h index c7dc58c6340..2d7548a242a 100644 --- a/src/osd/modules/render/d3d/d3dcomm.h +++ b/src/osd/modules/render/d3d/d3dcomm.h @@ -170,7 +170,7 @@ class poly_info public: void init(D3DPRIMITIVETYPE type, uint32_t count, uint32_t numverts, uint32_t flags, texture_info *texture, uint32_t modmode, - float prim_width, float prim_height) + float prim_width, float prim_height, uint32_t tint) { m_type = type; m_count = count; @@ -180,6 +180,7 @@ public: m_modmode = modmode; m_prim_width = prim_width; m_prim_height = prim_height; + m_tint = tint; } D3DPRIMITIVETYPE type() const { return m_type; } @@ -193,6 +194,8 @@ public: float prim_width() const { return m_prim_width; } float prim_height() const { return m_prim_height; } + DWORD tint() const { return m_tint; } + private: D3DPRIMITIVETYPE m_type; // type of primitive uint32_t m_count; // total number of primitives @@ -204,6 +207,8 @@ private: float m_prim_width; // used by quads float m_prim_height; // used by quads + + uint32_t m_tint; // color tint for primitive }; /* vertex describes a single vertex */ diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 0616af498e5..8c59649f64a 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -174,7 +174,8 @@ shaders::shaders() : post_fx_enable(false), oversampling_enable(false), num_screens(0), - curr_screen(0), + num_targets(0), + curr_target(0), acc_t(0), delta_t(0), shadow_texture(nullptr), @@ -195,7 +196,11 @@ shaders::shaders() : backbuffer(nullptr), curr_effect(nullptr), default_effect(nullptr), + ui_effect(nullptr), + ui_wrap_effect(nullptr), + vector_buffer_effect(nullptr), prescale_effect(nullptr), + prescale_point_effect(nullptr), post_effect(nullptr), distortion_effect(nullptr), scanline_effect(nullptr), @@ -208,11 +213,13 @@ shaders::shaders() : downsample_effect(nullptr), vector_effect(nullptr), chroma_effect(nullptr), + diffuse_texture(nullptr), curr_texture(nullptr), curr_render_target(nullptr), curr_poly(nullptr), d3dx_create_effect_from_file_ptr(nullptr) { + std::fill(std::begin(target_to_screen), std::end(target_to_screen), 0); } @@ -440,20 +447,28 @@ void shaders::set_texture(texture_info *texture) return; } - // set initial texture to use - texture_info *default_texture = d3d->get_default_texture(); - default_effect->set_texture("Diffuse", (texture == nullptr) ? default_texture->get_finaltex() : texture->get_finaltex()); - if (options->yiq_enable) + if (texture) { - ntsc_effect->set_texture("Diffuse", (texture == nullptr) ? default_texture->get_finaltex() : texture->get_finaltex()); + diffuse_texture = texture; } else { - color_effect->set_texture("Diffuse", (texture == nullptr) ? default_texture->get_finaltex() : texture->get_finaltex()); + diffuse_texture = d3d->get_default_texture(); } } +//============================================================ +// shaders::set_filter - indicates if screens should be +// filtered on upscaling +//============================================================ + +void shaders::set_filter(bool filter_screens) +{ + this->filter_screens = filter_screens; +} + + //============================================================ // shaders::init //============================================================ @@ -496,8 +511,6 @@ bool shaders::init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *r this->machine = machine; this->d3d = renderer; - enumerate_screens(); - auto &winoptions = downcast(machine->options()); post_fx_enable = winoptions.d3d_hlsl_enable(); @@ -612,12 +625,71 @@ bool shaders::init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *r } +//============================================================ +// shaders::begin_frame +// +// Enumerates the total number of screen textures present. +// +// Additionally, ensures the presence of necessary post- +// processing geometry. +// +//============================================================ + +void shaders::begin_frame(render_primitive_list *primlist) +{ + init_fsfx_quad(); + + std::fill(std::begin(target_to_screen), std::end(target_to_screen), 0); + std::fill(std::begin(targets_per_screen), std::end(targets_per_screen), 0); + render_container *containers[std::size(target_to_screen)]; + + // Maximum potential runtime O(max_num_targets^2) + num_targets = 0; + num_screens = 0; + curr_target = 0; + for (render_primitive &prim : *primlist) + { + if (PRIMFLAG_GET_SCREENTEX(prim.flags)) + { + containers[num_targets] = prim.container; + int screen_index = 0; + for (; screen_index < num_screens && containers[screen_index] != prim.container; screen_index++); + target_to_screen[num_targets] = screen_index; + targets_per_screen[screen_index]++; + if (screen_index >= num_screens) + num_screens++; + num_targets++; + } + } + + diffuse_texture = d3d->get_default_texture(); +} + + +//============================================================ +// shaders::end_frame +// +// Closes out any still-active effects at the end of +// rendering. +// +//============================================================ + +void shaders::end_frame() +{ + if (curr_effect->is_active()) + { + curr_effect->end(); + } +} + + //============================================================ // shaders::init_fsfx_quad // // Called always at the start of each frame so that the two // triangles used for the post-processing effects are always -// at the beginning of the vertex buffer +// at the beginning of the vertex buffer. +// //============================================================ void shaders::init_fsfx_quad() @@ -801,9 +873,13 @@ int shaders::create_resources() const char *fx_dir = downcast(machine->options()).screen_post_fx_dir(); default_effect = new effect(this, d3d->get_device(), "primary.fx", fx_dir); + ui_effect = new effect(this, d3d->get_device(), "primary.fx", fx_dir); + ui_wrap_effect = new effect(this, d3d->get_device(), "primary.fx", fx_dir); + vector_buffer_effect = new effect(this, d3d->get_device(), "primary.fx", fx_dir); post_effect = new effect(this, d3d->get_device(), "post.fx", fx_dir); distortion_effect = new effect(this, d3d->get_device(), "distortion.fx", fx_dir); prescale_effect = new effect(this, d3d->get_device(), "prescale.fx", fx_dir); + prescale_point_effect = new effect(this, d3d->get_device(), "prescale.fx", fx_dir); phosphor_effect = new effect(this, d3d->get_device(), "phosphor.fx", fx_dir); focus_effect = new effect(this, d3d->get_device(), "focus.fx", fx_dir); scanline_effect = new effect(this, d3d->get_device(), "scanline.fx", fx_dir); @@ -816,9 +892,13 @@ int shaders::create_resources() chroma_effect = new effect(this, d3d->get_device(), "chroma.fx", fx_dir); if (!default_effect->is_valid() || + !ui_effect->is_valid() || + !ui_wrap_effect->is_valid() || + !vector_buffer_effect->is_valid() || !post_effect->is_valid() || !distortion_effect->is_valid() || !prescale_effect->is_valid() || + !prescale_point_effect->is_valid() || !phosphor_effect->is_valid() || !focus_effect->is_valid() || !scanline_effect->is_valid() || @@ -833,18 +913,21 @@ int shaders::create_resources() return 1; } - std::array effects = { + std::array effects = { default_effect, + ui_effect, + ui_wrap_effect, + vector_buffer_effect, post_effect, distortion_effect, prescale_effect, + prescale_point_effect, phosphor_effect, focus_effect, scanline_effect, deconverge_effect, color_effect, ntsc_effect, - color_effect, bloom_effect, downsample_effect, vector_effect, @@ -853,12 +936,10 @@ int shaders::create_resources() for (int i = 0; i < effects.size(); i++) { - effects[i]->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); effects[i]->add_uniform("TargetDims", uniform::UT_VEC2, uniform::CU_TARGET_DIMS); effects[i]->add_uniform("TargetScale", uniform::UT_FLOAT, uniform::CU_TARGET_SCALE); effects[i]->add_uniform("ScreenDims", uniform::UT_VEC2, uniform::CU_SCREEN_DIMS); effects[i]->add_uniform("ScreenCount", uniform::UT_INT, uniform::CU_SCREEN_COUNT); - effects[i]->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); effects[i]->add_uniform("SwapXY", uniform::UT_BOOL, uniform::CU_SWAP_XY); effects[i]->add_uniform("VectorScreen", uniform::UT_BOOL, uniform::CU_VECTOR_SCREEN); } @@ -873,6 +954,7 @@ int shaders::create_resources() ntsc_effect->add_uniform("IFreqResponse", uniform::UT_FLOAT, uniform::CU_NTSC_IFREQ); ntsc_effect->add_uniform("QFreqResponse", uniform::UT_FLOAT, uniform::CU_NTSC_QFREQ); ntsc_effect->add_uniform("ScanTime", uniform::UT_FLOAT, uniform::CU_NTSC_HTIME); + ntsc_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); color_effect->add_uniform("RedRatios", uniform::UT_VEC3, uniform::CU_COLOR_RED_RATIOS); color_effect->add_uniform("GrnRatios", uniform::UT_VEC3, uniform::CU_COLOR_GRN_RATIOS); @@ -880,6 +962,7 @@ int shaders::create_resources() color_effect->add_uniform("Offset", uniform::UT_VEC3, uniform::CU_COLOR_OFFSET); color_effect->add_uniform("Scale", uniform::UT_VEC3, uniform::CU_COLOR_SCALE); color_effect->add_uniform("Saturation", uniform::UT_FLOAT, uniform::CU_COLOR_SATURATION); + color_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); deconverge_effect->add_uniform("ConvergeX", uniform::UT_VEC3, uniform::CU_CONVERGE_LINEAR_X); deconverge_effect->add_uniform("ConvergeY", uniform::UT_VEC3, uniform::CU_CONVERGE_LINEAR_Y); @@ -892,6 +975,8 @@ int shaders::create_resources() scanline_effect->add_uniform("ScanlineVariation", uniform::UT_FLOAT, uniform::CU_POST_SCANLINE_VARIATION); scanline_effect->add_uniform("ScanlineBrightScale", uniform::UT_FLOAT, uniform::CU_POST_SCANLINE_BRIGHT_SCALE); scanline_effect->add_uniform("ScanlineBrightOffset", uniform::UT_FLOAT, uniform::CU_POST_SCANLINE_BRIGHT_OFFSET); + scanline_effect->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); + scanline_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); focus_effect->add_uniform("Defocus", uniform::UT_VEC2, uniform::CU_FOCUS_SIZE); @@ -904,9 +989,15 @@ int shaders::create_resources() post_effect->add_uniform("Floor", uniform::UT_VEC3, uniform::CU_POST_FLOOR); post_effect->add_uniform("ChomaMode", uniform::UT_INT, uniform::CU_CHROMA_MODE); post_effect->add_uniform("ConversionGain", uniform::UT_VEC3, uniform::CU_CHROMA_CONVERSION_GAIN); + post_effect->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); + post_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); phosphor_effect->add_uniform("Phosphor", uniform::UT_VEC3, uniform::CU_PHOSPHOR_LIFE); + bloom_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); + + downsample_effect->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); + chroma_effect->add_uniform("YGain", uniform::UT_VEC3, uniform::CU_CHROMA_Y_GAIN); chroma_effect->add_uniform("ChromaA", uniform::UT_VEC2, uniform::CU_CHROMA_A); chroma_effect->add_uniform("ChromaB", uniform::UT_VEC2, uniform::CU_CHROMA_B); @@ -919,10 +1010,24 @@ int shaders::create_resources() distortion_effect->add_uniform("RoundCornerAmount", uniform::UT_FLOAT, uniform::CU_POST_ROUND_CORNER); distortion_effect->add_uniform("SmoothBorderAmount", uniform::UT_FLOAT, uniform::CU_POST_SMOOTH_BORDER); distortion_effect->add_uniform("ReflectionAmount", uniform::UT_FLOAT, uniform::CU_POST_REFLECTION); + distortion_effect->add_uniform("QuadDims", uniform::UT_VEC2, uniform::CU_QUAD_DIMS); + + prescale_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); + + prescale_point_effect->add_uniform("SourceDims", uniform::UT_VEC2, uniform::CU_SOURCE_DIMS); default_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); default_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); + ui_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); + ui_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); + + ui_wrap_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); + ui_wrap_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); + + vector_buffer_effect->add_uniform("LutEnable", uniform::UT_BOOL, uniform::CU_LUT_ENABLE); + vector_buffer_effect->add_uniform("UiLutEnable", uniform::UT_BOOL, uniform::CU_UI_LUT_ENABLE); + return 0; } @@ -940,7 +1045,7 @@ void shaders::begin_draw() return; } - curr_screen = 0; + curr_target = 0; curr_effect = default_effect; // Update for delta_time t = machine->time().as_double(); @@ -948,9 +1053,13 @@ void shaders::begin_draw() acc_t = t; default_effect->set_technique("ScreenTechnique"); + ui_effect->set_technique("UiTechnique"); + ui_wrap_effect->set_technique("UiWrapTechnique"); + vector_buffer_effect->set_technique("VectorBufferTechnique"); post_effect->set_technique("DefaultTechnique"); distortion_effect->set_technique("DefaultTechnique"); prescale_effect->set_technique("DefaultTechnique"); + prescale_point_effect->set_technique("PointTechnique"); phosphor_effect->set_technique("DefaultTechnique"); focus_effect->set_technique("DefaultTechnique"); scanline_effect->set_technique("DefaultTechnique"); @@ -971,6 +1080,24 @@ void shaders::begin_draw() } +//============================================================ +// shaders::set_curr_effect +//============================================================ + +void shaders::set_curr_effect(effect *curr_effect) +{ + if (this->curr_effect == curr_effect) + { + return; + } + if (this->curr_effect->is_active()) + { + this->curr_effect->end(); + } + this->curr_effect = curr_effect; +} + + //============================================================ // shaders::blit //============================================================ @@ -1002,24 +1129,17 @@ void shaders::blit( } } - UINT num_passes = 0; - curr_effect->begin(&num_passes, 0); - - for (UINT pass = 0; pass < num_passes; pass++) + if (!curr_effect->is_active()) { - curr_effect->begin_pass(pass); - - // add the primitives - result = d3d->get_device()->DrawPrimitive(prim_type, prim_index, prim_count); - if (FAILED(result)) - { - osd_printf_verbose("Direct3D: Error %08lX during device DrawPrimitive call\n", result); - } - - curr_effect->end_pass(); + curr_effect->begin(0); } - curr_effect->end(); + // add the primitives + result = d3d->get_device()->DrawPrimitive(prim_type, prim_index, prim_count); + if (FAILED(result)) + { + osd_printf_verbose("Direct3D: Error %08lX during device DrawPrimitive call\n", result); + } } //============================================================ @@ -1056,7 +1176,8 @@ int shaders::ntsc_pass(d3d_render_target *rt, int source_index, poly_info *poly, // initial "Diffuse" texture is set in shaders::set_texture() - curr_effect = ntsc_effect; + set_curr_effect(ntsc_effect); + curr_effect->set_texture("Diffuse", diffuse_texture->get_finaltex()); curr_effect->update_uniforms(); curr_effect->set_float("SignalOffset", signal_offset); @@ -1112,10 +1233,18 @@ int shaders::color_convolution_pass(d3d_render_target *rt, int source_index, pol { int next_index = source_index; - curr_effect = color_effect; - curr_effect->update_uniforms(); + set_curr_effect(color_effect); - // initial "Diffuse" texture is set in shaders::set_texture() or the result of shaders::ntsc_pass() + // initial "Diffuse" texture is set in shaders::ntsc_pass() if NTSC processing is enabled + if (!options->yiq_enable) + { + curr_effect->set_texture("Diffuse", diffuse_texture->get_finaltex()); + } + + curr_effect->update_uniforms(); + uint32_t tint = (uint32_t)poly->tint(); + float prim_tint[3] = { ((tint >> 16) & 0xff) / 255.0f, ((tint >> 8) & 0xff) / 255.0f, (tint & 0xff) / 255.0f }; + curr_effect->set_vector("PrimTint", 3, prim_tint); next_index = rt->next_index(next_index); blit(rt->source_surface[next_index], false, D3DPT_TRIANGLELIST, 0, 2); @@ -1127,7 +1256,7 @@ int shaders::prescale_pass(d3d_render_target *rt, int source_index, poly_info *p { int next_index = source_index; - curr_effect = prescale_effect; + set_curr_effect(filter_screens ? prescale_effect : prescale_point_effect); curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->source_texture[next_index]); @@ -1150,7 +1279,7 @@ int shaders::deconverge_pass(d3d_render_target *rt, int source_index, poly_info return next_index; } - curr_effect = deconverge_effect; + set_curr_effect(deconverge_effect); curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); @@ -1165,12 +1294,12 @@ int shaders::scanline_pass(d3d_render_target *rt, int source_index, poly_info *p int next_index = source_index; // skip scanline if alpha is 0 - if (options->scanline_alpha == 0.0f) - return next_index; + //if (options->scanline_alpha == 0.0f) + //return next_index; auto win = d3d->assert_window(); screen_device_enumerator screen_iterator(machine->root_device()); - screen_device *screen = screen_iterator.byindex(curr_screen); + screen_device *screen = screen_iterator.byindex(target_to_screen[curr_target]); render_container &screen_container = screen->container(); float xscale = 1.0f / screen_container.xscale(); float yscale = 1.0f / screen_container.yscale(); @@ -1179,7 +1308,7 @@ int shaders::scanline_pass(d3d_render_target *rt, int source_index, poly_info *p float screen_scale[] = { xscale, yscale }; float screen_offset[] = { xoffset, yoffset }; - curr_effect = scanline_effect; + set_curr_effect(scanline_effect); curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); curr_effect->set_vector("ScreenScale", 2, screen_scale); @@ -1202,7 +1331,7 @@ int shaders::defocus_pass(d3d_render_target *rt, int source_index, poly_info *po return next_index; } - curr_effect = focus_effect; + set_curr_effect(focus_effect); curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); @@ -1223,7 +1352,7 @@ int shaders::phosphor_pass(d3d_render_target *rt, int source_index, poly_info *p } // Shader needs time between last update - curr_effect = phosphor_effect; + set_curr_effect(phosphor_effect); curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); curr_effect->set_texture("LastPass", rt->cache_texture); @@ -1251,7 +1380,7 @@ int shaders::post_pass(d3d_render_target *rt, int source_index, poly_info *poly, auto win = d3d->assert_window(); screen_device_enumerator screen_iterator(machine->root_device()); - screen_device *screen = screen_iterator.byindex(curr_screen); + screen_device *screen = screen_iterator.byindex(target_to_screen[curr_target]); render_container &screen_container = screen->container(); float xscale = 1.0f / screen_container.xscale(); @@ -1270,7 +1399,7 @@ int shaders::post_pass(d3d_render_target *rt, int source_index, poly_info *poly, float(back_color_rgb.g()) / 255.0f, float(back_color_rgb.b()) / 255.0f }; - curr_effect = post_effect; + set_curr_effect(post_effect); curr_effect->update_uniforms(); curr_effect->set_texture("ShadowTexture", shadow_texture == nullptr ? nullptr : shadow_texture->get_finaltex()); curr_effect->set_int("ShadowTileMode", options->shadow_mask_tile_mode); @@ -1292,7 +1421,7 @@ int shaders::chroma_pass(d3d_render_target *rt, int source_index, poly_info *pol { int next_index = source_index; - curr_effect = chroma_effect; + set_curr_effect(chroma_effect); curr_effect->update_uniforms(); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); next_index = rt->next_index(next_index); @@ -1310,7 +1439,7 @@ int shaders::downsample_pass(d3d_render_target *rt, int source_index, poly_info return next_index; } - curr_effect = downsample_effect; + set_curr_effect(downsample_effect); curr_effect->update_uniforms(); for (int bloom_index = 0; bloom_index < rt->bloom_count; bloom_index++) @@ -1337,7 +1466,7 @@ int shaders::bloom_pass(d3d_render_target *rt, int source_index, poly_info *poly return next_index; } - curr_effect = bloom_effect; + set_curr_effect(bloom_effect); curr_effect->update_uniforms(); curr_effect->set_float("Level0Weight", options->bloom_level0_weight); @@ -1390,7 +1519,7 @@ int shaders::distortion_pass(d3d_render_target *rt, int source_index, poly_info return next_index; } - curr_effect = distortion_effect; + set_curr_effect(distortion_effect); curr_effect->update_uniforms(); curr_effect->set_texture("DiffuseTexture", rt->target_texture[next_index]); @@ -1404,7 +1533,7 @@ int shaders::vector_pass(d3d_render_target *rt, int source_index, poly_info *pol { int next_index = source_index; - curr_effect = vector_effect; + set_curr_effect(vector_effect); curr_effect->update_uniforms(); curr_effect->set_float("LengthRatio", options->vector_length_ratio); curr_effect->set_float("LengthScale", options->vector_length_scale); @@ -1420,14 +1549,13 @@ int shaders::vector_buffer_pass(d3d_render_target *rt, int source_index, poly_in { int next_index = source_index; - curr_effect = default_effect; + set_curr_effect(vector_buffer_effect); + curr_effect->set_texture("Diffuse", diffuse_texture->get_finaltex()); curr_effect->update_uniforms(); - curr_effect->set_technique("VectorBufferTechnique"); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); curr_effect->set_texture("LutTexture", lut_texture == nullptr ? nullptr : lut_texture->get_finaltex()); - // we need to clear the vector render target here next_index = rt->next_index(next_index); blit(rt->target_surface[next_index], true, D3DPT_TRIANGLELIST, 0, 2); @@ -1441,9 +1569,9 @@ int shaders::screen_pass(d3d_render_target *rt, int source_index, poly_info *pol d3d->set_blendmode(PRIMFLAG_GET_BLENDMODE(poly->flags())); - curr_effect = default_effect; + set_curr_effect(default_effect); + curr_effect->set_texture("Diffuse", diffuse_texture->get_finaltex()); curr_effect->update_uniforms(); - curr_effect->set_technique("ScreenTechnique"); curr_effect->set_texture("Diffuse", rt->target_texture[next_index]); curr_effect->set_texture("LutTexture", lut_texture == nullptr ? nullptr : lut_texture->get_finaltex()); @@ -1474,9 +1602,9 @@ void shaders::ui_pass(poly_info *poly, int vertnum) { d3d->set_blendmode(PRIMFLAG_GET_BLENDMODE(poly->flags())); - curr_effect = default_effect; + set_curr_effect(PRIMFLAG_GET_TEXWRAP(poly->flags()) ? ui_wrap_effect : ui_effect); + curr_effect->set_texture("Diffuse", diffuse_texture->get_finaltex()); curr_effect->update_uniforms(); - curr_effect->set_technique("UiTechnique"); curr_effect->set_texture("LutTexture", lut_texture == nullptr ? nullptr : ui_lut_texture->get_finaltex()); @@ -1508,9 +1636,9 @@ void shaders::render_quad(poly_info *poly, int vertnum) return; } - curr_screen = curr_screen < num_screens ? curr_screen : 0; + curr_target = curr_target < num_targets ? curr_target : 0; - curr_render_target = find_render_target(curr_texture->get_width(), curr_texture->get_height(), curr_screen); + curr_render_target = find_render_target(curr_texture->get_width(), curr_texture->get_height(), curr_target); d3d_render_target *rt = curr_render_target; if (rt == nullptr) @@ -1551,11 +1679,11 @@ void shaders::render_quad(poly_info *poly, int vertnum) curr_texture->increment_frame_count(); curr_texture->mask_frame_count(options->yiq_phase_count); - curr_screen++; + curr_target++; } else if (PRIMFLAG_GET_VECTOR(poly->flags())) { - curr_screen = curr_screen < num_screens ? curr_screen : 0; + curr_target = curr_target < num_targets ? curr_target : 0; int source_width = int(poly->prim_width() + 0.5f); int source_height = int(poly->prim_height() + 0.5f); @@ -1563,7 +1691,7 @@ void shaders::render_quad(poly_info *poly, int vertnum) { std::swap(source_width, source_height); } - curr_render_target = find_render_target(source_width, source_height, curr_screen); + curr_render_target = find_render_target(source_width, source_height, curr_target); d3d_render_target *rt = curr_render_target; if (rt == nullptr) @@ -1582,11 +1710,11 @@ void shaders::render_quad(poly_info *poly, int vertnum) osd_printf_verbose("Direct3D: Error %08lX during device SetRenderTarget call\n", result); } - curr_screen++; + curr_target++; } else if (PRIMFLAG_GET_VECTORBUF(poly->flags())) { - curr_screen = curr_screen < num_screens ? curr_screen : 0; + curr_target = curr_target < num_targets ? curr_target : 0; int source_width = int(poly->prim_width() + 0.5f); int source_height = int(poly->prim_height() + 0.5f); @@ -1594,7 +1722,7 @@ void shaders::render_quad(poly_info *poly, int vertnum) { std::swap(source_width, source_height); } - curr_render_target = find_render_target(source_width, source_height, curr_screen); + curr_render_target = find_render_target(source_width, source_height, curr_target); d3d_render_target *rt = curr_render_target; if (rt == nullptr) @@ -1629,7 +1757,7 @@ void shaders::render_quad(poly_info *poly, int vertnum) next_index = screen_pass(rt, next_index, poly, vertnum); d3d->set_wrap(PRIMFLAG_GET_TEXWRAP(curr_texture->get_flags()) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP); - curr_screen++; + curr_target++; } else { @@ -1795,16 +1923,6 @@ bool shaders::add_render_target(renderer_d3d9* d3d, render_primitive *prim, int } -//============================================================ -// shaders::enumerate_screens -//============================================================ -void shaders::enumerate_screens() -{ - screen_device_enumerator iter(machine->root_device()); - num_screens = iter.count(); -} - - //============================================================ // shaders::create_texture_target //============================================================ @@ -1863,89 +1981,54 @@ void shaders::delete_resources() m_render_target_list.clear(); - if (downsample_effect != nullptr) - { - delete downsample_effect; - downsample_effect = nullptr; - } - if (bloom_effect != nullptr) - { - delete bloom_effect; - bloom_effect = nullptr; - } - if (vector_effect != nullptr) - { - delete vector_effect; - vector_effect = nullptr; - } - if (default_effect != nullptr) - { - delete default_effect; - default_effect = nullptr; - } - if (post_effect != nullptr) - { - delete post_effect; - post_effect = nullptr; - } - if (distortion_effect != nullptr) - { - delete distortion_effect; - distortion_effect = nullptr; - } - if (prescale_effect != nullptr) - { - delete prescale_effect; - prescale_effect = nullptr; - } - if (phosphor_effect != nullptr) - { - delete phosphor_effect; - phosphor_effect = nullptr; - } - if (focus_effect != nullptr) - { - delete focus_effect; - focus_effect = nullptr; - } - if (scanline_effect != nullptr) - { - delete scanline_effect; - scanline_effect = nullptr; - } - if (deconverge_effect != nullptr) - { - delete deconverge_effect; - deconverge_effect = nullptr; - } - if (color_effect != nullptr) - { - delete color_effect; - color_effect = nullptr; - } - if (ntsc_effect != nullptr) - { - delete ntsc_effect; - ntsc_effect = nullptr; - } - if (chroma_effect != nullptr) - { - delete chroma_effect; - chroma_effect = nullptr; - } + delete downsample_effect; + delete bloom_effect; + delete vector_effect; + delete default_effect; + delete ui_effect; + delete vector_buffer_effect; + delete post_effect; + delete distortion_effect; + delete prescale_effect; + delete prescale_point_effect; + delete phosphor_effect; + delete focus_effect; + delete scanline_effect; + delete deconverge_effect; + delete color_effect; + delete ntsc_effect; + delete chroma_effect; - if (backbuffer != nullptr) + downsample_effect = nullptr; + bloom_effect = nullptr; + vector_effect = nullptr; + default_effect = nullptr; + ui_effect = nullptr; + vector_buffer_effect = nullptr; + post_effect = nullptr; + distortion_effect = nullptr; + prescale_effect = nullptr; + prescale_point_effect = nullptr; + phosphor_effect = nullptr; + focus_effect = nullptr; + scanline_effect = nullptr; + deconverge_effect = nullptr; + color_effect = nullptr; + ntsc_effect = nullptr; + chroma_effect = nullptr; + + if (backbuffer) { backbuffer->Release(); backbuffer = nullptr; } - if (black_surface != nullptr) + if (black_surface) { black_surface->Release(); black_surface = nullptr; } - if (black_texture != nullptr) + if (black_texture) { black_texture->Release(); black_texture = nullptr; @@ -2684,12 +2767,14 @@ void uniform::update() //============================================================ effect::effect(shaders *shadersys, IDirect3DDevice9 *dev, const char *name, const char *path) + : m_effect(nullptr) + , m_shaders(shadersys) + , m_num_passes(0) + , m_valid(false) + , m_active(false) { LPD3DXBUFFER buffer_errors = nullptr; - m_shaders = shadersys; - m_valid = false; - char name_cstr[1024]; sprintf(name_cstr, "%s\\%s", path, name); auto effect_name = osd::text::to_tstring(name_cstr); @@ -2716,6 +2801,12 @@ effect::effect(shaders *shadersys, IDirect3DDevice9 *dev, const char *name, cons effect::~effect() { m_effect->Release(); + + m_vecs.clear(); + m_floats.clear(); + m_ints.clear(); + m_bools.clear(); + m_textures.clear(); } void effect::add_uniform(const char *name, uniform::uniform_type type, int id) @@ -2729,24 +2820,19 @@ void effect::update_uniforms() (*uniform).update(); } -void effect::begin(UINT *passes, DWORD flags) +void effect::begin(DWORD flags) { - m_effect->Begin(passes, flags); + m_active = true; + m_num_passes = 0; + m_effect->Begin(&m_num_passes, flags); + m_effect->BeginPass(0); } void effect::end() { - m_effect->End(); -} - -void effect::begin_pass(UINT pass) -{ - m_effect->BeginPass(pass); -} - -void effect::end_pass() -{ + m_active = false; m_effect->EndPass(); + m_effect->End(); } void effect::set_technique(const char *name) @@ -2756,48 +2842,97 @@ void effect::set_technique(const char *name) void effect::set_vector(D3DXHANDLE param, int count, float *vector) { - static D3DXVECTOR4 out_vector; - if (count > 0) + count = std::min(count, 4); + + auto iter = m_vecs.find(param); + if (iter != m_vecs.end()) { - out_vector.x = vector[0]; + D3DXVECTOR4 &data = iter->second; + if (!memcmp((float *)data, vector, sizeof(float) * count)) + { + return; + } + memcpy(data, vector, sizeof(float) * count); + m_effect->SetVector(param, &iter->second); } - if (count > 1) + else { - out_vector.y = vector[1]; + D3DXVECTOR4 vec; + memcpy((float *)vec, vector, sizeof(float) * count); + m_effect->SetVector(param, &vec); + m_vecs[param] = vec; } - if (count > 2) - { - out_vector.z = vector[2]; - } - if (count > 3) - { - out_vector.w = vector[3]; - } - m_effect->SetVector(param, &out_vector); } void effect::set_float(D3DXHANDLE param, float value) { + auto iter = m_floats.find(param); + if (iter != m_floats.end()) + { + if (iter->second == value) + { + return; + } + iter->second = value; + } + else + { + m_floats[param] = value; + } m_effect->SetFloat(param, value); } void effect::set_int(D3DXHANDLE param, int value) { + auto iter = m_ints.find(param); + if (iter != m_ints.end()) + { + if (iter->second == value) + { + return; + } + iter->second = value; + } + else + { + m_ints[param] = value; + } m_effect->SetInt(param, value); } void effect::set_bool(D3DXHANDLE param, bool value) { + auto iter = m_bools.find(param); + if (iter != m_bools.end()) + { + if (iter->second == value) + { + return; + } + iter->second = value; + } + else + { + m_bools[param] = value; + } m_effect->SetBool(param, value); } -void effect::set_matrix(D3DXHANDLE param, D3DXMATRIX *matrix) -{ - m_effect->SetMatrix(param, matrix); -} - void effect::set_texture(D3DXHANDLE param, IDirect3DTexture9 *tex) { + auto iter = m_textures.find(param); + if (iter != m_textures.end()) + { + if (iter->second == (void *)tex) + { + return; + } + iter->second = (void *)tex; + } + else + { + m_textures[param] = (void *)tex; + } m_effect->SetTexture(param, tex); } diff --git a/src/osd/modules/render/d3d/d3dhlsl.h b/src/osd/modules/render/d3d/d3dhlsl.h index f72197cb7b1..aa990e3c30c 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.h +++ b/src/osd/modules/render/d3d/d3dhlsl.h @@ -9,11 +9,13 @@ #ifndef __WIN_D3DHLSL__ #define __WIN_D3DHLSL__ -#include #include "../frontend/mame/ui/menuitem.h" #include "../frontend/mame/ui/slider.h" #include "modules/lib/osdlib.h" +#include +#include + //============================================================ // TYPE DEFINITIONS //============================================================ @@ -133,11 +135,8 @@ public: effect(shaders *shadersys, IDirect3DDevice9 *dev, const char *name, const char *path); ~effect(); - void begin(UINT *passes, DWORD flags); - void begin_pass(UINT pass); - + void begin(DWORD flags); void end(); - void end_pass(); void set_technique(const char *name); @@ -145,7 +144,6 @@ public: void set_float(D3DXHANDLE param, float value); void set_int(D3DXHANDLE param, int value); void set_bool(D3DXHANDLE param, bool value); - void set_matrix(D3DXHANDLE param, D3DXMATRIX *matrix); void set_texture(D3DXHANDLE param, IDirect3DTexture9 *tex); void add_uniform(const char *name, uniform::uniform_type type, int id); @@ -154,16 +152,26 @@ public: D3DXHANDLE get_parameter(D3DXHANDLE param, const char *name); shaders* get_shaders() { return m_shaders; } + uint32_t num_passes() { return m_num_passes; } bool is_valid() { return m_valid; } + bool is_active() { return m_active; } private: std::vector> m_uniform_list; ID3DXEffect *m_effect; shaders *m_shaders; + uint32_t m_num_passes; + + std::map m_vecs; + std::map m_floats; + std::map m_ints; + std::map m_bools; + std::map m_textures; bool m_valid; + bool m_active; }; class d3d_render_target; @@ -305,6 +313,9 @@ public: bool enabled() { return post_fx_enable && d3dintf->post_fx_available; } void toggle() { post_fx_enable = initialized && !post_fx_enable; } + void begin_frame(render_primitive_list *primlist); + void end_frame(); + void begin_draw(); void end_draw(); @@ -323,6 +334,7 @@ public: void init_fsfx_quad(); void set_texture(texture_info *info); + void set_filter(bool filter_screens); void remove_render_target(int source_width, int source_height, uint32_t screen_index); void remove_render_target(d3d_render_target *rt); @@ -336,8 +348,8 @@ public: void *get_slider_option(int id, int index = 0); private: + void set_curr_effect(effect *curr_effect); void blit(IDirect3DSurface9 *dst, bool clear_dst, D3DPRIMITIVETYPE prim_type, uint32_t prim_index, uint32_t prim_count); - void enumerate_screens(); void render_snapshot(IDirect3DSurface9 *surface); // Time since last call, only updates once per render of all screens @@ -372,7 +384,10 @@ private: bool post_fx_enable; // overall enable flag bool oversampling_enable; // oversampling enable flag int num_screens; // number of emulated physical screens - int curr_screen; // current screen for render target operations + int num_targets; // number of emulated screen targets (can be different from above; cf. artwork and Laserdisc games) + int curr_target; // current target index for render target operations + int targets_per_screen[256]; // screen target count per screen device/container index; estimated maximum count for array size + int target_to_screen[256]; // lookup from target index to screen device/container index; estimated maximum count for array size double acc_t; // accumulated machine time double delta_t; // data for delta_time bitmap_argb32 shadow_bitmap; // shadow mask bitmap for post-processing shader @@ -403,7 +418,11 @@ private: IDirect3DSurface9 * backbuffer; // pointer to our device's backbuffer effect * curr_effect; // pointer to the currently active effect object effect * default_effect; // pointer to the primary-effect object + effect * ui_effect; // pointer to the UI-element effect object + effect * ui_wrap_effect; // pointer to the UI-element effect object with texture wrapping + effect * vector_buffer_effect; // pointer to the vector-buffering effect object effect * prescale_effect; // pointer to the prescale-effect object + effect * prescale_point_effect; // pointer to the prescale-effect object with point filtering effect * post_effect; // pointer to the post-effect object effect * distortion_effect; // pointer to the distortion-effect object effect * scanline_effect; @@ -417,6 +436,8 @@ private: effect * vector_effect; // pointer to the vector-effect object effect * chroma_effect; + texture_info * diffuse_texture; + bool filter_screens; texture_info * curr_texture; d3d_render_target * curr_render_target; poly_info * curr_poly; diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index 11801fd800d..d42f4739d26 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -90,6 +90,7 @@ uint32_t renderer_bgfx::s_current_view = 0; bool renderer_bgfx::s_bgfx_library_initialized = false; uint32_t renderer_bgfx::s_width[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; uint32_t renderer_bgfx::s_height[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +uint32_t renderer_bgfx::s_max_texture_size = 16384; // Relatively safe default on modern GPUs //============================================================ // renderer_bgfx - constructor @@ -108,6 +109,8 @@ renderer_bgfx::renderer_bgfx(std::shared_ptr w) , m_chains(nullptr) , m_ortho_view(nullptr) , m_max_view(0) + , m_view_width(1) + , m_view_height(1) , m_avi_view(nullptr) , m_avi_writer(nullptr) , m_avi_target(nullptr) @@ -207,6 +210,9 @@ void renderer_bgfx::init_bgfx_library() bool bgfx_debug = m_options.bgfx_debug(); bgfx::setDebug(bgfx_debug ? BGFX_DEBUG_STATS : BGFX_DEBUG_TEXT); + const bgfx::Caps* caps = bgfx::getCaps(); + s_max_texture_size = caps->limits.maxTextureSize; + ScreenVertex::init(); imguiCreate(); @@ -297,8 +303,10 @@ int renderer_bgfx::create() { std::shared_ptr win = assert_window(); osd_dim wdim = win->get_size(); - s_width[win->index()] = wdim.width(); - s_height[win->index()] = wdim.height(); + const uint32_t width = wdim.width(); + const uint32_t height = wdim.height(); + s_width[win->index()] = width; + s_height[win->index()] = height; m_dimensions = wdim; if (s_bgfx_library_initialized) @@ -350,11 +358,12 @@ int renderer_bgfx::create() m_ortho_view->set_backbuffer(m_framebuffer); } - m_chains = new chain_manager(win->machine(), m_options, *m_textures, *m_targets, *m_effects, win->index(), *this); + const uint32_t max_prescale_size = std::min(2u * std::max(width, height), s_max_texture_size); + m_chains = new chain_manager(win->machine(), m_options, *m_textures, *m_targets, *m_effects, win->index(), *this, win->prescale(), max_prescale_size); m_sliders_dirty = true; uint32_t flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_MIP_POINT; - m_texture_cache = m_textures->create_texture("#cache", bgfx::TextureFormat::BGRA8, CACHE_SIZE, CACHE_SIZE, nullptr, flags); + m_texture_cache = m_textures->create_texture("#cache", bgfx::TextureFormat::BGRA8, CACHE_SIZE, 0, CACHE_SIZE, nullptr, flags); memset(m_white, 0xff, sizeof(uint32_t) * 16 * 16); m_texinfo.push_back(rectangle_packer::packable_rectangle(WHITE_HASH, PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32), 16, 16, 16, nullptr, m_white)); @@ -402,7 +411,7 @@ void renderer_bgfx::record() else { m_avi_writer->record(m_options.bgfx_avi_name()); - m_avi_target = m_targets->create_target("avibuffer", bgfx::TextureFormat::BGRA8, s_width[0], s_height[0], TARGET_STYLE_CUSTOM, false, true, 1, 0); + m_avi_target = m_targets->create_target("avibuffer", bgfx::TextureFormat::BGRA8, s_width[0], s_height[0], 1, 1, TARGET_STYLE_CUSTOM, false, true, 1, 0); m_avi_texture = bgfx::createTexture2D(s_width[0], s_height[0], false, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_BLIT_DST | BGFX_TEXTURE_READ_BACK); if (m_avi_view == nullptr) @@ -491,15 +500,6 @@ void renderer_bgfx::put_packed_quad(render_primitive *prim, uint32_t hash, Scree float u[4] = { u0, u1, u0, u1 }; float v[4] = { v0, v0, v1, v1 }; - if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) - { - for (int i = 0; i < 4; i++) - { - u[i] += 0.5f / size; - v[i] += 0.5f / size; - } - } - if (PRIMFLAG_GET_TEXORIENT(prim->flags) & ORIENTATION_SWAP_XY) { std::swap(u[1], u[2]); @@ -540,7 +540,7 @@ void renderer_bgfx::vertex(ScreenVertex* vertex, float x, float y, float z, uint vertex->m_v = v; } -void renderer_bgfx::render_post_screen_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int32_t screen) +void renderer_bgfx::render_post_screen_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int32_t screen, int window_index) { auto* vertices = reinterpret_cast(buffer->data); @@ -565,6 +565,15 @@ void renderer_bgfx::render_post_screen_quad(int view, render_primitive* prim, bg uint32_t blend = PRIMFLAG_GET_BLENDMODE(prim->flags); bgfx::setVertexBuffer(0,buffer); bgfx::setTexture(0, m_screen_effect[blend]->uniform("s_tex")->handle(), m_targets->target(screen, "output")->texture(), texture_flags); + + bgfx_uniform* inv_view_dims = m_screen_effect[blend]->uniform("u_inv_view_dims"); + if (inv_view_dims) + { + float values[2] = { -1.0f / s_width[window_index], 1.0f / s_height[window_index] }; + inv_view_dims->set(values, sizeof(float) * 2); + inv_view_dims->upload(); + } + m_screen_effect[blend]->submit(m_ortho_view->get_index()); } @@ -574,7 +583,7 @@ void renderer_bgfx::render_avi_quad() m_avi_view->setup(); bgfx::setViewRect(s_current_view, 0, 0, s_width[0], s_height[0]); - bgfx::setViewClear(s_current_view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x00000000, 1.0f, 0); + bgfx::setViewClear(s_current_view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x000000ff, 1.0f, 0); bgfx::TransientVertexBuffer buffer; bgfx::allocTransientVertexBuffer(&buffer, 6, ScreenVertex::ms_decl); @@ -595,11 +604,21 @@ void renderer_bgfx::render_avi_quad() bgfx::setVertexBuffer(0,&buffer); bgfx::setTexture(0, m_gui_effect[PRIMFLAG_GET_BLENDMODE(BLENDMODE_NONE)]->uniform("s_tex")->handle(), m_avi_target->texture()); - m_gui_effect[PRIMFLAG_GET_BLENDMODE(BLENDMODE_NONE)]->submit(s_current_view); + + bgfx_effect* effect = m_gui_effect[PRIMFLAG_GET_BLENDMODE(BLENDMODE_NONE)]; + bgfx_uniform* inv_view_dims = effect->uniform("u_inv_view_dims"); + if (inv_view_dims) + { + float values[2] = { -1.0f / s_width[0], 1.0f / s_height[0] }; + inv_view_dims->set(values, sizeof(float) * 2); + inv_view_dims->upload(); + } + + effect->submit(s_current_view); s_current_view++; } -void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::TransientVertexBuffer* buffer) +void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int window_index) { auto* vertices = reinterpret_cast(buffer->data); uint32_t rgba = u32Color(prim->color.r * 255, prim->color.g * 255, prim->color.b * 255, prim->color.a * 255); @@ -636,7 +655,7 @@ void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::Transient else { texture = m_textures->create_or_update_mame_texture(prim->flags & PRIMFLAG_TEXFORMAT_MASK - , tex_width, tex_height, prim->texture.rowpixels, prim->texture.palette, prim->texture.base, prim->texture.seqid + , tex_width, prim->texture.width_margin, tex_height, prim->texture.rowpixels, prim->texture.palette, prim->texture.base, prim->texture.seqid , texture_flags, prim->texture.unique_id, prim->texture.old_id); } @@ -645,6 +664,15 @@ void renderer_bgfx::render_textured_quad(render_primitive* prim, bgfx::Transient uint32_t blend = PRIMFLAG_GET_BLENDMODE(prim->flags); bgfx::setVertexBuffer(0,buffer); bgfx::setTexture(0, effects[blend]->uniform("s_tex")->handle(), texture); + + bgfx_uniform* inv_view_dims = effects[blend]->uniform("u_inv_view_dims"); + if (inv_view_dims) + { + float values[2] = { -1.0f / s_width[window_index], 1.0f / s_height[window_index] }; + inv_view_dims->set(values, sizeof(float) * 2); + inv_view_dims->upload(); + } + effects[blend]->submit(m_ortho_view->get_index()); if (is_screen) @@ -950,12 +978,21 @@ int renderer_bgfx::draw(int update) } } - buffer_status status = buffer_primitives(atlas_valid, &prim, &buffer, screen); + buffer_status status = buffer_primitives(atlas_valid, &prim, &buffer, screen, window_index); if (status != BUFFER_EMPTY && status != BUFFER_SCREEN) { - bgfx::setVertexBuffer(0,&buffer); + bgfx::setVertexBuffer(0, &buffer); bgfx::setTexture(0, m_gui_effect[blend]->uniform("s_tex")->handle(), m_texture_cache->texture()); + + bgfx_uniform* inv_view_dims = m_gui_effect[blend]->uniform("u_inv_view_dims"); + if (inv_view_dims) + { + float values[2] = { -1.0f / s_width[window_index], 1.0f / s_height[window_index] }; + inv_view_dims->set(values, sizeof(float) * 2); + inv_view_dims->upload(); + } + m_gui_effect[blend]->submit(m_ortho_view->get_index()); } @@ -1050,7 +1087,7 @@ bool renderer_bgfx::update_dimensions() bgfx::setViewFrameBuffer(s_current_view, m_framebuffer->target()); } - bgfx::setViewClear(s_current_view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x00000000, 1.0f, 0); + bgfx::setViewClear(s_current_view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x000000ff, 1.0f, 0); bgfx::setViewMode(s_current_view, bgfx::ViewMode::Sequential); bgfx::touch(s_current_view); bgfx::frame(); @@ -1098,7 +1135,7 @@ render_primitive_list *renderer_bgfx::get_primitives() return &win->target()->get_primitives(); } -renderer_bgfx::buffer_status renderer_bgfx::buffer_primitives(bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer, int32_t screen) +renderer_bgfx::buffer_status renderer_bgfx::buffer_primitives(bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer, int32_t screen, int window_index) { int vertices = 0; @@ -1140,18 +1177,18 @@ renderer_bgfx::buffer_status renderer_bgfx::buffer_primitives(bool atlas_valid, { #if SCENE_VIEW setup_view(s_current_view, true); - render_post_screen_quad(s_current_view, *prim, buffer, screen); + render_post_screen_quad(s_current_view, *prim, buffer, screen, window_index); s_current_view++; #else setup_ortho_view(); - render_post_screen_quad(m_ortho_view->get_index(), *prim, buffer, screen); + render_post_screen_quad(m_ortho_view->get_index(), *prim, buffer, screen, window_index); #endif return BUFFER_SCREEN; } else { setup_ortho_view(); - render_textured_quad(*prim, buffer); + render_textured_quad(*prim, buffer, window_index); return BUFFER_EMPTY; } } @@ -1232,7 +1269,7 @@ void renderer_bgfx::process_atlas_packs(std::vectortexture(), 0, 0, rect.x(), rect.y(), (rect.width() * width_mul_factor) / width_div_factor, rect.height(), mem, pitch); } } @@ -1285,8 +1322,7 @@ bool renderer_bgfx::check_for_dirty_atlas() atlas_dirty = true; m_texinfo.push_back(rectangle_packer::packable_rectangle(hash, prim.flags & PRIMFLAG_TEXFORMAT_MASK, - prim.texture.width, prim.texture.height, - prim.texture.rowpixels, prim.texture.palette, prim.texture.base)); + prim.texture.width, prim.texture.height, prim.texture.rowpixels, prim.texture.palette, prim.texture.base)); acquired_infos[hash] = m_texinfo[m_texinfo.size() - 1]; } } diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h index bdc3e894ebd..15b0d6e158b 100644 --- a/src/osd/modules/render/drawbgfx.h +++ b/src/osd/modules/render/drawbgfx.h @@ -84,10 +84,10 @@ private: void setup_ortho_view(); void allocate_buffer(render_primitive *prim, uint32_t blend, bgfx::TransientVertexBuffer *buffer); - buffer_status buffer_primitives(bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer, int32_t screen); + buffer_status buffer_primitives(bool atlas_valid, render_primitive** prim, bgfx::TransientVertexBuffer* buffer, int32_t screen, int window_index); - void render_textured_quad(render_primitive* prim, bgfx::TransientVertexBuffer* buffer); - void render_post_screen_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int32_t screen); + void render_textured_quad(render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int window_index); + void render_post_screen_quad(int view, render_primitive* prim, bgfx::TransientVertexBuffer* buffer, int32_t screen, int window_index); void put_packed_quad(render_primitive *prim, uint32_t hash, ScreenVertex* vertex); void put_packed_line(render_primitive *prim, ScreenVertex* vertex); @@ -132,6 +132,8 @@ private: uint32_t m_white[16*16]; bgfx_view *m_ortho_view; uint32_t m_max_view; + uint16_t m_view_width; + uint16_t m_view_height; bgfx_view *m_avi_view; avi_write *m_avi_writer; @@ -149,6 +151,7 @@ private: static bool s_bgfx_library_initialized; static uint32_t s_width[16]; static uint32_t s_height[16]; + static uint32_t s_max_texture_size; }; #endif // MAME_RENDER_DRAWBGFX_H diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index c594e330e10..f9f03d9efc0 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -242,7 +242,12 @@ int renderer_d3d9::draw(const int update) return check; begin_frame(); + + // reset blend mode + set_blendmode(BLENDMODE_NONE); + process_primitives(); + end_frame(); return 0; @@ -254,8 +259,12 @@ void renderer_d3d9::set_texture(texture_info *texture) { m_last_texture = texture; m_last_texture_flags = (texture == nullptr ? 0 : texture->get_flags()); + if (m_shaders->enabled()) + { + m_shaders->set_texture(texture); + } + HRESULT result = m_device->SetTexture(0, (texture == nullptr) ? get_default_texture()->get_finaltex() : texture->get_finaltex()); - m_shaders->set_texture(texture); if (FAILED(result)) osd_printf_verbose("Direct3D: Error %08lX during device set_texture call\n", result); } @@ -353,15 +362,20 @@ void renderer_d3d9::set_blendmode(int blendmode) } // adjust the bits that changed + bool new_blend_enable = false; if (blendenable != m_last_blendenable) { m_last_blendenable = blendenable; + if (blendenable) + { + new_blend_enable = true; + } HRESULT result = m_device->SetRenderState(D3DRS_ALPHABLENDENABLE, blendenable); if (FAILED(result)) osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result); } - if (blendop != m_last_blendop) + if (blendop != m_last_blendop || new_blend_enable) { m_last_blendop = blendop; HRESULT result = m_device->SetRenderState(D3DRS_BLENDOP, blendop); @@ -369,7 +383,7 @@ void renderer_d3d9::set_blendmode(int blendmode) osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result); } - if (blendsrc != m_last_blendsrc) + if (blendsrc != m_last_blendsrc || new_blend_enable) { m_last_blendsrc = blendsrc; HRESULT result = m_device->SetRenderState(D3DRS_SRCBLEND, blendsrc); @@ -377,7 +391,7 @@ void renderer_d3d9::set_blendmode(int blendmode) osd_printf_verbose("Direct3D: Error %08lX during device SetRenderState call\n", result); } - if (blenddst != m_last_blenddst) + if (blenddst != m_last_blenddst || new_blend_enable) { m_last_blenddst = blenddst; HRESULT result = m_device->SetRenderState(D3DRS_DESTBLEND, blenddst); @@ -652,7 +666,7 @@ void renderer_d3d9::begin_frame() { auto win = assert_window(); - HRESULT result = m_device->Clear(0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0); + HRESULT result = m_device->Clear(0, nullptr, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0xff,0,0,0), 0, 0); if (FAILED(result)) osd_printf_verbose("Direct3D: Error %08lX during device clear call\n", result); @@ -667,7 +681,7 @@ void renderer_d3d9::begin_frame() osd_printf_verbose("Direct3D: Error %08lX during device BeginScene call\n", result); if (m_shaders->enabled()) - m_shaders->init_fsfx_quad(); + m_shaders->begin_frame(win->m_primlist); } void renderer_d3d9::process_primitives() @@ -723,6 +737,9 @@ void renderer_d3d9::end_frame() // flush any pending polygons primitive_flush_pending(); + if (m_shaders->enabled()) + m_shaders->end_frame(); + // finish the scene HRESULT result = m_device->EndScene(); if (FAILED(result)) @@ -1412,6 +1429,7 @@ void renderer_d3d9::batch_vectors(int vector_count) int triangle_count = vector_count * 2; m_vectorbatch = mesh_alloc(vertex_count); m_batchindex = 0; + uint32_t tint = 0xffffffff; uint32_t cached_flags = 0; for (render_primitive &prim : *win->m_primlist) @@ -1423,6 +1441,12 @@ void renderer_d3d9::batch_vectors(int vector_count) { batch_vector(prim); cached_flags = prim.flags; + + const uint8_t a = (uint8_t)std::round(prim.color.a * 255); + const uint8_t r = (uint8_t)std::round(prim.color.r * 255); + const uint8_t g = (uint8_t)std::round(prim.color.g * 255); + const uint8_t b = (uint8_t)std::round(prim.color.b * 255); + tint = (a << 24) | (b << 16) | (g << 8) | r; } break; @@ -1433,6 +1457,12 @@ void renderer_d3d9::batch_vectors(int vector_count) quad_height = prim.get_quad_height(); target_width = prim.get_full_quad_width(); target_height = prim.get_full_quad_height(); + + const uint8_t a = (uint8_t)std::round(prim.color.a * 255); + const uint8_t r = (uint8_t)std::round(prim.color.r * 255); + const uint8_t g = (uint8_t)std::round(prim.color.g * 255); + const uint8_t b = (uint8_t)std::round(prim.color.b * 255); + tint = (a << 24) | (b << 16) | (g << 8) | r; } break; @@ -1510,7 +1540,7 @@ void renderer_d3d9::batch_vectors(int vector_count) } // now add a polygon entry - m_poly[m_numpolys].init(D3DPT_TRIANGLELIST, triangle_count, vertex_count, cached_flags, nullptr, D3DTOP_MODULATE, quad_width, quad_height); + m_poly[m_numpolys].init(D3DPT_TRIANGLELIST, triangle_count, vertex_count, cached_flags, nullptr, D3DTOP_MODULATE, quad_width, quad_height, tint); m_numpolys++; } @@ -1652,10 +1682,10 @@ void renderer_d3d9::draw_line(const render_primitive &prim) vertex[3].v0 = stop.c.y; // determine the color of the line - auto r = (int32_t)(prim.color.r * 255.0f); - auto g = (int32_t)(prim.color.g * 255.0f); - auto b = (int32_t)(prim.color.b * 255.0f); - auto a = (int32_t)(prim.color.a * 255.0f); + auto r = (int32_t)std::round(prim.color.r * 255.0f); + auto g = (int32_t)std::round(prim.color.g * 255.0f); + auto b = (int32_t)std::round(prim.color.b * 255.0f); + auto a = (int32_t)std::round(prim.color.a * 255.0f); DWORD color = D3DCOLOR_ARGB(a, r, g, b); // set the color, Z parameters to standard values @@ -1667,7 +1697,7 @@ void renderer_d3d9::draw_line(const render_primitive &prim) } // now add a polygon entry - m_poly[m_numpolys].init(D3DPT_TRIANGLESTRIP, 2, 4, prim.flags, nullptr, D3DTOP_MODULATE, 0.0f, 0.0f); + m_poly[m_numpolys].init(D3DPT_TRIANGLESTRIP, 2, 4, prim.flags, nullptr, D3DTOP_MODULATE, 0.0f, 0.0f, (uint32_t)color); m_numpolys++; } @@ -1721,10 +1751,10 @@ void renderer_d3d9::draw_quad(const render_primitive &prim) } // determine the color, allowing for over modulation - auto r = (int32_t)(prim.color.r * 255.0f); - auto g = (int32_t)(prim.color.g * 255.0f); - auto b = (int32_t)(prim.color.b * 255.0f); - auto a = (int32_t)(prim.color.a * 255.0f); + auto r = (int32_t)std::round(prim.color.r * 255.0f); + auto g = (int32_t)std::round(prim.color.g * 255.0f); + auto b = (int32_t)std::round(prim.color.b * 255.0f); + auto a = (int32_t)std::round(prim.color.a * 255.0f); DWORD color = D3DCOLOR_ARGB(a, r, g, b); // adjust half pixel X/Y offset, set the color, Z parameters to standard values @@ -1738,7 +1768,7 @@ void renderer_d3d9::draw_quad(const render_primitive &prim) } // now add a polygon entry - m_poly[m_numpolys].init(D3DPT_TRIANGLESTRIP, 2, 4, prim.flags, texture, D3DTOP_MODULATE, quad_width, quad_height); + m_poly[m_numpolys].init(D3DPT_TRIANGLESTRIP, 2, 4, prim.flags, texture, D3DTOP_MODULATE, quad_width, quad_height, (uint32_t)color); m_numpolys++; } @@ -1826,9 +1856,17 @@ void renderer_d3d9::primitive_flush_pending() newfilter = FALSE; if (PRIMFLAG_GET_SCREENTEX(flags)) newfilter = video_config.filter; - set_filter(newfilter); - set_wrap(PRIMFLAG_GET_TEXWRAP(flags) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP); - set_modmode(m_poly[polynum].modmode()); + + if (m_shaders->enabled()) + { + m_shaders->set_filter(newfilter); + } + else + { + set_filter(newfilter); + set_wrap(PRIMFLAG_GET_TEXWRAP(flags) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP); + set_modmode(m_poly[polynum].modmode()); + } } if (vertnum + m_poly[polynum].numverts() > m_numverts) @@ -1841,9 +1879,6 @@ void renderer_d3d9::primitive_flush_pending() if(m_shaders->enabled()) { - // reset blend mode (handled by shader passes) - set_blendmode(BLENDMODE_NONE); - m_shaders->render_quad(&m_poly[polynum], vertnum); } else