Skip to content

Commit

Permalink
[d3d11] Initialize subresourceLayers in the inner loop
Browse files Browse the repository at this point in the history
Not doing so causes Dirt Rally to fail uploading some textures
properly for some extremely weird reason.
  • Loading branch information
doitsujin committed Jul 13, 2019
1 parent 7cb385f commit 03c6df5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/d3d11/d3d11_initializer.cpp
Expand Up @@ -114,16 +114,13 @@ namespace dxvk {
// pInitialData is an array that stores an entry for
// every single subresource. Since we will define all
// subresources, this counts as initialization.
VkImageSubresourceLayers subresourceLayers;
subresourceLayers.aspectMask = formatInfo->aspectMask;
subresourceLayers.mipLevel = 0;
subresourceLayers.baseArrayLayer = 0;
subresourceLayers.layerCount = 1;

for (uint32_t layer = 0; layer < image->info().numLayers; layer++) {
for (uint32_t level = 0; level < image->info().mipLevels; level++) {
subresourceLayers.baseArrayLayer = layer;
VkImageSubresourceLayers subresourceLayers;
subresourceLayers.aspectMask = formatInfo->aspectMask;
subresourceLayers.mipLevel = level;
subresourceLayers.baseArrayLayer = layer;
subresourceLayers.layerCount = 1;

const uint32_t id = D3D11CalcSubresource(
level, layer, image->info().mipLevels);
Expand Down

0 comments on commit 03c6df5

Please sign in to comment.