Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for ComputeBasic sample freezing on window resize #1724

Open
wants to merge 1 commit into
base: vulkan
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix for ComputeBasic sample freezing on window resize
  • Loading branch information
MarcinKantochAMD committed Jan 20, 2017
commit a19a2920a32494055dd5d8a17f157ae149b809f2
2 changes: 1 addition & 1 deletion include/cinder/app/RendererVk.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class RendererVk : public Renderer {
uint32_t mSwapchainImageCount = 2;
VkSampleCountFlagBits mSamples = VK_SAMPLE_COUNT_1_BIT;
VkFormat mDepthStencilFormat = VK_FORMAT_D16_UNORM;
VkPresentModeKHR mPresentMode = VK_PRESENT_MODE_MAX_ENUM;
VkPresentModeKHR mPresentMode = VK_PRESENT_MODE_MAX_ENUM_KHR;
std::vector<std::string> mInstanceLayers;
std::vector<std::string> mDeviceLayers;
vk::DebugReportCallbackFn mDebugReportCallbackFn = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ComputeBasicApp : public App {
public:
void setup() override;
void update() override;
void resize() override;
void draw() override;

private:
Expand Down Expand Up @@ -184,6 +185,11 @@ void ComputeBasicApp::update()
}
}

void ComputeBasicApp::resize()
{
update();
}

void ComputeBasicApp::draw()
{
// Get next image
Expand All @@ -198,7 +204,7 @@ void ComputeBasicApp::draw()
// Initial params
std::vector<vk::CommandBufferRef> commandBuffers = { cmdBuf };
std::vector<VkSemaphore> waitSemaphores = { mImageAcquiredSemaphore, mComputeDoneSemaphore };
std::vector<VkPipelineStageFlags> waitDstStageMasks = { VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT };
std::vector<VkPipelineStageFlags> waitDstStageMasks = { VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT };
VkFence nullFence = VK_NULL_HANDLE;
std::vector<VkSemaphore> signalSemaphores = { mRenderingCompleteSemaphore };

Expand Down
2 changes: 1 addition & 1 deletion src/cinder/vk/Swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void Swapchain::initializeColorBuffers()
}

// If a specific present mode isn't requested, find one.
if( VK_PRESENT_MODE_MAX_ENUM == mOptions.mPresentMode ) {
if( VK_PRESENT_MODE_MAX_ENUM_KHR == mOptions.mPresentMode ) {
CI_LOG_I( "Finding best present mode..." );
// If mailbox mode is available, use it, as is the lowest-latency non-
// tearing mode. If not, try IMMEDIATE which will usually be available,
Expand Down