mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Adapt to new Ghoul; fix previously undetected errors in uniform setting
This commit is contained in:
Submodule ext/ghoul updated: 2f1bb7c483...6cc191d429
@@ -438,13 +438,11 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) {
|
||||
);
|
||||
_program->setUniform(
|
||||
_uniformCache.lightIntensities,
|
||||
_lightIntensitiesBuffer.data(),
|
||||
nLightSources
|
||||
_lightIntensitiesBuffer
|
||||
);
|
||||
_program->setUniform(
|
||||
_uniformCache.lightDirectionsViewSpace,
|
||||
_lightDirectionsViewSpaceBuffer.data(),
|
||||
nLightSources
|
||||
_lightDirectionsViewSpaceBuffer
|
||||
);
|
||||
_program->setUniform(
|
||||
_uniformCache.modelViewTransform,
|
||||
|
||||
@@ -481,7 +481,7 @@ void RenderablePlanetProjection::imageProjectGPU(
|
||||
if (_geometry->hasProperty("Radius")) {
|
||||
std::any r = _geometry->property("Radius")->get();
|
||||
if (glm::vec3* radius = std::any_cast<glm::vec3>(&r)){
|
||||
_fboProgramObject->setUniform(_fboUniformCache.radius, radius);
|
||||
_fboProgramObject->setUniform(_fboUniformCache.radius, *radius);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -135,8 +135,8 @@ void BasicVolumeRaycaster::preRaycast(const RaycastData& data,
|
||||
int nClips = static_cast<int>(clipNormals.size());
|
||||
|
||||
program.setUniform("nClips_" + id, nClips);
|
||||
program.setUniform("clipNormals_" + id, clipNormals.data(), nClips);
|
||||
program.setUniform("clipOffsets_" + id, clipOffsets.data(), nClips);
|
||||
program.setUniform("clipNormals_" + id, clipNormals);
|
||||
program.setUniform("clipOffsets_" + id, clipOffsets);
|
||||
program.setUniform("opacity_" + id, _opacity);
|
||||
program.setUniform("rNormalization_" + id, _rNormalization);
|
||||
program.setUniform("rUpperBound_" + id, _rUpperBound);
|
||||
|
||||
@@ -101,11 +101,15 @@ void GenerateRawVolumeTask::perform(const Task::ProgressCallback& progressCallba
|
||||
ghoul::lua::LuaState state;
|
||||
ghoul::lua::runScript(state, _valueFunctionLua);
|
||||
|
||||
#if (defined(NDEBUG) || defined(DEBUG))
|
||||
ghoul::lua::verifyStackSize(state, 1);
|
||||
#endif
|
||||
|
||||
int functionReference = luaL_ref(state, LUA_REGISTRYINDEX);
|
||||
|
||||
#if (defined(NDEBUG) || defined(DEBUG))
|
||||
ghoul::lua::verifyStackSize(state, 0);
|
||||
#endif
|
||||
|
||||
glm::vec3 domainSize = _upperDomainBound - _lowerDomainBound;
|
||||
|
||||
@@ -117,14 +121,18 @@ void GenerateRawVolumeTask::perform(const Task::ProgressCallback& progressCallba
|
||||
glm::vec3 coord = _lowerDomainBound +
|
||||
glm::vec3(cell) / glm::vec3(_dimensions) * domainSize;
|
||||
|
||||
#if (defined(NDEBUG) || defined(DEBUG))
|
||||
ghoul::lua::verifyStackSize(state, 0);
|
||||
#endif
|
||||
lua_rawgeti(state, LUA_REGISTRYINDEX, functionReference);
|
||||
|
||||
lua_pushnumber(state, coord.x);
|
||||
lua_pushnumber(state, coord.y);
|
||||
lua_pushnumber(state, coord.z);
|
||||
|
||||
#if (defined(NDEBUG) || defined(DEBUG))
|
||||
ghoul::lua::verifyStackSize(state, 4);
|
||||
#endif
|
||||
|
||||
if (lua_pcall(state, 3, 1, 0) != LUA_OK) {
|
||||
return;
|
||||
|
||||
@@ -129,17 +129,20 @@ namespace openspace::documentation {
|
||||
|
||||
const std::string DocumentationEntry::Wildcard = "*";
|
||||
|
||||
std::string concatenate(const std::vector<TestResult::Offense>& offenses) {
|
||||
std::string result = "Error in specification (";
|
||||
for (const TestResult::Offense& o : offenses) {
|
||||
result += o.offender + ',';
|
||||
}
|
||||
result.back() = ')';
|
||||
return result;
|
||||
}
|
||||
|
||||
SpecificationError::SpecificationError(TestResult res, std::string comp)
|
||||
: ghoul::RuntimeError("Error in specification", std::move(comp))
|
||||
: ghoul::RuntimeError(concatenate(res.offenses), std::move(comp))
|
||||
, result(std::move(res))
|
||||
{
|
||||
ghoul_assert(!result.success, "Result's success must be false");
|
||||
|
||||
message += " (";
|
||||
for (const TestResult::Offense& o : result.offenses) {
|
||||
message += o.offender + ',';
|
||||
}
|
||||
message.back() = ')';
|
||||
}
|
||||
|
||||
DocumentationEntry::DocumentationEntry(std::string k, std::shared_ptr<Verifier> v,
|
||||
|
||||
Reference in New Issue
Block a user