Mesa (main): d3d12: Limit sampler view count to 32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 11 01:48:38 UTC 2022


Module: Mesa
Branch: main
Commit: 166cd05071c18c078d1d311609b39354101061d2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=166cd05071c18c078d1d311609b39354101061d2

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Mon Jan 10 15:27:33 2022 -0800

d3d12: Limit sampler view count to 32

Reviewed-by: Sil Vilerino <sivileri at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14367>

---

 src/gallium/drivers/d3d12/d3d12_screen.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp
index 14c63a0d522..dc97162c0e3 100644
--- a/src/gallium/drivers/d3d12/d3d12_screen.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp
@@ -419,9 +419,10 @@ d3d12_get_shader_param(struct pipe_screen *pscreen,
       return 0; /* not implemented */
 
    case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
-      if (screen->opts.ResourceBindingTier == D3D12_RESOURCE_BINDING_TIER_1)
-         return 128;
-      return PIPE_MAX_SHADER_SAMPLER_VIEWS;
+      /* Note: This is wrong, but this is the max value that
+       * TC can support to avoid overflowing an array.
+       */
+      return PIPE_MAX_SAMPLERS;
 
    case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
    case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:



More information about the mesa-commit mailing list