diff --git a/layers/core_checks/cc_image.cpp b/layers/core_checks/cc_image.cpp index 356348930ac..2180a797222 100644 --- a/layers/core_checks/cc_image.cpp +++ b/layers/core_checks/cc_image.cpp @@ -596,29 +596,28 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate } } - const VkPhysicalDeviceLimits *device_limits = &phys_dev_props.limits; const VkImageUsageFlags attach_flags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; if (pCreateInfo->usage & attach_flags) { - if (pCreateInfo->extent.width > device_limits->maxFramebufferWidth) { + if (pCreateInfo->extent.width > phys_dev_props.limits.maxFramebufferWidth) { skip |= LogError("VUID-VkImageCreateInfo-usage-00964", device, create_info_loc.dot(Field::usage), "(%s) includes a frame buffer attachment bit and image width (%" PRIu32 ") is greater than maxFramebufferWidth (%" PRIu32 ").", string_VkImageUsageFlags(pCreateInfo->usage).c_str(), pCreateInfo->extent.width, - device_limits->maxFramebufferWidth); + phys_dev_props.limits.maxFramebufferWidth); } - if (pCreateInfo->extent.height > device_limits->maxFramebufferHeight) { + if (pCreateInfo->extent.height > phys_dev_props.limits.maxFramebufferHeight) { skip |= LogError("VUID-VkImageCreateInfo-usage-00965", device, create_info_loc.dot(Field::usage), "(%s) includes a frame buffer attachment bit and image height (%" PRIu32 ") is greater than maxFramebufferHeight (%" PRIu32 ").", string_VkImageUsageFlags(pCreateInfo->usage).c_str(), pCreateInfo->extent.height, - device_limits->maxFramebufferHeight); + phys_dev_props.limits.maxFramebufferHeight); } } if (!enabled_features.fragmentDensityMapOffset && (pCreateInfo->usage & VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT)) { uint32_t ceiling_width = static_cast(ceilf( - static_cast(device_limits->maxFramebufferWidth) / + static_cast(phys_dev_props.limits.maxFramebufferWidth) / std::max(static_cast(phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.width), 1.0f))); if (pCreateInfo->extent.width > ceiling_width) { skip |= LogError( @@ -626,12 +625,12 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate "includes VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT and image width (%" PRIu32 ") is greater than %" PRIu32 ".\n" "This is ceiling value of maxFramebufferWidth (%" PRIu32 ") / minFragmentDensityTexelSize.width (%" PRIu32 ").", - pCreateInfo->extent.width, ceiling_width, device_limits->maxFramebufferWidth, + pCreateInfo->extent.width, ceiling_width, phys_dev_props.limits.maxFramebufferWidth, phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.width); } uint32_t ceiling_height = static_cast(ceilf( - static_cast(device_limits->maxFramebufferHeight) / + static_cast(phys_dev_props.limits.maxFramebufferHeight) / std::max(static_cast(phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.height), 1.0f))); if (pCreateInfo->extent.height > ceiling_height) { skip |= LogError( @@ -639,7 +638,7 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate "includes VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT and image height (%" PRIu32 ") is greater than %" PRIu32 ".\n" "This is ceiling value of maxFramebufferHeight (%" PRIu32 ") / minFragmentDensityTexelSize.height (%" PRIu32 ").", - pCreateInfo->extent.height, ceiling_height, device_limits->maxFramebufferHeight, + pCreateInfo->extent.height, ceiling_height, phys_dev_props.limits.maxFramebufferHeight, phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.height); } } diff --git a/layers/core_checks/cc_pipeline_graphics.cpp b/layers/core_checks/cc_pipeline_graphics.cpp index 0602cef96e3..705e72484eb 100644 --- a/layers/core_checks/cc_pipeline_graphics.cpp +++ b/layers/core_checks/cc_pipeline_graphics.cpp @@ -4091,16 +4091,15 @@ bool CoreChecks::ValidatePipelineVertexDivisors(const vvl::Pipeline &pipeline, c // Can use raw Pipeline state values because not using the stride (which can be dynamic with // VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE) const auto &binding_descriptions = pipeline.GraphicsCreateInfo().pVertexInputState->pVertexBindingDescriptions; - const auto &binding_desc_count = pipeline.GraphicsCreateInfo().pVertexInputState->vertexBindingDescriptionCount; - const VkPhysicalDeviceLimits *device_limits = &phys_dev_props.limits; + const auto& binding_desc_count = pipeline.GraphicsCreateInfo().pVertexInputState->vertexBindingDescriptionCount; for (uint32_t j = 0; j < divisor_state_info->vertexBindingDivisorCount; j++) { const Location divisor_loc = vertex_input_loc.pNext(Struct::VkVertexInputBindingDivisorDescription, Field::pVertexBindingDivisors, j); const auto *vibdd = &(divisor_state_info->pVertexBindingDivisors[j]); - if (vibdd->binding >= device_limits->maxVertexInputBindings) { + if (vibdd->binding >= phys_dev_props.limits.maxVertexInputBindings) { skip |= LogError("VUID-VkVertexInputBindingDivisorDescription-binding-01869", device, divisor_loc.dot(Field::binding), "(%" PRIu32 ") exceeds device maxVertexInputBindings (%" PRIu32 ").", vibdd->binding, - device_limits->maxVertexInputBindings); + phys_dev_props.limits.maxVertexInputBindings); } if (vibdd->divisor > phys_dev_props_core14.maxVertexAttribDivisor) { skip |= LogError("VUID-VkVertexInputBindingDivisorDescription-divisor-01870", device, divisor_loc.dot(Field::divisor),