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.cpp44
1 files changed, 44 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..c0b8845cdd3
--- /dev/null
+++ b/src/osd/modules/render/bgfx/chainentry.cpp
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// chainentry.cpp - BGFX shader post-processing node
+//
+// Represents a single entry in a list of post-processing
+// passes to be applied to a screen quad or buffer.
+//
+//============================================================
+
+#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);
+}