summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/chainentry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/render/bgfx/chainentry.cpp')
-rw-r--r--src/osd/modules/render/bgfx/chainentry.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/osd/modules/render/bgfx/chainentry.cpp b/src/osd/modules/render/bgfx/chainentry.cpp
new file mode 100644
index 00000000000..7121d88cbe6
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainentry.cpp
@@ -0,0 +1,33 @@
+#include "emu.h"
+
+#include <bgfx/bgfx.h>
+
+#include "effect.h"
+#include "texture.h"
+#include "target.h"
+#include "chainentry.h"
+
+bgfx_chain_entry::bgfx_chain_entry(std::string name, bgfx_effect* effect, std::vector<bgfx_input_pair>& inputs, bgfx_target* output)
+ : m_name(name)
+ , m_effect(effect)
+ , m_output(output)
+{
+ for (bgfx_input_pair input : inputs)
+ {
+ m_inputs.push_back(input);
+ }
+}
+
+bgfx_chain_entry::~bgfx_chain_entry()
+{
+}
+
+void bgfx_chain_entry::submit(render_primitive* prim, int view)
+{
+ for (bgfx_input_pair input : m_inputs)
+ {
+ input.bind(m_effect);
+ }
+ bgfx::setViewFrameBuffer(view, m_output->target());
+ m_effect->submit(view);
+}