diff options
| author | lbavoil <[email protected]> | 2018-03-15 11:08:34 +0100 |
|---|---|---|
| committer | lbavoil <[email protected]> | 2018-03-15 11:08:34 +0100 |
| commit | 636807e68a85a978473764d171ed0c7cc36f9be6 (patch) | |
| tree | 784a3d4fa8f48b4c085dd959678505b2af12f425 /src/Renderer_DX11.h | |
| parent | Remove test folder (diff) | |
| download | hbaoplus-636807e68a85a978473764d171ed0c7cc36f9be6.tar.xz hbaoplus-636807e68a85a978473764d171ed0c7cc36f9be6.zip | |
HBAO+ 4.0.0.23740451
Diffstat (limited to 'src/Renderer_DX11.h')
| -rw-r--r-- | src/Renderer_DX11.h | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/src/Renderer_DX11.h b/src/Renderer_DX11.h index 4f2a6db..e520bc8 100644 --- a/src/Renderer_DX11.h +++ b/src/Renderer_DX11.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2008-2018, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation @@ -16,7 +16,6 @@ #include "OutputInfo.h" #include "ProjectionMatrixInfo.h" #include "RandomTexture.h" -#include "RenderOptions.h" #include "RenderTargets_DX11.h" #include "Shaders_DX11.h" #include "States_DX11.h" @@ -40,8 +39,7 @@ class Renderer : public GFSDK_SSAO_Context_D3D11 { public: Renderer(GFSDK_SSAO_CustomHeap NewDelete) - : m_FullResViewDepthSRV(NULL) - , m_NewDelete(NewDelete) + : m_NewDelete(NewDelete) { } @@ -89,10 +87,20 @@ public: #endif private: + Generated::ShaderPermutations::NUM_STEPS GetNumStepsPermutation() + { + return (m_Options.StepCount == GFSDK_SSAO_STEP_COUNT_4) ? Generated::ShaderPermutations::NUM_STEPS_4 : + Generated::ShaderPermutations::NUM_STEPS_8; + } + Generated::ShaderPermutations::DEPTH_LAYER_COUNT GetDepthLayerCountPermutation() + { + return (m_Options.EnableDualLayerAO) ? Generated::ShaderPermutations::DEPTH_LAYER_COUNT_2 : + Generated::ShaderPermutations::DEPTH_LAYER_COUNT_1; + } Generated::ShaderPermutations::RESOLVE_DEPTH GetResolveDepthPermutation() { - return (m_InputDepth.Texture.SampleCount == 1) ? Generated::ShaderPermutations::RESOLVE_DEPTH_0 : - Generated::ShaderPermutations::RESOLVE_DEPTH_1; + return (m_InputDepth.Texture0.SampleCount == 1) ? Generated::ShaderPermutations::RESOLVE_DEPTH_0 : + Generated::ShaderPermutations::RESOLVE_DEPTH_1; } Generated::ShaderPermutations::FETCH_GBUFFER_NORMAL GetFetchNormalPermutation() { @@ -100,21 +108,6 @@ private: (m_InputNormal.Texture.SampleCount == 1) ? Generated::ShaderPermutations::FETCH_GBUFFER_NORMAL_1 : Generated::ShaderPermutations::FETCH_GBUFFER_NORMAL_2; } - Generated::ShaderPermutations::ENABLE_FOREGROUND_AO GetEnableForegroundAOPermutation() - { - return (m_Options.EnableForegroundAO) ? Generated::ShaderPermutations::ENABLE_FOREGROUND_AO_1 : - Generated::ShaderPermutations::ENABLE_FOREGROUND_AO_0; - } - Generated::ShaderPermutations::ENABLE_BACKGROUND_AO GetEnableBackgroundAOPermutation() - { - return (m_Options.EnableBackgroundAO) ? Generated::ShaderPermutations::ENABLE_BACKGROUND_AO_1 : - Generated::ShaderPermutations::ENABLE_BACKGROUND_AO_0; - } - Generated::ShaderPermutations::ENABLE_DEPTH_THRESHOLD GetEnableDepthThresholdPermutation() - { - return (m_Options.EnableDepthThreshold) ? Generated::ShaderPermutations::ENABLE_DEPTH_THRESHOLD_1 : - Generated::ShaderPermutations::ENABLE_DEPTH_THRESHOLD_0; - } Generated::ShaderPermutations::ENABLE_BLUR GetEnableBlurPermutation() { return (m_Options.Blur.Enable) ? Generated::ShaderPermutations::ENABLE_BLUR_1 : @@ -140,38 +133,38 @@ private: { return (m_InputNormal.Texture.IsSet()) ? m_InputNormal.Texture.pSRV : m_RTs.GetFullResNormalTexture()->pSRV; } + ID3D11ShaderResourceView* GetFullResViewDepthTexture2SRV() + { + return m_Options.EnableDualLayerAO ? m_RTs.GetFullResViewDepthTexture2()->pSRV : NULL; + } UINT GetOutputMSAASampleMask() { return D3D11_DEFAULT_SAMPLE_MASK; } - BlendPassEnumType GetBlendPassEnum(UINT PassIndex) - { - return (PassIndex == 0) ? BLEND_PASS_0 : BLEND_PASS_1; - } - ID3D11BlendState* GetOutputBlendState(BlendPassEnumType BlendPass = BLEND_PASS_0) + ID3D11BlendState* GetOutputBlendState() { return - (m_Output.Blend[BlendPass].Mode == GFSDK_SSAO_OVERWRITE_RGB) ? m_States.GetBlendStateDisabledPreserveAlpha() : - (m_Output.Blend[BlendPass].Mode == GFSDK_SSAO_MULTIPLY_RGB) ? m_States.GetBlendStateMultiplyPreserveAlpha() : - m_Output.Blend[BlendPass].CustomState.pBlendState; + (m_Output.Blend.Mode == GFSDK_SSAO_OVERWRITE_RGB) ? m_States.GetBlendStateDisabledPreserveAlpha() : + (m_Output.Blend.Mode == GFSDK_SSAO_MULTIPLY_RGB) ? m_States.GetBlendStateMultiplyPreserveAlpha() : + m_Output.Blend.CustomState.pBlendState; } - const FLOAT* GetOutputBlendFactor(BlendPassEnumType BlendPass = BLEND_PASS_0) + const FLOAT* GetOutputBlendFactor() { - return (m_Output.Blend[BlendPass].Mode == GFSDK_SSAO_CUSTOM_BLEND) ? m_Output.Blend[BlendPass].CustomState.pBlendFactor : NULL; + return (m_Output.Blend.Mode == GFSDK_SSAO_CUSTOM_BLEND) ? m_Output.Blend.CustomState.pBlendFactor : NULL; } ID3D11DepthStencilView* GetOutputDepthStencilView() { return m_Output.DepthStencilBuffer.pDSV; } - ID3D11DepthStencilState* GetOutputDepthStencilState(BlendPassEnumType BlendPass = BLEND_PASS_0) + ID3D11DepthStencilState* GetOutputDepthStencilState() { - return (m_Output.DepthStencil[BlendPass].Mode == GFSDK_SSAO_CUSTOM_DEPTH_STENCIL) ? m_Output.DepthStencil[BlendPass].CustomState.pDepthStencilState : m_States.GetDepthStencilStateDisabled(); + return (m_Output.DepthStencil.Mode == GFSDK_SSAO_CUSTOM_DEPTH_STENCIL) ? m_Output.DepthStencil.CustomState.pDepthStencilState : m_States.GetDepthStencilStateDisabled(); } - UINT GetOutputDepthStencilRef(BlendPassEnumType BlendPass = BLEND_PASS_0) + UINT GetOutputDepthStencilRef() { - return (m_Output.DepthStencil[BlendPass].Mode == GFSDK_SSAO_CUSTOM_DEPTH_STENCIL) ? m_Output.DepthStencil[BlendPass].CustomState.StencilRef : 0; + return (m_Output.DepthStencil.Mode == GFSDK_SSAO_CUSTOM_DEPTH_STENCIL) ? m_Output.DepthStencil.CustomState.StencilRef : 0; } void CreateResources(ID3D11Device* pD3DDevice); @@ -221,9 +214,8 @@ private: GFSDK::SSAO::D3D11::RenderTargets m_RTs; GFSDK::SSAO::D3D11::Shaders m_Shaders; GFSDK::SSAO::D3D11::States m_States; - GFSDK::SSAO::RenderOptions m_Options; + GFSDK_SSAO_Parameters m_Options; GFSDK::SSAO::Viewports m_Viewports; - ID3D11ShaderResourceView* m_FullResViewDepthSRV; GFSDK::SSAO::BuildVersion m_BuildVersion; GFSDK_SSAO_CustomHeap m_NewDelete; #if ENABLE_RENDER_TIMES |