d3d12: fix return-value for PIPE_CAP_MAX_TEXTURE_3D_LEVELS

D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION is 2^11, not 2^10 like the
comment said, and the code assumed. We need to add one to account for
the base-level.

Let's add a static_assert here to prove that this is the right value.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
This commit is contained in:
Erik Faye-Lund
2022-11-24 10:27:12 +01:00
committed by Marge Bot
parent acc0039aec
commit d15e71ef3c

View File

@@ -151,7 +151,9 @@ d3d12_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION;
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
return 11; // D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION == 2^10
static_assert(D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION == (1 << 11),
"D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION");
return 12;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return D3D12_REQ_MIP_LEVELS;