d3d12: Set PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET
authorJesse Natalie <jenatali@microsoft.com>
Thu, 27 Oct 2022 22:55:58 +0000 (15:55 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Oct 2022 23:17:47 +0000 (23:17 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19357>

src/gallium/drivers/d3d12/d3d12_screen.cpp

index db92481..5446d5b 100644 (file)
@@ -335,6 +335,11 @@ d3d12_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       /* This is asking about varyings, not total registers, so remove the 2 tess factor registers. */
       return D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT - 2;
 
+   case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
+      /* Picking a value in line with other drivers. Without this, we can end up easily hitting OOM
+       * if an app just creates, initializes, and destroys resources without explicitly flushing. */
+      return 64 * 1024 * 1024;
+
    default:
       return u_pipe_screen_get_param_defaults(pscreen, param);
    }