ShadowMap::ShadowMap(ID3D12Device* device, UINT width, UINT height) { md3dDevice = device; mWidth = width; mHeight = height; mViewport = { 0.0f, 0.0f, (float)width, (float)height, 0.0f, 1.0f }; mScissorRect = { 0, 0, (int)width, (int)height }; BuildResource(); }
SobelFilter::SobelFilter(ID3D12Device* device, UINT width, UINT height, DXGI_FORMAT format) { md3dDevice = device; mWidth = width; mHeight = height; mFormat = format; BuildResource(); }
void ShadowMap::OnResize(UINT newWidth, UINT newHeight) { if((mWidth != newWidth) || (mHeight != newHeight)) { mWidth = newWidth; mHeight = newHeight; BuildResource(); // New resource, so we need new descriptors to that resource. BuildDescriptors(); } }