diff options
author | 2016-04-19 21:18:16 +0200 | |
---|---|---|
committer | 2016-04-19 21:18:16 +0200 | |
commit | cd4dfca43e81533b6b204e37ec016dda924c004b (patch) | |
tree | 9e7f388508ab4610db0d52556789d72962f7def1 /src/osd/modules/render/bgfx/chainentry.cpp | |
parent | 8ed3a7d94a65ee01bf1adce3ea8118c04d41a18d (diff) |
Refactored BGFX distortion pass (nw)
- also removed vector hack
Diffstat (limited to 'src/osd/modules/render/bgfx/chainentry.cpp')
-rw-r--r-- | src/osd/modules/render/bgfx/chainentry.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp index c30139e17c4..156bc435f09 100644 --- a/src/osd/modules/render/bgfx/chainentry.cpp +++ b/src/osd/modules/render/bgfx/chainentry.cpp @@ -122,6 +122,20 @@ void bgfx_chain_entry::setup_sourcesize_uniform(render_primitive* prim) const } } +void bgfx_chain_entry::setup_targetsize_uniform(int32_t screen) const +{ + bgfx_uniform* target_dims = m_effect->uniform("u_target_dims"); + if (target_dims != nullptr) + { + bgfx_target* output = m_targets.target(screen, m_output); + if (output != nullptr) + { + float values[2] = { float(output->width()), float(output->height()) }; + target_dims->set(values, sizeof(float) * 2); + } + } +} + void bgfx_chain_entry::setup_rotationtype_uniform(uint32_t rotation_type) const { bgfx_uniform* rotation_type_uniform = m_effect->uniform("u_rotation_type"); @@ -166,6 +180,7 @@ void bgfx_chain_entry::setup_auto_uniforms(render_primitive* prim, texture_manag { setup_screensize_uniforms(textures, screen_width, screen_height, screen); setup_sourcesize_uniform(prim); + setup_targetsize_uniform(screen); setup_rotationtype_uniform(rotation_type); setup_swapxy_uniform(swap_xy); setup_quaddims_uniform(prim); |