Make use of the new uniform cache method that uses the variable names as uniform names (#3217)

This commit is contained in:
Alexander Bock
2024-04-30 08:12:33 +02:00
committed by GitHub
parent be3e30e6b4
commit 203cff04cc
36 changed files with 122 additions and 348 deletions

View File

@@ -40,11 +40,6 @@
#include <optional>
namespace {
constexpr std::array<const char*, 6> UniformNames = {
"opacity", "modelViewProjection", "modelViewTransform", "modelViewRotation",
"colorTexture", "mirrorTexture"
};
constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
"Size",
"Size (in meters)",
@@ -215,7 +210,7 @@ void RenderableSphere::initializeGL() {
}
);
ghoul::opengl::updateUniformLocations(*_shader, _uniformCache, UniformNames);
ghoul::opengl::updateUniformLocations(*_shader, _uniformCache);
}
void RenderableSphere::deinitializeGL() {
@@ -363,7 +358,7 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
void RenderableSphere::update(const UpdateData&) {
if (_shader->isDirty()) {
_shader->rebuildFromFile();
ghoul::opengl::updateUniformLocations(*_shader, _uniformCache, UniformNames);
ghoul::opengl::updateUniformLocations(*_shader, _uniformCache);
}
if (_sphereIsDirty) {