Permalink
Browse files

Vulkan: Use optimal alignment for texture uploads. May help stutter in

  • Loading branch information...
hrydgard committed Nov 13, 2017
1 parent 35437e6 commit a0f1276a5c584180c494a51066d9d76b26f5503f
Showing with 3 additions and 1 deletion.
  1. +3 −1 GPU/Vulkan/TextureCacheVulkan.cpp
@@ -662,7 +662,9 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry, bool replaceIm
int size = stride * mipHeight;
uint32_t bufferOffset;
VkBuffer texBuf;
void *data = drawEngine_->GetPushBufferForTextureData()->Push(size, &bufferOffset, &texBuf);
// nvidia returns 1 but that can't be healthy... let's align by 16 as a minimum.

This comment has been minimized.

Show comment
Hide comment
@unknownbrackets

unknownbrackets Nov 13, 2017

Collaborator

Ah, even for our SSE this will be better, regardless of the driver.

-[Unknown]

@unknownbrackets

unknownbrackets Nov 13, 2017

Collaborator

Ah, even for our SSE this will be better, regardless of the driver.

-[Unknown]

int pushAlignment = std::max(16, (int)vulkan_->GetPhysicalDeviceProperties().limits.optimalBufferCopyOffsetAlignment);
void *data = drawEngine_->GetPushBufferForTextureData()->PushAligned(size, &bufferOffset, &texBuf, pushAlignment);
if (replaced.Valid()) {
replaced.Load(i, data, stride);
} else {

0 comments on commit a0f1276

Please sign in to comment.