From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d/resource.c | 4 +++- tests/d3d12.c | 18 +++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index cb1427f94a4a..f857de2dcf0d 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1667,7 +1667,9 @@ void d3d12_desc_create_srv(struct d3d12_desc *descriptor, vkd3d_desc.miplevel_idx = desc->u.TextureCubeArray.MostDetailedMip; vkd3d_desc.miplevel_count = desc->u.TextureCubeArray.MipLevels; vkd3d_desc.layer_idx = desc->u.TextureCubeArray.First2DArrayFace; - vkd3d_desc.layer_count = 6 * desc->u.TextureCubeArray.NumCubes; + vkd3d_desc.layer_count = desc->u.TextureCubeArray.NumCubes; + if (vkd3d_desc.layer_count != VK_REMAINING_ARRAY_LAYERS) + vkd3d_desc.layer_count *= 6; if (desc->u.TextureCubeArray.ResourceMinLODClamp) FIXME("Unhandled min LOD clamp %.8e.\n", desc->u.TextureCubeArray.ResourceMinLODClamp); break; diff --git a/tests/d3d12.c b/tests/d3d12.c index 49e7a788ef02..25c2fdf80439 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -10845,16 +10845,20 @@ static void test_cube_maps(void) const D3D12_SHADER_BYTECODE *ps; unsigned int miplevel_count; unsigned int array_size; + unsigned int cube_count; } ps_tests[] = { - {&ps_cube, 1, 6}, - {&ps_cube, 2, 6}, - {&ps_cube, 3, 6}, + {&ps_cube, 1, 6, 1}, + {&ps_cube, 2, 6, 1}, + {&ps_cube, 3, 6, 1}, + {&ps_cube, 3, 6, ~0u},
- {&ps_cube_array, 1, 12}, - {&ps_cube_array, 2, 12}, - {&ps_cube_array, 3, 12}, + {&ps_cube_array, 1, 12, 2}, + {&ps_cube_array, 1, 12, ~0u}, + {&ps_cube_array, 2, 12, 2}, + {&ps_cube_array, 3, 12, 2}, + {&ps_cube_array, 3, 12, ~0u}, };
memset(&desc, 0, sizeof(desc)); @@ -10913,7 +10917,7 @@ static void test_cube_maps(void) srv_desc.TextureCubeArray.MostDetailedMip = 0; srv_desc.TextureCubeArray.MipLevels = test->miplevel_count; srv_desc.TextureCubeArray.First2DArrayFace = 0; - srv_desc.TextureCubeArray.NumCubes = test->array_size / 6; + srv_desc.TextureCubeArray.NumCubes = test->cube_count; srv_desc.TextureCubeArray.ResourceMinLODClamp = 0.0f; } ID3D12Device_CreateShaderResourceView(context.device, texture, &srv_desc, cpu_handle);