Skip to content

Commit e89eb3e

Browse files
authored
BGFX and D3D9 renderer fixes for issues #11104, #11106, and #11107 (#11249)
* -hlsl.json: Removed duplicate scanline_variation setting. (#11107) [Ryan Holtz] * -d3dhlsl.cpp: Fixed lack of post-pass application when bloom is disabled. (#11104) [Ryan Holtz] * -drawd3d.cpp: Always set a default texture at scene start. (#11106) [Ryan Holtz]
1 parent b761e23 commit e89eb3e

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

bgfx/chains/hlsl.json

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
{ "type": "float", "name": "scanline_bright_scale", "text": "Scanline Brightness Scale", "default": 2.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
9494
{ "type": "float", "name": "scanline_bright_offset", "text": "Scanline Brightness Offset", "default": 1.50, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
9595
{ "type": "float", "name": "scanline_jitter_amount", "text": "Scanline Jitter Amount", "default": 0.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
96-
{ "type": "float", "name": "scanline_variation", "text": "Scanline Variation", "default": 1.00, "max": 4.00, "min": 0.0, "step": 0.01, "format": "%1.2f", "screen": "crt" },
9796

9897
{ "type": "intenum", "name": "shadow_tile_mode", "text": "Shadow Mask Tile Mode", "default": 0, "max": 1, "min": 0, "step": 1, "format": "%s", "screen": "any", "strings": [ "Screen", "Source" ] },
9998
{ "type": "float", "name": "shadow_alpha", "text": "Shadow Mask Amount", "default": 0.50, "max": 1.00, "min": 0.00, "step": 0.01, "format": "%1.2f", "screen": "crt" },

src/osd/modules/render/d3d/d3dhlsl.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -1570,12 +1570,16 @@ void shaders::render_quad(poly_info *poly, int vertnum)
15701570
//next_index = phosphor_pass(rt, next_index, poly, vertnum);
15711571

15721572
// create bloom textures
1573-
int old_index = next_index;
1574-
next_index = post_pass(rt, next_index, poly, vertnum, true);
1575-
next_index = downsample_pass(rt, next_index, poly, vertnum);
1573+
bool bloom_enabled = (options->bloom_scale > 0.0f);
1574+
if (bloom_enabled)
1575+
{
1576+
int old_index = next_index;
1577+
next_index = post_pass(rt, next_index, poly, vertnum, true);
1578+
next_index = downsample_pass(rt, next_index, poly, vertnum);
1579+
next_index = old_index;
1580+
}
15761581

1577-
// apply bloom textures
1578-
next_index = old_index;
1582+
// apply bloom textures (if enabled) and other post effects
15791583
next_index = post_pass(rt, next_index, poly, vertnum, false);
15801584
next_index = bloom_pass(rt, next_index, poly, vertnum);
15811585
next_index = phosphor_pass(rt, next_index, poly, vertnum);

src/osd/modules/render/drawd3d.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,9 @@ void renderer_d3d9::begin_frame()
755755

756756
if (m_shaders->enabled())
757757
m_shaders->begin_frame(window().m_primlist);
758+
759+
// set an initial default texture
760+
set_texture(nullptr);
758761
}
759762

760763
void renderer_d3d9::process_primitives()

0 commit comments

Comments
 (0)