Skip to content

Commit

Permalink
BGFX and D3D9 renderer fixes for issues mamedev#11104, mamedev#11106,…
Browse files Browse the repository at this point in the history
… and mamedev#11107 (mamedev#11249)

* -hlsl.json: Removed duplicate scanline_variation setting. (mamedev#11107) [Ryan Holtz]
* -d3dhlsl.cpp: Fixed lack of post-pass application when bloom is disabled. (mamedev#11104) [Ryan Holtz]
* -drawd3d.cpp: Always set a default texture at scene start. (mamedev#11106) [Ryan Holtz]
  • Loading branch information
MooglyGuy authored May 20, 2023
1 parent b761e23 commit e89eb3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 0 additions & 1 deletion bgfx/chains/hlsl.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
{ "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" },
{ "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" },
{ "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" },
{ "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" },

{ "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" ] },
{ "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" },
Expand Down
14 changes: 9 additions & 5 deletions src/osd/modules/render/d3d/d3dhlsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1570,12 +1570,16 @@ void shaders::render_quad(poly_info *poly, int vertnum)
//next_index = phosphor_pass(rt, next_index, poly, vertnum);

// create bloom textures
int old_index = next_index;
next_index = post_pass(rt, next_index, poly, vertnum, true);
next_index = downsample_pass(rt, next_index, poly, vertnum);
bool bloom_enabled = (options->bloom_scale > 0.0f);
if (bloom_enabled)
{
int old_index = next_index;
next_index = post_pass(rt, next_index, poly, vertnum, true);
next_index = downsample_pass(rt, next_index, poly, vertnum);
next_index = old_index;
}

// apply bloom textures
next_index = old_index;
// apply bloom textures (if enabled) and other post effects
next_index = post_pass(rt, next_index, poly, vertnum, false);
next_index = bloom_pass(rt, next_index, poly, vertnum);
next_index = phosphor_pass(rt, next_index, poly, vertnum);
Expand Down
3 changes: 3 additions & 0 deletions src/osd/modules/render/drawd3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,9 @@ void renderer_d3d9::begin_frame()

if (m_shaders->enabled())
m_shaders->begin_frame(window().m_primlist);

// set an initial default texture
set_texture(nullptr);
}

void renderer_d3d9::process_primitives()
Expand Down

0 comments on commit e89eb3e

Please sign in to comment.