| 29 | using namespace donut::render; |
| 30 | |
| 31 | PlanarShadowMap::PlanarShadowMap( |
| 32 | nvrhi::IDevice* device, |
| 33 | int resolution, |
| 34 | nvrhi::Format format) |
| 35 | { |
| 36 | nvrhi::TextureDesc desc; |
| 37 | desc.width = resolution; |
| 38 | desc.height = resolution; |
| 39 | desc.sampleCount = 1; |
| 40 | desc.isRenderTarget = true; |
| 41 | desc.isTypeless = true; |
| 42 | desc.format = format; |
| 43 | desc.debugName = "ShadowMap"; |
| 44 | desc.useClearValue = true; |
| 45 | desc.clearValue = nvrhi::Color(1.f); |
| 46 | desc.initialState = nvrhi::ResourceStates::ShaderResource; |
| 47 | desc.keepInitialState = true; |
| 48 | desc.dimension = nvrhi::TextureDimension::Texture2DArray; |
| 49 | m_ShadowMapTexture = device->createTexture(desc); |
| 50 | |
| 51 | m_ShadowMapSize = float2(static_cast<float>(resolution)); |
| 52 | m_TextureSize = m_ShadowMapSize; |
| 53 | |
| 54 | m_View = std::make_shared<engine::PlanarView>(); |
| 55 | m_View->SetViewport(nvrhi::Viewport(float(resolution), float(resolution))); |
| 56 | m_View->SetArraySlice(0); |
| 57 | } |
| 58 | |
| 59 | PlanarShadowMap::PlanarShadowMap( |
| 60 | nvrhi::IDevice* device, |
nothing calls this directly
no test coverage detected