diff options
author | Westley M. Martinez <anikom15@gmail.com> | 2016-12-12 22:34:14 -0800 |
---|---|---|
committer | Westley M. Martinez <anikom15@gmail.com> | 2016-12-12 22:34:14 -0800 |
commit | 40e71b93aea689aa64c5ac9af674d88a255b656d (patch) | |
tree | 577e9ee22b5e48eeaab87b9e94c9f50f3081ab16 /src/osd/modules/render/d3d/d3dhlsl.cpp | |
parent | 77fd0232e6a24930e577d2813e8eddefcffd3c23 (diff) |
Add signal so that any future shaders relying on delta_time do not
interfere with each other.
src/osd/modules/render/d3d/d3dhlsl.cpp: update_t flag is reset
for each emulated screen 0.
src/ods/modules/render/d3d/d3dhlsl.h: Add update_t.
Diffstat (limited to 'src/osd/modules/render/d3d/d3dhlsl.cpp')
-rw-r--r-- | src/osd/modules/render/d3d/d3dhlsl.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 48852ef20e0..5e390868f19 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -164,15 +164,15 @@ private: shaders::shaders() : d3dintf(nullptr), machine(nullptr), d3d(nullptr), post_fx_enable(false), oversampling_enable(false), - num_screens(0), curr_screen(0), acc_t(0), delta_t(0), shadow_texture(nullptr), options(nullptr), - black_surface(nullptr), black_texture(nullptr), recording_movie(false), render_snap(false), - snap_copy_target(nullptr), snap_copy_texture(nullptr), snap_target(nullptr), snap_texture(nullptr), - snap_width(0), snap_height(0), initialized(false), backbuffer(nullptr), curr_effect(nullptr), - default_effect(nullptr), prescale_effect(nullptr), post_effect(nullptr), distortion_effect(nullptr), - focus_effect(nullptr), phosphor_effect(nullptr), deconverge_effect(nullptr), color_effect(nullptr), - ntsc_effect(nullptr), bloom_effect(nullptr), downsample_effect(nullptr), vector_effect(nullptr), - curr_texture(nullptr), curr_render_target(nullptr), curr_poly(nullptr), - d3dx_create_effect_from_file_ptr(nullptr) + update_t(true), num_screens(0), curr_screen(0), acc_t(0), delta_t(0), shadow_texture(nullptr), + options(nullptr), black_surface(nullptr), black_texture(nullptr), recording_movie(false), + render_snap(false), snap_copy_target(nullptr), snap_copy_texture(nullptr), snap_target(nullptr), + snap_texture(nullptr), snap_width(0), snap_height(0), initialized(false), backbuffer(nullptr), + curr_effect(nullptr), default_effect(nullptr), prescale_effect(nullptr), post_effect(nullptr), + distortion_effect(nullptr), focus_effect(nullptr), phosphor_effect(nullptr), + deconverge_effect(nullptr), color_effect(nullptr), ntsc_effect(nullptr), bloom_effect(nullptr), + downsample_effect(nullptr), vector_effect(nullptr), curr_texture(nullptr), + curr_render_target(nullptr), curr_poly(nullptr), d3dx_create_effect_from_file_ptr(nullptr) { } @@ -905,10 +905,11 @@ double shaders::delta_time() { double t; - if (curr_screen == 0) { + if (update_t) { t = machine->time().as_double(); delta_t = t - acc_t; acc_t = t; + update_t = false; } return delta_t; } @@ -1428,6 +1429,8 @@ void shaders::render_quad(poly_info *poly, int vertnum) else if (PRIMFLAG_GET_VECTORBUF(poly->flags())) { curr_screen = curr_screen < num_screens ? curr_screen : 0; + if (curr_screen == 0) + update_t = true; int source_width = int(poly->prim_width() + 0.5f); int source_height = int(poly->prim_height() + 0.5f); |