From 393de7bf2023561c9e65ec1e1c76b44a2fc457d7 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 2 Aug 2016 08:08:16 +1200 Subject: [PATCH] layers: Fix #808 broken mapping of image types to view types This was trying to be too clever, and was foiled by bad assumptions about the enum order. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index a872457..d034d4d 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2623,14 +2623,14 @@ static uint32_t descriptor_type_to_reqs(shader_module const *module, uint32_t ty switch (dim) { case spv::Dim1D: - return DESCRIPTOR_REQ_VIEW_TYPE_1D << arrayed; + return arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_1D_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_1D; case spv::Dim2D: return (msaa ? DESCRIPTOR_REQ_MULTI_SAMPLE : DESCRIPTOR_REQ_SINGLE_SAMPLE) | - (DESCRIPTOR_REQ_VIEW_TYPE_2D << arrayed); + (arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_2D_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_2D); case spv::Dim3D: return DESCRIPTOR_REQ_VIEW_TYPE_3D; case spv::DimCube: - return DESCRIPTOR_REQ_VIEW_TYPE_CUBE << arrayed; + return arrayed ? DESCRIPTOR_REQ_VIEW_TYPE_CUBE_ARRAY : DESCRIPTOR_REQ_VIEW_TYPE_CUBE; default: // subpass, buffer, etc. return 0; } -- 2.7.4