diff --git a/WickedEngine/RenderPath2D.cpp b/WickedEngine/RenderPath2D.cpp index dda42720f..047506df3 100644 --- a/WickedEngine/RenderPath2D.cpp +++ b/WickedEngine/RenderPath2D.cpp @@ -178,6 +178,8 @@ void RenderPath2D::Render() const GraphicsDevice* device = wiRenderer::GetDevice(); CommandList cmd = device->BeginCommandList(); + wiRenderer::ProcessDeferredMipGenRequests(cmd); + wiRenderer::GetDevice()->BindResource(PS, GetGUIBlurredBackground(), TEXSLOT_IMAGE_BACKGROUND, cmd); // Special care for internal resolution, because stencil buffer is of internal resolution, diff --git a/WickedEngine/wiRenderer.cpp b/WickedEngine/wiRenderer.cpp index e0252ff4e..b5f2a3efd 100644 --- a/WickedEngine/wiRenderer.cpp +++ b/WickedEngine/wiRenderer.cpp @@ -3386,6 +3386,18 @@ void RenderImpostors( } } +void ProcessDeferredMipGenRequests(CommandList cmd) +{ + deferredMIPGenLock.lock(); + for (auto& it : deferredMIPGens) + { + MIPGEN_OPTIONS mipopt; + mipopt.preserve_coverage = it.second; + GenerateMipChain(*it.first->texture, MIPGENFILTER_LINEAR, cmd, mipopt); + } + deferredMIPGens.clear(); + deferredMIPGenLock.unlock(); +} void UpdatePerFrameData(float dt, uint32_t layerMask) { @@ -3918,17 +3930,6 @@ void UpdateRenderData(CommandList cmd) BindCommonResources(cmd); - // Process deferred MIP generation: - deferredMIPGenLock.lock(); - for (auto& it : deferredMIPGens) - { - MIPGEN_OPTIONS mipopt; - mipopt.preserve_coverage = it.second; - GenerateMipChain(*it.first->texture, MIPGENFILTER_LINEAR, cmd, mipopt); - } - deferredMIPGens.clear(); - deferredMIPGenLock.unlock(); - // Update material constant buffers: for (auto& materialIndex : pendingMaterialUpdates) { diff --git a/WickedEngine/wiRenderer.h b/WickedEngine/wiRenderer.h index 029a7d4d8..4bb061e81 100644 --- a/WickedEngine/wiRenderer.h +++ b/WickedEngine/wiRenderer.h @@ -100,6 +100,9 @@ namespace wiRenderer uint32_t flags = DRAWSCENE_OPAQUE ); + // Render mip levels for textures that reqested it: + void ProcessDeferredMipGenRequests(wiGraphics::CommandList cmd); + // Compute essential atmospheric scattering textures for skybox, fog and clouds void RenderAtmosphericScatteringTextures(wiGraphics::CommandList cmd); // Update atmospheric scattering primarily for environment probes. diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index d82fa5cb0..2604cfefa 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates, breaking API changes const int minor = 49; // minor bug fixes, alterations, refactors, updates - const int revision = 7; + const int revision = 8; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);