summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/valueuniform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/render/bgfx/valueuniform.cpp')
-rw-r--r--src/osd/modules/render/bgfx/valueuniform.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/osd/modules/render/bgfx/valueuniform.cpp b/src/osd/modules/render/bgfx/valueuniform.cpp
new file mode 100644
index 00000000000..96ea8ca465e
--- /dev/null
+++ b/src/osd/modules/render/bgfx/valueuniform.cpp
@@ -0,0 +1,25 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+//============================================================
+//
+// valueuniform.cpp - BGFX shader chain fixed uniform
+//
+// Represents the mapping between a fixed value and a chain
+// shader uniform for a given entry
+//
+//============================================================
+
+#include "valueuniform.h"
+
+bgfx_value_uniform::bgfx_value_uniform(bgfx_uniform* uniform, float* values, const int count)
+ : bgfx_entry_uniform(uniform)
+ , m_count(count)
+{
+ memcpy(m_values, values, sizeof(float) * count);
+}
+
+void bgfx_value_uniform::bind()
+{
+ printf("Setting value uniform %s to %f, %f, %f, %f (%s)\n", m_uniform->name().c_str(), m_values[0], m_values[1], m_values[2], m_values[3]);
+ m_uniform->set(m_values, sizeof(float) * m_count);
+}