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

Author: Jesse Natalie <[email protected]>
Date:   Thu Oct 27 12:49:04 2022 -0700

d3d12: Don't multiply cube array sizes by 6

Gallium already does this for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19357>

---

 src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt |  5 ++---
 src/gallium/drivers/d3d12/d3d12_blit.cpp        |  6 ------
 src/gallium/drivers/d3d12/d3d12_resource.cpp    | 14 +-------------
 3 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt 
b/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt
index 61449dc8a2c..628ca865d3c 100644
--- a/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt
+++ b/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt
@@ -120,7 +120,6 @@ spec/!opengl 1.1/draw-pixels samples=32: skip
 spec/!opengl 1.1/draw-pixels samples=4: skip
 spec/!opengl 1.1/draw-pixels samples=6: skip
 spec/!opengl 1.1/draw-pixels samples=8: skip
-spec/!opengl 1.1/getteximage-depth/gl_texture_cube_map-gl_stencil_index8: fail
 spec/!opengl 1.1/linestipple/factor 2x: fail
 spec/!opengl 1.1/linestipple/factor 3x: fail
 spec/!opengl 1.1/linestipple/line loop: fail
@@ -3520,8 +3519,8 @@ wgl/wgl-sanity: skip
 summary:
        name:  results
        ----  --------
-       pass:    17864
-       fail:     2044
+       pass:    17865
+       fail:     2043
       crash:       11
        skip:     1445
     timeout:        0
diff --git a/src/gallium/drivers/d3d12/d3d12_blit.cpp 
b/src/gallium/drivers/d3d12/d3d12_blit.cpp
index de967598d77..e31755da0b7 100644
--- a/src/gallium/drivers/d3d12/d3d12_blit.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_blit.cpp
@@ -281,12 +281,6 @@ copy_subregion_no_barriers(struct d3d12_context *ctx,
    int src_array_size = src->base.b.array_size;
    int dst_array_size = dst->base.b.array_size;
 
-   if (dst->base.b.target == PIPE_TEXTURE_CUBE)
-      dst_array_size *= 6;
-
-   if (src->base.b.target == PIPE_TEXTURE_CUBE)
-      src_array_size *= 6;
-
    int stencil_src_res_offset = 1;
    int stencil_dst_res_offset = 1;
 
diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp 
b/src/gallium/drivers/d3d12/d3d12_resource.cpp
index 7bc95d5b5d6..0dde1f57825 100644
--- a/src/gallium/drivers/d3d12/d3d12_resource.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp
@@ -222,8 +222,6 @@ init_texture(struct d3d12_screen *screen,
 
    case PIPE_TEXTURE_CUBE:
    case PIPE_TEXTURE_CUBE_ARRAY:
-      desc.DepthOrArraySize *= 6;
-      FALLTHROUGH;
    case PIPE_TEXTURE_2D:
    case PIPE_TEXTURE_2D_ARRAY:
    case PIPE_TEXTURE_RECT:
@@ -990,17 +988,7 @@ unsigned int
 get_subresource_id(struct d3d12_resource *res, unsigned resid,
                    unsigned z, unsigned base_level)
 {
-   unsigned resource_stride = res->base.b.last_level + 1;
-   if (res->base.b.target == PIPE_TEXTURE_1D_ARRAY ||
-       res->base.b.target == PIPE_TEXTURE_2D_ARRAY)
-      resource_stride *= res->base.b.array_size;
-
-   if (res->base.b.target == PIPE_TEXTURE_CUBE)
-      resource_stride *= 6;
-
-   if (res->base.b.target == PIPE_TEXTURE_CUBE_ARRAY)
-      resource_stride *= 6 * res->base.b.array_size;
-
+   unsigned resource_stride = (res->base.b.last_level + 1) * 
res->base.b.array_size;
    unsigned layer_stride = res->base.b.last_level + 1;
 
    return resid * resource_stride + z * layer_stride +

Reply via email to