Add more improvements to optional tess/geo shaders
This commit is contained in:
@@ -87,7 +87,7 @@ bool ColorGradingPass::Init()
|
||||
bool ColorGradingPass::setupResources()
|
||||
{
|
||||
// Wait for shader
|
||||
if (!_shader->IsLoaded())
|
||||
if (!_shader || !_shader->IsLoaded())
|
||||
return true;
|
||||
const auto shader = _shader->GetShader();
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ void EyeAdaptationPass::Render(RenderContext& renderContext, GPUTexture* colorBu
|
||||
renderContext.Buffers->LastEyeAdaptationTime = 0.0f;
|
||||
if ((view.Flags & ViewFlags::EyeAdaptation) == ViewFlags::None || settings.Mode == EyeAdaptationMode::None || checkIfSkipPass())
|
||||
return;
|
||||
|
||||
PROFILE_GPU_CPU("Eye Adaptation");
|
||||
|
||||
// Setup constants
|
||||
@@ -218,14 +217,15 @@ String EyeAdaptationPass::ToString() const
|
||||
|
||||
bool EyeAdaptationPass::Init()
|
||||
{
|
||||
_canUseHistogram = GPUDevice::Instance->Limits.HasCompute;
|
||||
auto device = GPUDevice::Instance;
|
||||
_canUseHistogram = device->Limits.HasCompute;
|
||||
|
||||
// Create pipeline states
|
||||
_psManual = GPUDevice::Instance->CreatePipelineState();
|
||||
_psLuminanceMap = GPUDevice::Instance->CreatePipelineState();
|
||||
_psBlendLuminance = GPUDevice::Instance->CreatePipelineState();
|
||||
_psApplyLuminance = GPUDevice::Instance->CreatePipelineState();
|
||||
_psHistogram = GPUDevice::Instance->CreatePipelineState();
|
||||
_psManual = device->CreatePipelineState();
|
||||
_psLuminanceMap = device->CreatePipelineState();
|
||||
_psBlendLuminance = device->CreatePipelineState();
|
||||
_psApplyLuminance = device->CreatePipelineState();
|
||||
_psHistogram = device->CreatePipelineState();
|
||||
|
||||
// Load shaders
|
||||
_shader = Content::LoadAsyncInternal<Shader>(TEXT("Shaders/EyeAdaptation"));
|
||||
|
||||
@@ -29,7 +29,6 @@ GPUBuffer* HistogramPass::Render(RenderContext& renderContext, GPUTexture* color
|
||||
auto context = device->GetMainContext();
|
||||
if (checkIfSkipPass() || !_isSupported)
|
||||
return nullptr;
|
||||
|
||||
PROFILE_GPU_CPU("Histogram");
|
||||
|
||||
// Setup constants
|
||||
|
||||
Reference in New Issue
Block a user