From 9a47a870df619656e9092f2f77622e84e640307a Mon Sep 17 00:00:00 2001 From: "therealmogminer@gmail.com" Date: Thu, 18 Feb 2016 15:57:34 +0100 Subject: First take on render API reorg, nw --- src/osd/modules/render/bgfx/pass.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/osd/modules/render/bgfx/pass.cpp (limited to 'src/osd/modules/render/bgfx/pass.cpp') 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 + +#include "effect.h" +#include "texture.h" +#include "target.h" +#include "pass.h" + +bgfx_pass::bgfx_pass(std::string name, bgfx_effect* effect, std::vector& 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); +} -- cgit v1.2.3-70-g09d2