diff options
author | 2016-03-25 18:44:18 +0100 | |
---|---|---|
committer | 2016-03-25 18:44:46 +0100 | |
commit | 22f0c31238f40e79902d88c9860d4aebc228424d (patch) | |
tree | facb6e639bdf31a3c424bbd73413a8af4bf1bb15 /src | |
parent | 37a32099cd8072362a3ab56929bb4dddc751794a (diff) |
Cleanup in the bgfx aisle, nw
Diffstat (limited to 'src')
48 files changed, 123 insertions, 115 deletions
diff --git a/src/osd/modules/render/bgfx/blendreader.cpp b/src/osd/modules/render/bgfx/blendreader.cpp index f96f20a4ba8..9e7ddb17ce3 100644 --- a/src/osd/modules/render/bgfx/blendreader.cpp +++ b/src/osd/modules/render/bgfx/blendreader.cpp @@ -14,8 +14,8 @@ const blend_reader::string_to_enum blend_reader::EQUATION_NAMES[blend_reader::EQ { "add", BGFX_STATE_BLEND_EQUATION_ADD }, { "sub", BGFX_STATE_BLEND_EQUATION_SUB }, { "subtract", BGFX_STATE_BLEND_EQUATION_SUB }, - { "revSub", BGFX_STATE_BLEND_EQUATION_REVSUB }, - { "revSubtract", BGFX_STATE_BLEND_EQUATION_REVSUB }, + { "revsub", BGFX_STATE_BLEND_EQUATION_REVSUB }, + { "revsubtract", BGFX_STATE_BLEND_EQUATION_REVSUB }, { "min", BGFX_STATE_BLEND_EQUATION_MIN }, { "max", BGFX_STATE_BLEND_EQUATION_MAX } }; @@ -25,18 +25,18 @@ const blend_reader::string_to_enum blend_reader::FUNCTION_NAMES[blend_reader::FU { "zero", BGFX_STATE_BLEND_ZERO }, { "1", BGFX_STATE_BLEND_ONE }, { "one", BGFX_STATE_BLEND_ONE }, - { "srcColor", BGFX_STATE_BLEND_SRC_COLOR }, - { "1-srcColor", BGFX_STATE_BLEND_INV_SRC_COLOR }, - { "invSrcColor", BGFX_STATE_BLEND_INV_SRC_COLOR }, - { "dstColor", BGFX_STATE_BLEND_DST_COLOR }, - { "1-dstColor", BGFX_STATE_BLEND_INV_DST_COLOR }, - { "invDstColor", BGFX_STATE_BLEND_INV_DST_COLOR }, - { "srcAlpha", BGFX_STATE_BLEND_SRC_ALPHA }, - { "1-srcAlpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, - { "invSrcAlpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, - { "dstAlpha", BGFX_STATE_BLEND_DST_ALPHA }, - { "1-dstAlpha", BGFX_STATE_BLEND_INV_DST_ALPHA }, - { "invDstAlpha", BGFX_STATE_BLEND_INV_DST_ALPHA } + { "srccolor", BGFX_STATE_BLEND_SRC_COLOR }, + { "1-srccolor", BGFX_STATE_BLEND_INV_SRC_COLOR }, + { "invsrccolor", BGFX_STATE_BLEND_INV_SRC_COLOR }, + { "dstcolor", BGFX_STATE_BLEND_DST_COLOR }, + { "1-dstcolor", BGFX_STATE_BLEND_INV_DST_COLOR }, + { "invdstcolor", BGFX_STATE_BLEND_INV_DST_COLOR }, + { "srcalpha", BGFX_STATE_BLEND_SRC_ALPHA }, + { "1-srcalpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, + { "invsrcalpha", BGFX_STATE_BLEND_INV_SRC_ALPHA }, + { "dstalpha", BGFX_STATE_BLEND_DST_ALPHA }, + { "1-dstalpha", BGFX_STATE_BLEND_INV_DST_ALPHA }, + { "invdstalpha", BGFX_STATE_BLEND_INV_DST_ALPHA } }; uint64_t blend_reader::read_from_value(const Value& value) diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp index 22be450be40..cba1bbc3c3d 100644 --- a/src/osd/modules/render/bgfx/chainmanager.cpp +++ b/src/osd/modules/render/bgfx/chainmanager.cpp @@ -4,8 +4,8 @@ // // chainmanager.cpp - BGFX shader chain manager // -// Maintains a string-to-entry lookup of BGFX shader effect -// chains, defined by chain.h and read by chainreader.h +// Provides loading for BGFX shader effect chains, defined +// by chain.h and read by chainreader.h // //============================================================ @@ -60,7 +60,7 @@ bgfx_chain* chain_manager::load_chain(std::string name, running_machine& machine data[size] = 0; Document document; - document.Parse<0>(data); + document.Parse<kParseCommentsFlag>(data); delete [] data; diff --git a/src/osd/modules/render/bgfx/chainmanager.h b/src/osd/modules/render/bgfx/chainmanager.h index 07e1dfd8594..8ed0b218bb4 100644 --- a/src/osd/modules/render/bgfx/chainmanager.h +++ b/src/osd/modules/render/bgfx/chainmanager.h @@ -4,8 +4,8 @@ // // chainmanager.h - BGFX shader chain manager // -// Maintains a string-to-entry lookup of BGFX shader -// effect chains, defined by chain.h and read by chainreader.h +// Provides loading for BGFX shader effect chains, defined +// by chain.h and read by chainreader.h // //============================================================ diff --git a/src/osd/modules/render/bgfx/cullreader.cpp b/src/osd/modules/render/bgfx/cullreader.cpp index 593e712fecb..616e7cabfe4 100644 --- a/src/osd/modules/render/bgfx/cullreader.cpp +++ b/src/osd/modules/render/bgfx/cullreader.cpp @@ -11,9 +11,11 @@ #include "cullreader.h" const cull_reader::string_to_enum cull_reader::MODE_NAMES[cull_reader::MODE_COUNT] = { - { "none", 0 }, - { "cw", BGFX_STATE_CULL_CW }, - { "ccw", BGFX_STATE_CULL_CCW } + { "none", 0 }, + { "cw", BGFX_STATE_CULL_CW }, + { "clockwise", BGFX_STATE_CULL_CW }, + { "ccw", BGFX_STATE_CULL_CCW }, + { "counterclockwise", BGFX_STATE_CULL_CCW } }; uint64_t cull_reader::read_from_value(const Value& value) diff --git a/src/osd/modules/render/bgfx/cullreader.h b/src/osd/modules/render/bgfx/cullreader.h index 5c521a108a2..0cb2a3d0f67 100644 --- a/src/osd/modules/render/bgfx/cullreader.h +++ b/src/osd/modules/render/bgfx/cullreader.h @@ -18,7 +18,7 @@ public: static uint64_t read_from_value(const Value& value); private: - static const int MODE_COUNT = 3; + static const int MODE_COUNT = 5; static const string_to_enum MODE_NAMES[MODE_COUNT]; }; diff --git a/src/osd/modules/render/bgfx/depthreader.cpp b/src/osd/modules/render/bgfx/depthreader.cpp index e904604b84d..b32eb426bb7 100644 --- a/src/osd/modules/render/bgfx/depthreader.cpp +++ b/src/osd/modules/render/bgfx/depthreader.cpp @@ -27,7 +27,7 @@ uint64_t depth_reader::read_from_value(const Value& value, std::string prefix) if (value.HasMember("writeenable")) { if (!READER_CHECK(value["writeenable"].IsBool(), (prefix + "Value 'writeenable' must be a boolean\n").c_str())) return 0; - write_enable = value["writeenable"].GetBool() ? BGFX_STATE_DEPTH_WRITE: 0; + write_enable = value["writeenable"].GetBool() ? BGFX_STATE_DEPTH_WRITE : 0; } uint64_t function = get_enum_from_value(value, "function", BGFX_STATE_DEPTH_TEST_ALWAYS, FUNCTION_NAMES, FUNCTION_COUNT); diff --git a/src/osd/modules/render/bgfx/effect.h b/src/osd/modules/render/bgfx/effect.h index 8c1c3c4f617..c4a5d49b2c5 100644 --- a/src/osd/modules/render/bgfx/effect.h +++ b/src/osd/modules/render/bgfx/effect.h @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// effect.cpp - BGFX shader material to be applied to a mesh +// effect.h - BGFX shader material to be applied to a mesh // //============================================================ diff --git a/src/osd/modules/render/bgfx/effectmanager.cpp b/src/osd/modules/render/bgfx/effectmanager.cpp index bbe1ce33482..cf5d4172c6d 100644 --- a/src/osd/modules/render/bgfx/effectmanager.cpp +++ b/src/osd/modules/render/bgfx/effectmanager.cpp @@ -68,7 +68,7 @@ bgfx_effect* effect_manager::load_effect(std::string name) data[size] = 0; Document document; - document.Parse<0>(data); + document.Parse<kParseCommentsFlag>(data); delete [] data; @@ -85,7 +85,7 @@ bgfx_effect* effect_manager::load_effect(std::string name) printf("Unable to load effect %s\n", path.c_str()); return nullptr; } - + m_effects[name] = effect; return effect; diff --git a/src/osd/modules/render/bgfx/frameparameter.h b/src/osd/modules/render/bgfx/frameparameter.h index 022a6f2065b..b7ab5525eda 100644 --- a/src/osd/modules/render/bgfx/frameparameter.h +++ b/src/osd/modules/render/bgfx/frameparameter.h @@ -1,9 +1,8 @@ - // license:BSD-3-Clause // copyright-holders:Ryan Holtz //============================================================ // -// frameparameter.cpp - Frame-based dynamic shader param +// frameparameter.h - Frame-based dynamic shader param // //============================================================ diff --git a/src/osd/modules/render/bgfx/inputpair.cpp b/src/osd/modules/render/bgfx/inputpair.cpp index ce4ece9508b..1f48171da7b 100644 --- a/src/osd/modules/render/bgfx/inputpair.cpp +++ b/src/osd/modules/render/bgfx/inputpair.cpp @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// inputpair.h - BGFX sampler-and-texture pair +// inputpair.cpp - BGFX sampler-and-texture pair // // Keeps track of the texture which is bound to the sampler // which is bound to the specified stage index. diff --git a/src/osd/modules/render/bgfx/fs_blit.sc b/src/osd/modules/render/bgfx/shaders/fs_blit.sc index ff6befc4272..a6835ff890d 100644 --- a/src/osd/modules/render/bgfx/fs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_blit.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_color.sc b/src/osd/modules/render/bgfx/shaders/fs_color.sc index fae98f2a39f..65c128a6a2a 100644 --- a/src/osd/modules/render/bgfx/fs_color.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_color.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Color Convolution Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // User-supplied uniform vec4 u_red_ratios; diff --git a/src/osd/modules/render/bgfx/fs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc index 409896ce40a..d58e1bf6df9 100644 --- a/src/osd/modules/render/bgfx/fs_deconverge.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_deconverge.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0, v_texcoord1, v_texcoord2 // Deconvergence Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_defocus.sc b/src/osd/modules/render/bgfx/shaders/fs_defocus.sc index 8c3ee7a4e6c..44ca7a93612 100644 --- a/src/osd/modules/render/bgfx/fs_defocus.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_defocus.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Defocus Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_tex_size0; diff --git a/src/osd/modules/render/bgfx/fs_distortion.sc b/src/osd/modules/render/bgfx/shaders/fs_distortion.sc index b3678abc669..1b93578a2cf 100644 --- a/src/osd/modules/render/bgfx/fs_distortion.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_distortion.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // Distortion Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_swap_xy; diff --git a/src/osd/modules/render/bgfx/fs_gui.sc b/src/osd/modules/render/bgfx/shaders/fs_gui.sc index 9f539c1182a..a6285212d2f 100644 --- a/src/osd/modules/render/bgfx/fs_gui.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_gui.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc index 1f5c9305053..cc8f633bf5b 100644 --- a/src/osd/modules/render/bgfx/fs_ntsc_decode.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_ntsc_decode.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0 // NTSC Decode Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_source_dims; diff --git a/src/osd/modules/render/bgfx/fs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc index 61f5ae12ac9..3aeac29d20d 100644 --- a/src/osd/modules/render/bgfx/fs_ntsc_encode.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_ntsc_encode.sc @@ -8,7 +8,7 @@ $input v_color0, v_texcoord0 // NB: intentionally wasteful of uniforms in order for easier slider utilization -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_source_dims; diff --git a/src/osd/modules/render/bgfx/fs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc index e5ac1d91f35..4e752d94137 100644 --- a/src/osd/modules/render/bgfx/fs_phosphor.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_phosphor.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // User-supplied uniform vec4 u_passthrough; diff --git a/src/osd/modules/render/bgfx/fs_post.sc b/src/osd/modules/render/bgfx/shaders/fs_post.sc index 8fe9f227e3c..4a77dc88cbb 100644 --- a/src/osd/modules/render/bgfx/fs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_post.sc @@ -6,7 +6,7 @@ $input v_color0, v_texcoord0, v_texcoord1 // Defocus Effect //----------------------------------------------------------------------------- -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos uniform vec4 u_swap_xy; @@ -113,11 +113,11 @@ void main() BaseColor.b = pow(BaseColor.b, u_power.b); // Scanline Simulation (may not affect bloom) - //if (u_prepare_bloom.x == 0.0) - //{ + if (u_prepare_bloom.x == 0.0) + { // Scanline Simulation (may not affect vector screen) - //if (u_prepare_vector.x == 0.0 && u_scanline_alpha.x > 0.0f) - //{ + if (u_prepare_vector.x == 0.0 && u_scanline_alpha.x > 0.0f) + { float BrightnessOffset = (u_scanline_bright_offset.x * u_scanline_alpha.x); float BrightnessScale = (u_scanline_bright_scale.x * u_scanline_alpha.x) + (1.0 - u_scanline_alpha.x); @@ -131,19 +131,19 @@ void main() float ScanBrightness = ScanSineScaled * BrightnessScale + BrightnessOffset * BrightnessScale; BaseColor.rgb *= mix(vec3(1.0, 1.0, 1.0), vec3(ScanBrightness, ScanBrightness, ScanBrightness), u_scanline_alpha.xxx); - //} + } // Hum Bar Simulation (may not affect vector screen) - //if (u_prepare_vector.x == 0.0 && u_humbar_alpha.x > 0.0f) - //{ - //float HumTimeStep = fract(u_time.x * 0.001); - //float HumBrightness = 1.0 - fract(BaseCoord.y + HumTimeStep) * u_humbar_alpha.x; - //BaseColor.rgb *= HumBrightness; - //} - //} - - //vec4 Output = u_prepare_vector.x > 0.0 ? BaseColor * (v_color0 + vec4(1.0, 1.0, 1.0, 0.0)) : BaseColor * v_color0; - //Output.a = 1.0; - - gl_FragColor = vec4(BaseColor.rgb, 1.0);//Output; + if (u_prepare_vector.x == 0.0 && u_humbar_alpha.x > 0.0f) + { + float HumTimeStep = fract(u_time.x * 0.001); + float HumBrightness = 1.0 - fract(BaseCoord.y + HumTimeStep) * u_humbar_alpha.x; + BaseColor.rgb *= HumBrightness; + } + } + + vec4 Output = u_prepare_vector.x > 0.0 ? BaseColor * (v_color0 + vec4(1.0, 1.0, 1.0, 0.0)) : BaseColor * v_color0; + Output.a = 1.0; + + gl_FragColor = Output; } diff --git a/src/osd/modules/render/bgfx/fs_prescale.sc b/src/osd/modules/render/bgfx/shaders/fs_prescale.sc index a6f377991f2..48d177b19fa 100644 --- a/src/osd/modules/render/bgfx/fs_prescale.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_prescale.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/fs_screen.sc b/src/osd/modules/render/bgfx/shaders/fs_screen.sc index cecf14b4730..d0eaa170d49 100644 --- a/src/osd/modules/render/bgfx/fs_screen.sc +++ b/src/osd/modules/render/bgfx/shaders/fs_screen.sc @@ -3,7 +3,7 @@ $input v_color0, v_texcoord0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Samplers SAMPLER2D(s_tex, 0); diff --git a/src/osd/modules/render/bgfx/makefile b/src/osd/modules/render/bgfx/shaders/makefile index 86735a61c38..737ca43554b 100644 --- a/src/osd/modules/render/bgfx/makefile +++ b/src/osd/modules/render/bgfx/shaders/makefile @@ -1,6 +1,6 @@ -BGFX_DIR=../../../../../3rdparty/bgfx -RUNTIME_DIR=../../../../.. -BUILD_DIR=../../../../../build +BGFX_DIR=../../../../../../3rdparty/bgfx +RUNTIME_DIR=../../../../../.. +BUILD_DIR=../../../../../../build include $(BGFX_DIR)/scripts/shader.mk diff --git a/src/osd/modules/render/bgfx/varying.def.sc b/src/osd/modules/render/bgfx/shaders/varying.def.sc index 95b607539a7..95b607539a7 100644 --- a/src/osd/modules/render/bgfx/varying.def.sc +++ b/src/osd/modules/render/bgfx/shaders/varying.def.sc diff --git a/src/osd/modules/render/bgfx/vs_blit.sc b/src/osd/modules/render/bgfx/shaders/vs_blit.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_blit.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_blit.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_color.sc b/src/osd/modules/render/bgfx/shaders/vs_color.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_color.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_color.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_deconverge.sc b/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc index 284fe96e67b..6e13814c89b 100644 --- a/src/osd/modules/render/bgfx/vs_deconverge.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_deconverge.sc @@ -4,10 +4,10 @@ $output v_color0, v_texcoord0, v_texcoord1, v_texcoord2 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" // Autos -uniform vec4 u_tex_size0; +uniform vec4 u_source_size; // User-supplied uniform vec4 u_converge_red; @@ -23,9 +23,9 @@ void main() vec2 half_value = vec2(0.5, 0.5); - v_texcoord0 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_red.xy ) + half_value + u_converge_red.xy * (vec2(1.0, 1.0) / u_tex_size0.xy); - v_texcoord1 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_green.xy) + half_value + u_converge_green.xy * (vec2(1.0, 1.0) / u_tex_size0.xy); - v_texcoord2 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_blue.xy ) + half_value + u_converge_blue.xy * (vec2(1.0, 1.0) / u_tex_size0.xy); + v_texcoord0 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_red.xy ) + half_value + u_converge_red.xy * (vec2(1.0, 1.0) / u_source_size.xy); + v_texcoord1 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_green.xy) + half_value + u_converge_green.xy * (vec2(1.0, 1.0) / u_source_size.xy); + v_texcoord2 = (a_texcoord0 - half_value) * (1.0 + u_radial_converge_blue.xy ) + half_value + u_converge_blue.xy * (vec2(1.0, 1.0) / u_source_size.xy); v_color0 = a_color0; } diff --git a/src/osd/modules/render/bgfx/vs_defocus.sc b/src/osd/modules/render/bgfx/shaders/vs_defocus.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_defocus.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_defocus.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_distortion.sc b/src/osd/modules/render/bgfx/shaders/vs_distortion.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_distortion.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_distortion.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_gui.sc b/src/osd/modules/render/bgfx/shaders/vs_gui.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_gui.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_gui.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_ntsc_decode.sc b/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_ntsc_decode.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_ntsc_decode.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_ntsc_encode.sc b/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_ntsc_encode.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_ntsc_encode.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_phosphor.sc b/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_phosphor.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_phosphor.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_post.sc b/src/osd/modules/render/bgfx/shaders/vs_post.sc index 12b4931a1ae..89923cc9338 100644 --- a/src/osd/modules/render/bgfx/vs_post.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_post.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_texcoord1, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" uniform vec4 u_swap_xy; diff --git a/src/osd/modules/render/bgfx/vs_prescale.sc b/src/osd/modules/render/bgfx/shaders/vs_prescale.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_prescale.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_prescale.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/vs_screen.sc b/src/osd/modules/render/bgfx/shaders/vs_screen.sc index c3699f6fbd9..fd37320eefb 100644 --- a/src/osd/modules/render/bgfx/vs_screen.sc +++ b/src/osd/modules/render/bgfx/shaders/vs_screen.sc @@ -4,7 +4,7 @@ $output v_texcoord0, v_color0 // license:BSD-3-Clause // copyright-holders:Dario Manesku -#include "../../../../../3rdparty/bgfx/examples/common/common.sh" +#include "../../../../../../3rdparty/bgfx/examples/common/common.sh" void main() { diff --git a/src/osd/modules/render/bgfx/sliderreader.cpp b/src/osd/modules/render/bgfx/sliderreader.cpp index 3efe8749c03..b76d3d2c472 100644 --- a/src/osd/modules/render/bgfx/sliderreader.cpp +++ b/src/osd/modules/render/bgfx/sliderreader.cpp @@ -12,7 +12,7 @@ #include "slider.h" const slider_reader::string_to_enum slider_reader::TYPE_NAMES[slider_reader::TYPE_COUNT] = { - { "int_enum", uint64_t(bgfx_slider::slider_type::SLIDER_INT_ENUM) }, + { "intenum", uint64_t(bgfx_slider::slider_type::SLIDER_INT_ENUM) }, { "float", uint64_t(bgfx_slider::slider_type::SLIDER_FLOAT) }, { "int", uint64_t(bgfx_slider::slider_type::SLIDER_INT) }, { "color", uint64_t(bgfx_slider::slider_type::SLIDER_COLOR) }, @@ -24,11 +24,11 @@ const slider_reader::string_to_enum slider_reader::SCREEN_NAMES[slider_reader::S { "raster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_RASTER) }, { "vector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR) }, { "crt", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR_OR_RASTER) }, - { "vector_raster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR_OR_RASTER) }, + { "vectorraster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_VECTOR_OR_RASTER) }, { "lcd", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD) }, - { "non_vector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, - { "lcd_raster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, - { "lcd_vector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_VECTOR) }, + { "nonvector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, + { "lcdraster", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_RASTER) }, + { "lcdvector", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_LCD_OR_VECTOR) }, { "any", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_ANY) }, { "all", uint64_t(bgfx_slider::screen_type::SLIDER_SCREEN_TYPE_ANY) } }; diff --git a/src/osd/modules/render/bgfx/statereader.cpp b/src/osd/modules/render/bgfx/statereader.cpp index 0f5c0a2f88c..a318422d69d 100644 --- a/src/osd/modules/render/bgfx/statereader.cpp +++ b/src/osd/modules/render/bgfx/statereader.cpp @@ -1,5 +1,12 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//================================================================ +// +// statereader.cpp - Generic functions for reading state from +// a JSON file using RapidJSON. +// +//================================================================ + #include "statereader.h" 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) diff --git a/src/osd/modules/render/bgfx/statereader.h b/src/osd/modules/render/bgfx/statereader.h index 5b9a5f5625d..968837a1a19 100644 --- a/src/osd/modules/render/bgfx/statereader.h +++ b/src/osd/modules/render/bgfx/statereader.h @@ -1,5 +1,12 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//================================================================ +// +// statereader.h - Generic functions for reading state from a +// JSON file using RapidJSON. +// +//================================================================ + #pragma once #ifndef __DRAWBGFX_STATE_READER__ diff --git a/src/osd/modules/render/bgfx/suppressor.cpp b/src/osd/modules/render/bgfx/suppressor.cpp index b01e0f94d04..41a260d5d73 100644 --- a/src/osd/modules/render/bgfx/suppressor.cpp +++ b/src/osd/modules/render/bgfx/suppressor.cpp @@ -2,8 +2,8 @@ // copyright-holders:Ryan Holtz //============================================================ // -// suppressor.h - Conditionally suppress a bgfx chain entry -// from being processed. +// suppressor.cpp - Conditionally suppress a bgfx chain entry +// from being processed. // //============================================================ diff --git a/src/osd/modules/render/bgfx/suppressor.h b/src/osd/modules/render/bgfx/suppressor.h index 93166eff693..dd3702439ad 100644 --- a/src/osd/modules/render/bgfx/suppressor.h +++ b/src/osd/modules/render/bgfx/suppressor.h @@ -3,7 +3,7 @@ //============================================================ // // suppressor.h - Conditionally suppress a bgfx chain entry -// from being processed. +// from being processed. // //============================================================ diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp index 7702d0700b4..ff4acf7c088 100644 --- a/src/osd/modules/render/bgfx/targetmanager.cpp +++ b/src/osd/modules/render/bgfx/targetmanager.cpp @@ -4,8 +4,8 @@ // // targetmanager.cpp - BGFX render target manager // -// Maintains a string-to-entry mapping for any registered -// render targets. +// Maintains a per-screen string-to-entry mapping for any +// registered render targets. // //============================================================ diff --git a/src/osd/modules/render/bgfx/targetmanager.h b/src/osd/modules/render/bgfx/targetmanager.h index 0ffc7a934b8..45865c0eb8b 100644 --- a/src/osd/modules/render/bgfx/targetmanager.h +++ b/src/osd/modules/render/bgfx/targetmanager.h @@ -4,8 +4,8 @@ // // targetmanager.h - BGFX render target manager // -// Maintains a string-to-entry mapping for any registered -// render targets. +// Maintains a per-screen string-to-entry mapping for any +// registered render targets. // //============================================================ diff --git a/src/osd/modules/render/bgfx/texturehandleprovider.h b/src/osd/modules/render/bgfx/texturehandleprovider.h index e309bea8d59..5620e54974e 100644 --- a/src/osd/modules/render/bgfx/texturehandleprovider.h +++ b/src/osd/modules/render/bgfx/texturehandleprovider.h @@ -2,7 +2,8 @@ // copyright-holders:Ryan Holtz //============================================================ // -// texturehandleprovider.h +// texturehandleprovider.h - base class for any class that +// can potentially return information about a texture handle // //============================================================ diff --git a/src/osd/modules/render/bgfx/timeparameter.h b/src/osd/modules/render/bgfx/timeparameter.h index 6a05be4fc03..f06bf2f1abb 100644 --- a/src/osd/modules/render/bgfx/timeparameter.h +++ b/src/osd/modules/render/bgfx/timeparameter.h @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// timeparameter.cpp - Time-based dynamic shader param +// timeparameter.h - Time-based dynamic shader param // //============================================================ diff --git a/src/osd/modules/render/bgfx/valueuniform.h b/src/osd/modules/render/bgfx/valueuniform.h index 2cce6970958..cf71742e8da 100644 --- a/src/osd/modules/render/bgfx/valueuniform.h +++ b/src/osd/modules/render/bgfx/valueuniform.h @@ -2,7 +2,7 @@ // copyright-holders:Ryan Holtz //============================================================ // -// valueuniform.cpp - BGFX shader chain fixed uniform +// valueuniform.h - BGFX shader chain fixed uniform // // Represents the mapping between a fixed value and a chain // shader uniform for a given entry diff --git a/src/osd/modules/render/bgfx/writereader.cpp b/src/osd/modules/render/bgfx/writereader.cpp index 7fd36a03fda..6ec148f9e46 100644 --- a/src/osd/modules/render/bgfx/writereader.cpp +++ b/src/osd/modules/render/bgfx/writereader.cpp @@ -1,26 +1,18 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//============================================================ +// +// cullreader.h - BGFX alpha/color write state JSON reader +// +//============================================================ + #include <bgfx/bgfx.h> #include "writereader.h" -const write_reader::string_to_enum write_reader::RGB_NAMES[write_reader::RGB_COUNT] = { - { "true", BGFX_STATE_RGB_WRITE }, - { "false", 0 }, - { "1", BGFX_STATE_RGB_WRITE }, - { "0", 0 } -}; - -const write_reader::string_to_enum write_reader::ALPHA_NAMES[write_reader::ALPHA_COUNT] = { - { "true", BGFX_STATE_ALPHA_WRITE }, - { "false", 0 }, - { "1", BGFX_STATE_ALPHA_WRITE }, - { "0", 0 } -}; - uint64_t write_reader::read_from_value(const Value& value) { - uint64_t rgb = get_enum_from_value(value, "rgb", 0, RGB_NAMES, RGB_COUNT); - uint64_t alpha = get_enum_from_value(value, "alpha", 0, ALPHA_NAMES, ALPHA_COUNT); + uint64_t rgb = get_bool(value, "rgb", false) ? BGFX_STATE_RGB_WRITE : 0; + uint64_t alpha = get_bool(value, "alpha", false) ? BGFX_STATE_ALPHA_WRITE : 0; return rgb | alpha; } diff --git a/src/osd/modules/render/bgfx/writereader.h b/src/osd/modules/render/bgfx/writereader.h index bd43b5899f5..7dcd1ac16c9 100644 --- a/src/osd/modules/render/bgfx/writereader.h +++ b/src/osd/modules/render/bgfx/writereader.h @@ -1,5 +1,11 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz +//============================================================ +// +// cullreader.h - BGFX alpha/color write state JSON reader +// +//============================================================ + #pragma once #ifndef __DRAWBGFX_WRITE_READER__ @@ -10,12 +16,6 @@ class write_reader : public state_reader { public: static uint64_t read_from_value(const Value& value); - -private: - static const int RGB_COUNT = 4; - static const int ALPHA_COUNT = 4; - static const string_to_enum RGB_NAMES[RGB_COUNT]; - static const string_to_enum ALPHA_NAMES[ALPHA_COUNT]; }; #endif // __DRAWBGFX_WRITE_READER__ |