internal void Resize(int width, int height, int samplesNum, int samplesQuality) { Release(); m_samplesCount = samplesNum; m_samplesQuality = samplesQuality; MyDepthStencilManager dsManager = MyManagers.DepthStencils; m_depthStencil = dsManager.CreateDepthStencil("MyGBuffer.DepthStencil", width, height, samplesCount: samplesNum, samplesQuality: samplesQuality); if (MyRender11.MultisamplingEnabled) { m_resolvedDepthStencil = dsManager.CreateDepthStencil("MyGBuffer.ResolvedDepth", width, height); } MyRwTextureManager rwManager = MyManagers.RwTextures; m_gbuffer0 = rwManager.CreateRtv("MyGBuffer.GBuffer0", width, height, Format.R8G8B8A8_UNorm_SRgb, samplesNum, samplesQuality); m_gbuffer1 = rwManager.CreateRtv("MyGBuffer.GBuffer1", width, height, Format.R10G10B10A2_UNorm, samplesNum, samplesQuality); m_gbuffer2 = rwManager.CreateRtv("MyGBuffer.GBuffer2", width, height, Format.R8G8B8A8_UNorm, samplesNum, samplesQuality); m_lbuffer = rwManager.CreateRtv("MyGBuffer.LBuffer", width, height, LBufferFormat, samplesNum, samplesQuality); }
internal void Release() { MyDepthStencilManager dsManager = MyManagers.DepthStencils; MyRwTextureManager rwManager = MyManagers.RwTextures; dsManager.DisposeTex(ref m_depthStencil); rwManager.DisposeTex(ref m_gbuffer0); rwManager.DisposeTex(ref m_gbuffer1); rwManager.DisposeTex(ref m_gbuffer2); rwManager.DisposeTex(ref m_lbuffer); }
internal static void Resize(int width, int height, int samplesNum, int samplesQuality) { MyDepthStencilManager dsManager = MyManagers.DepthStencils; dsManager.DisposeTex(ref m_resolvedDepth); m_resolvedDepth = dsManager.CreateDepthStencil("MyScreenDependants.ResolvedDepth", width, height); MyRwTextureManager texManager = MyManagers.RwTextures; texManager.DisposeTex(ref m_ambientOcclusionHelper); m_ambientOcclusionHelper = texManager.CreateRtv("MyScreenDependants.AmbientOcclusionHelper", width, height, Format.R8_UNorm, 1, 0); texManager.DisposeTex(ref m_ambientOcclusion); m_ambientOcclusion = texManager.CreateRtv("MyScreenDependants.AmbientOcclusion", width, height, Format.R8_UNorm, 1, 0); TilesX = (width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE; TilesY = ((height + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE); TilesNum = TilesX * TilesY; if (m_tileIndices != null) { m_tileIndices.Release(); } m_tileIndices = new MyRWStructuredBuffer(TilesNum + TilesNum * MyRender11Constants.MAX_POINT_LIGHTS, sizeof(uint), MyRWStructuredBuffer.UavType.Default, true, "MyScreenDependants::tileIndices"); }