Skip to content

Commit

Permalink
Fix regression for 2d viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
shg8 committed Apr 10, 2024
1 parent ebef898 commit bb9d6b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ bool Renderer::recordRenderCommandBuffer(uint32_t currentFrame) {
vk::ImageMemoryBarrier imageMemoryBarrier{};
imageMemoryBarrier.oldLayout = vk::ImageLayout::eUndefined;
imageMemoryBarrier.newLayout = vk::ImageLayout::eGeneral;
imageMemoryBarrier.image = renderTarget->swapchainImages[currentImageIndex]->image;
imageMemoryBarrier.image = renderTarget->swapchainImages[currentImageIndex].image->image; // TODO: stereo
imageMemoryBarrier.subresourceRange = {vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1};
imageMemoryBarrier.srcAccessMask = vk::AccessFlagBits::eNoneKHR;
imageMemoryBarrier.dstAccessMask = vk::AccessFlagBits::eShaderWrite;
Expand Down
2 changes: 1 addition & 1 deletion src/vulkan/VulkanContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ImageProxy {
std::array<std::shared_ptr<Image>, 2> stereoImages;

std::shared_ptr<Image> operator[](const size_t index) {
if (index > 1 || !isStereo) {
if (index > 1 || (!isStereo && index > 0)) {
throw std::runtime_error("Invalid index for stereo image");
}
if (isStereo) {
Expand Down

0 comments on commit bb9d6b7

Please sign in to comment.