You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Implement LIMIT_MAX_COMPUTE_SHARED_MEMORY_SIZE to limit_get in all Rendering backends.
Also add a more helpful warning that is only displayed in dev builds to match the D3D12 backend
This commit is contained in:
@@ -5828,6 +5828,7 @@ uint64_t RenderingDeviceDriverVulkan::get_lazily_memory_used() {
|
||||
|
||||
uint64_t RenderingDeviceDriverVulkan::limit_get(Limit p_limit) {
|
||||
const VkPhysicalDeviceLimits &limits = physical_device_properties.limits;
|
||||
uint64_t safe_unbounded = ((uint64_t)1 << 30);
|
||||
switch (p_limit) {
|
||||
case LIMIT_MAX_BOUND_UNIFORM_SETS:
|
||||
return limits.maxBoundDescriptorSets;
|
||||
@@ -5897,6 +5898,8 @@ uint64_t RenderingDeviceDriverVulkan::limit_get(Limit p_limit) {
|
||||
return limits.maxComputeWorkGroupSize[1];
|
||||
case LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z:
|
||||
return limits.maxComputeWorkGroupSize[2];
|
||||
case LIMIT_MAX_COMPUTE_SHARED_MEMORY_SIZE:
|
||||
return limits.maxComputeSharedMemorySize;
|
||||
case LIMIT_MAX_VIEWPORT_DIMENSIONS_X:
|
||||
return limits.maxViewportDimensions[0];
|
||||
case LIMIT_MAX_VIEWPORT_DIMENSIONS_Y:
|
||||
@@ -5923,8 +5926,12 @@ uint64_t RenderingDeviceDriverVulkan::limit_get(Limit p_limit) {
|
||||
// The Vulkan spec states that built in varyings like gl_FragCoord should count against this, but in
|
||||
// practice, that doesn't seem to be the case. The validation layers don't even complain.
|
||||
return MIN(limits.maxVertexOutputComponents / 4, limits.maxFragmentInputComponents / 4);
|
||||
default:
|
||||
ERR_FAIL_V(0);
|
||||
default: {
|
||||
#ifdef DEV_ENABLED
|
||||
WARN_PRINT("Returning maximum value for unknown limit " + itos(p_limit) + ".");
|
||||
#endif
|
||||
return safe_unbounded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user