mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-10 00:01:33 +02:00
Implemented call to abortTask().
This commit is contained in:
parent
bb04f3f533
commit
3150b963c0
1 changed files with 6 additions and 17 deletions
|
@ -120,11 +120,6 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext, con
|
||||||
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
||||||
assert(lightStage);
|
assert(lightStage);
|
||||||
|
|
||||||
// Exit if current keylight does not cast shadows
|
|
||||||
if (!lightStage->getCurrentKeyLight() || !lightStage->getCurrentKeyLight()->getCastShadows()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto shadow = lightStage->getCurrentKeyShadow();
|
auto shadow = lightStage->getCurrentKeyShadow();
|
||||||
if (!shadow || _cascadeIndex >= shadow->getCascadeCount()) {
|
if (!shadow || _cascadeIndex >= shadow->getCascadeCount()) {
|
||||||
return;
|
return;
|
||||||
|
@ -305,8 +300,14 @@ void RenderShadowSetup::setSlopeBias(int cascadeIndex, float value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderShadowSetup::run(const render::RenderContextPointer& renderContext, Outputs& output) {
|
void RenderShadowSetup::run(const render::RenderContextPointer& renderContext, Outputs& output) {
|
||||||
|
// Abort all jobs if not casting shadows
|
||||||
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
||||||
assert(lightStage);
|
assert(lightStage);
|
||||||
|
if (!lightStage->getCurrentKeyLight() || !lightStage->getCurrentKeyLight()->getCastShadows()) {
|
||||||
|
renderContext->taskFlow.abortTask();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Cache old render args
|
// Cache old render args
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
|
|
||||||
|
@ -387,18 +388,6 @@ void RenderShadowCascadeSetup::run(const render::RenderContextPointer& renderCon
|
||||||
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
||||||
assert(lightStage);
|
assert(lightStage);
|
||||||
|
|
||||||
// Exit if current keylight does not cast shadows
|
|
||||||
if (!lightStage->getCurrentKeyLight()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool castShadows = lightStage->getCurrentKeyLight()->getCastShadows();
|
|
||||||
if (!castShadows) {
|
|
||||||
output.edit0() = ItemFilter::Builder::nothing();
|
|
||||||
output.edit1() = ViewFrustumPointer();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache old render args
|
// Cache old render args
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue