aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-11 18:49:57 +0100
committerAndreas Grois <andi@grois.info>2018-03-11 18:49:57 +0100
commit65586cd259e5cd5c1f1cc1805845514e777e0179 (patch)
tree3333986cbeef4e146f201ee67687511743341804
parent1e4079d59c3ff7c9e0b03dffd1e4762ebbd1fd44 (diff)
Use long for command line validity checks.v0.0.2-kindaWorkingBetter
-rw-r--r--BuddhaTest/src/Helpers.cpp6
1 files 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<unsigned int>(maxSSBOSize))
+ if((static_cast<unsigned long>(imageWidth) * static_cast<unsigned long>(imageHeight)) > static_cast<unsigned long>(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<unsigned int>(maxInvocations))
+ if(static_cast<unsigned long>(localWorkgroupSizeX)*static_cast<unsigned long>(localWorkgroupSizeY)*static_cast<unsigned long>(localWorkgroupSizeZ) > static_cast<unsigned long>(maxInvocations))
{
std::cerr << "Requested local work group size exceeds maximum total count (Product of x*y*z dimensions). Limit: " << maxInvocations << std::endl;
return false;