From 65586cd259e5cd5c1f1cc1805845514e777e0179 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sun, 11 Mar 2018 18:49:57 +0100 Subject: Use long for command line validity checks. --- BuddhaTest/src/Helpers.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BuddhaTest/src/Helpers.cpp b/BuddhaTest/src/Helpers.cpp index a5743e5..e1a4115 100644 --- a/BuddhaTest/src/Helpers.cpp +++ b/BuddhaTest/src/Helpers.cpp @@ -262,11 +262,9 @@ namespace Helpers std::cerr << "Image height has to be an even number." << std::endl; return false; } - const unsigned int bufferHeight = imageHeight/2; - const unsigned int pixelCount{(imageWidth * imageHeight/2)*3}; //*3 -> RGB int maxSSBOSize; glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE,&maxSSBOSize); - if(pixelCount * 4 > static_cast(maxSSBOSize)) + if((static_cast(imageWidth) * static_cast(imageHeight)) > static_cast(maxSSBOSize)/6) { std::cerr << "Requested buffer size larger than maximum allowed by graphics driver. Max pixel number: " << maxSSBOSize/6 << std::endl; return false; @@ -294,7 +292,7 @@ namespace Helpers } int maxInvocations; glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS,&maxInvocations); - if(localWorkgroupSizeX*localWorkgroupSizeY*localWorkgroupSizeZ > static_cast(maxInvocations)) + if(static_cast(localWorkgroupSizeX)*static_cast(localWorkgroupSizeY)*static_cast(localWorkgroupSizeZ) > static_cast(maxInvocations)) { std::cerr << "Requested local work group size exceeds maximum total count (Product of x*y*z dimensions). Limit: " << maxInvocations << std::endl; return false; -- cgit v1.2.3