From 5235884f707f997ed352b692af3e4f6b57f8739a Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Tue, 21 Jun 2016 10:28:30 -0600 Subject: layers: GH669, Fix clearValueCount errors Validation was assuming LOAD_OP_CLEAR for some attachments resulting in bad validation messages. Change-Id: I8ff75ca63f591e3002b1ee2b61a6844d0cf1c07d --- layers/core_validation.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index b0b8515f..3d76a9f4 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -8990,11 +8990,14 @@ static bool VerifyRenderAreaBounds(const layer_data *my_data, const VkRenderPass // [load|store]Op flag must be checked // TODO: The memory valid flag in DEVICE_MEM_INFO should probably be split to track the validity of stencil memory separately. template static bool FormatSpecificLoadAndStoreOpSettings(VkFormat format, T color_depth_op, T stencil_op, T op) { + if (color_depth_op != op && stencil_op != op) { + return false; + } bool check_color_depth_load_op = !vk_format_is_stencil_only(format); bool check_stencil_load_op = vk_format_is_depth_and_stencil(format) || !check_color_depth_load_op; - // For now, having either the color/depth op OR the stencil op will make the memory valid. They may need to be tracked separately - bool failed = ((check_stencil_load_op && (stencil_op != op)) && (check_color_depth_load_op && (color_depth_op != op))); - return !failed; + + return (((check_color_depth_load_op == true) && (color_depth_op == op)) || + ((check_stencil_load_op == true) && (stencil_op == op))); } VKAPI_ATTR void VKAPI_CALL -- cgit v1.2.3