summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/chainentry.cpp
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-04-24 20:36:42 +0200
committer ImJezze <jezze@gmx.net>2016-04-24 20:36:42 +0200
commit07d8b25571860897fdad90c0c215b3e949f96ea9 (patch)
treeec378412f51fd296d87162871bdbdbe8926b9d71 /src/osd/modules/render/bgfx/chainentry.cpp
parent29f51e85db4572febadf40956e2808f5444d2135 (diff)
Added "selection" parameter to chain input sampler
- if specified all textures (.png) within the same directoy of the given texture will be selectable via slider in the UI - also added slider for "shadow mask tile mode" to HLSL chain
Diffstat (limited to 'src/osd/modules/render/bgfx/chainentry.cpp')
-rw-r--r--src/osd/modules/render/bgfx/chainentry.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp
index fc97e909260..ec802e83699 100644
--- a/src/osd/modules/render/bgfx/chainentry.cpp
+++ b/src/osd/modules/render/bgfx/chainentry.cpp
@@ -28,7 +28,7 @@
#include "render.h"
-bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_state* clear, std::vector<bgfx_suppressor*> suppressors, std::vector<bgfx_input_pair> inputs, std::vector<bgfx_entry_uniform*> uniforms, target_manager& targets, std::string output)
+bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_state* clear, std::vector<bgfx_suppressor*> suppressors, std::vector<bgfx_input_pair*> inputs, std::vector<bgfx_entry_uniform*> uniforms, target_manager& targets, std::string output)
: m_name(name)
, m_effect(effect)
, m_clear(clear)
@@ -42,6 +42,11 @@ bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, clear_
bgfx_chain_entry::~bgfx_chain_entry()
{
+ for (bgfx_input_pair* input : m_inputs)
+ {
+ delete input;
+ }
+ m_inputs.clear();
for (bgfx_entry_uniform* uniform : m_uniforms)
{
delete uniform;
@@ -59,9 +64,9 @@ void bgfx_chain_entry::submit(int view, render_primitive* prim, texture_manager&
return;
}
- for (bgfx_input_pair input : m_inputs)
+ for (bgfx_input_pair* input : m_inputs)
{
- input.bind(m_effect, m_targets, textures, screen);
+ input->bind(m_effect, screen);
}
bgfx::TransientVertexBuffer buffer;
@@ -92,7 +97,7 @@ void bgfx_chain_entry::setup_screensize_uniforms(texture_manager& textures, uint
float height = screen_height;
if (m_inputs.size() > 0)
{
- std::string name = m_inputs[0].texture() + std::to_string(screen);
+ std::string name = m_inputs[0]->texture() + std::to_string(screen);
width = float(textures.provider(name)->width());
height = float(textures.provider(name)->height());
}
@@ -181,7 +186,7 @@ void bgfx_chain_entry::setup_quaddims_uniform(render_primitive* prim) const
bgfx_uniform* quad_dims_uniform = m_effect->uniform("u_quad_dims");
if (quad_dims_uniform != nullptr)
{
- float values[2] = { (prim->bounds.x1 - prim->bounds.x0) + 0.5f, (prim->bounds.y1 - prim->bounds.y0) + 0.5f};
+ float values[2] = { float(floor((prim->bounds.x1 - prim->bounds.x0) + 0.5f)), float(floor((prim->bounds.y1 - prim->bounds.y0) + 0.5f)) };
quad_dims_uniform->set(values, sizeof(float) * 2);
}
}