diff --git a/Windows_Libs/Dev/Render/RendererCore.cpp b/Windows_Libs/Dev/Render/RendererCore.cpp index ed95723..58eef52 100644 --- a/Windows_Libs/Dev/Render/RendererCore.cpp +++ b/Windows_Libs/Dev/Render/RendererCore.cpp @@ -687,11 +687,13 @@ void Renderer::Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain) m_pDeviceContext->OMGetRenderTargets(1, &renderTargetView, &depthStencilView); D3D11_RENDER_TARGET_VIEW_DESC rtvDesc = {}; + std::memset(&rtvDesc, 0, sizeof(rtvDesc)); rtvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; rtvDesc.Texture2D.MipSlice = 0; D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + std::memset(&srvDesc, 0, sizeof(srvDesc)); srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; srvDesc.Texture2D.MostDetailedMip = 0; diff --git a/Windows_Libs/Dev/Render/RendererState.cpp b/Windows_Libs/Dev/Render/RendererState.cpp index 9af73e4..85635cb 100644 --- a/Windows_Libs/Dev/Render/RendererState.cpp +++ b/Windows_Libs/Dev/Render/RendererState.cpp @@ -665,7 +665,7 @@ void Renderer::UpdateLightingState() const std::size_t lightingBytes = sizeof(c.lightDirection) + sizeof(c.lightColour) + sizeof(c.lightAmbientColour); D3D11_MAPPED_SUBRESOURCE mapped = {}; c.m_pDeviceContext->Map(c.m_lightingStateBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapped); - std::memcpy(mapped.pData, c.lightDirection, lightingBytes); + std::memmove(mapped.pData, c.lightDirection, lightingBytes); c.m_pDeviceContext->Unmap(c.m_lightingStateBuffer, 0); c.lightingDirty = false;