style(rendering): clean code of GPUInfoImpl
@@ -22,25 +22,17 @@ public final class GPUInfoImpl implements GPUInfo {
String lowerVendorName = vendorName.toLowerCase();
if (lowerVendorName.contains("nvidia")) {
vendor = Vendor.NVIDIA;
+ totalMemory = glGetInteger(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX);
} else if (lowerVendorName.contains("amd") || lowerVendorName.contains("ati")) {
vendor = Vendor.AMD;
+ totalMemory = glGetInteger(GL_VBO_FREE_MEMORY_ATI) + glGetInteger(GL_TEXTURE_FREE_MEMORY_ATI) +
+ glGetInteger(GL_RENDERBUFFER_FREE_MEMORY_ATI);
} else if (lowerVendorName.contains("inter")) {
vendor = Vendor.INTER;
+ totalMemory = -1;
} else {
vendor = Vendor.UNKNOWN;
- }
-
- switch (vendor) {
- case NVIDIA:
- totalMemory = glGetInteger(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX);
- break;
- case AMD:
- totalMemory = glGetInteger(GL_VBO_FREE_MEMORY_ATI) + glGetInteger(GL_TEXTURE_FREE_MEMORY_ATI) +
- glGetInteger(GL_RENDERBUFFER_FREE_MEMORY_ATI);
- break;
- default:
totalMemory = -1;
- break;
}
}
