Skip to content

Commit

Permalink
Some minor fixes to vulkan images.
Browse files Browse the repository at this point in the history
  • Loading branch information
AWoloszyn committed Oct 5, 2018
1 parent c0bb6f0 commit ba3720a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
26 changes: 15 additions & 11 deletions gapis/api/vulkan/api/image.api
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,13 @@ sub void setQueueInRange(ref!ImageObject image, VkImageSubresourceRange rng,
layerCount := imageSubresourceLayerCount(image, rng)
levelCount := imageSubresourceLevelCount(image, rng)
for _ , _ , aspectBit in unpackImageAspectFlags(rng.aspectMask) {
for _, i, layer in image.Aspects[aspectBit].Layers {
if (i >= rng.baseArrayLayer) && (i < rng.baseArrayLayer + layerCount) {
for _, k, level in layer.Levels {
if (k >= rng.baseMipLevel) && (k < rng.baseMipLevel + levelCount) {
level.LastBoundQueue = queue
if aspectBit in image.Aspects {
for _, i, layer in image.Aspects[aspectBit].Layers {
if (i >= rng.baseArrayLayer) && (i < rng.baseArrayLayer + layerCount) {
for _, k, level in layer.Levels {
if (k >= rng.baseMipLevel) && (k < rng.baseMipLevel + levelCount) {
level.LastBoundQueue = queue
}
}
}
}
Expand Down Expand Up @@ -640,12 +642,14 @@ sub void writeImageSubresource(ref!ImageObject image, VkImageSubresourceRange rn
layerCount := imageSubresourceLayerCount(image, rng)
levelCount := imageSubresourceLevelCount(image, rng)
for _ , _ , aspectBit in unpackImageAspectFlags(rng.aspectMask) {
aspect := image.Aspects[aspectBit]
for layerIndex in (rng.baseArrayLayer .. rng.baseArrayLayer + layerCount) {
layer := aspect.Layers[layerIndex]
for mipLevel in (rng.baseMipLevel .. rng.baseMipLevel + levelCount) {
level := layer.Levels[mipLevel]
write(level.Data)
if aspectBit in image.Aspects {
aspect := image.Aspects[aspectBit]
for layerIndex in (rng.baseArrayLayer .. rng.baseArrayLayer + layerCount) {
layer := aspect.Layers[layerIndex]
for mipLevel in (rng.baseMipLevel .. rng.baseMipLevel + levelCount) {
level := layer.Levels[mipLevel]
write(level.Data)
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions gapis/api/vulkan/templates/vk_spy_helpers.cpp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ uint32_t VulkanSpy::SpyOverride_vkCreateDevice(
VkDevice device = *pDevice;
(void)device; // Use is conditional of preprocessor defines.
VulkanImports::VkDeviceFunctions* functions = nullptr;
(void)functions;

// Add this device, along with the vkGetDeviceProcAddr to our map.
// This way when someone calls vkGetDeviceProcAddr, we can forward
Expand Down

0 comments on commit ba3720a

Please sign in to comment.