From e2d9693ac35b0cfae733aa0143aa1d67ef1ca0ed Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 9 Jan 2018 19:08:23 +0100 Subject: [PATCH] [dxvk] Fixed compressed texture upload Fixes issues with particles being overly bright in Nier:Automata. --- src/dxvk/dxvk_context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index c644e961..be217236 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -668,6 +668,12 @@ namespace dxvk { VkExtent3D elementCount = imageExtent; elementCount.depth *= subresources.layerCount; + // Align image extent to a full block. This is necessary in + // case the image size is not a multiple of the block size. + elementCount.width += formatInfo->blockSize.width - 1; + elementCount.height += formatInfo->blockSize.height - 1; + elementCount.depth += formatInfo->blockSize.depth - 1; + elementCount.width /= formatInfo->blockSize.width; elementCount.height /= formatInfo->blockSize.height; elementCount.depth /= formatInfo->blockSize.depth; @@ -807,7 +813,6 @@ namespace dxvk { const DxvkVertexBinding* bindings) { m_flags.set( DxvkContextFlag::GpDirtyPipelineState, - DxvkContextFlag::GpDirtyIndexBuffer, DxvkContextFlag::GpDirtyVertexBuffers); m_state.il.numAttributes = attributeCount;