summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/pass.cpp
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-02-18 15:57:34 +0100
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-02-21 03:03:23 +0100
commit9a47a870df619656e9092f2f77622e84e640307a (patch)
treeb8640bf79ffb55d0c9ed6fc27bbd4ce16a5e1a2e /src/osd/modules/render/bgfx/pass.cpp
parentdadf8e7d79696996ab3ef840fe99a588ede538fa (diff)
First take on render API reorg, nw
Diffstat (limited to 'src/osd/modules/render/bgfx/pass.cpp')
-rw-r--r--src/osd/modules/render/bgfx/pass.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/osd/modules/render/bgfx/pass.cpp b/src/osd/modules/render/bgfx/pass.cpp
new file mode 100644
index 00000000000..246399eeebd
--- /dev/null
+++ b/src/osd/modules/render/bgfx/pass.cpp
@@ -0,0 +1,33 @@
+#include "emu.h"
+
+#include <bgfx/bgfx.h>
+
+#include "effect.h"
+#include "texture.h"
+#include "target.h"
+#include "pass.h"
+
+bgfx_pass::bgfx_pass(std::string name, bgfx_effect* effect, std::vector<bgfx_texture*>& inputs, bgfx_target* output)
+ : m_name(name)
+ , m_effect(effect)
+ , m_output(output)
+{
+ for (bgfx_texture* input : inputs)
+ {
+ m_inputs.push_back(input);
+ }
+}
+
+bgfx_pass::~bgfx_pass()
+{
+}
+
+void bgfx_pass::submit(render_primitive* prim, int view)
+{
+ for (int index = 0; index < m_inputs.size(); index++)
+ {
+ bgfx::setTexture(index, m_effect->uniform(m_inputs[index]->name())->handle(), m_inputs[index]->handle());
+ }
+ bgfx::setViewFrameBuffer(view, m_output->target());
+ m_effect->submit(view);
+}