Skip to content

Commit 26e60ac

Browse files
layers: Use normal limit variable
1 parent 6dbf6cf commit 26e60ac

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

layers/core_checks/cc_image.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -596,50 +596,49 @@ bool CoreChecks::PreCallValidateCreateImage(VkDevice device, const VkImageCreate
596596
}
597597
}
598598

599-
const VkPhysicalDeviceLimits *device_limits = &phys_dev_props.limits;
600599
const VkImageUsageFlags attach_flags = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
601600
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT;
602601
if (pCreateInfo->usage & attach_flags) {
603-
if (pCreateInfo->extent.width > device_limits->maxFramebufferWidth) {
602+
if (pCreateInfo->extent.width > phys_dev_props.limits.maxFramebufferWidth) {
604603
skip |= LogError("VUID-VkImageCreateInfo-usage-00964", device, create_info_loc.dot(Field::usage),
605604
"(%s) includes a frame buffer attachment bit and image width (%" PRIu32
606605
") is greater than maxFramebufferWidth (%" PRIu32 ").",
607606
string_VkImageUsageFlags(pCreateInfo->usage).c_str(), pCreateInfo->extent.width,
608-
device_limits->maxFramebufferWidth);
607+
phys_dev_props.limits.maxFramebufferWidth);
609608
}
610-
if (pCreateInfo->extent.height > device_limits->maxFramebufferHeight) {
609+
if (pCreateInfo->extent.height > phys_dev_props.limits.maxFramebufferHeight) {
611610
skip |= LogError("VUID-VkImageCreateInfo-usage-00965", device, create_info_loc.dot(Field::usage),
612611
"(%s) includes a frame buffer attachment bit and image height (%" PRIu32
613612
") is greater than maxFramebufferHeight (%" PRIu32 ").",
614613
string_VkImageUsageFlags(pCreateInfo->usage).c_str(), pCreateInfo->extent.height,
615-
device_limits->maxFramebufferHeight);
614+
phys_dev_props.limits.maxFramebufferHeight);
616615
}
617616
}
618617

619618
if (!enabled_features.fragmentDensityMapOffset && (pCreateInfo->usage & VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT)) {
620619
uint32_t ceiling_width = static_cast<uint32_t>(ceilf(
621-
static_cast<float>(device_limits->maxFramebufferWidth) /
620+
static_cast<float>(phys_dev_props.limits.maxFramebufferWidth) /
622621
std::max(static_cast<float>(phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.width), 1.0f)));
623622
if (pCreateInfo->extent.width > ceiling_width) {
624623
skip |= LogError(
625624
"VUID-VkImageCreateInfo-fragmentDensityMapOffset-06514", device, create_info_loc.dot(Field::usage),
626625
"includes VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT and image width (%" PRIu32 ") is greater than %" PRIu32
627626
".\n"
628627
"This is ceiling value of maxFramebufferWidth (%" PRIu32 ") / minFragmentDensityTexelSize.width (%" PRIu32 ").",
629-
pCreateInfo->extent.width, ceiling_width, device_limits->maxFramebufferWidth,
628+
pCreateInfo->extent.width, ceiling_width, phys_dev_props.limits.maxFramebufferWidth,
630629
phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.width);
631630
}
632631

633632
uint32_t ceiling_height = static_cast<uint32_t>(ceilf(
634-
static_cast<float>(device_limits->maxFramebufferHeight) /
633+
static_cast<float>(phys_dev_props.limits.maxFramebufferHeight) /
635634
std::max(static_cast<float>(phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.height), 1.0f)));
636635
if (pCreateInfo->extent.height > ceiling_height) {
637636
skip |= LogError(
638637
"VUID-VkImageCreateInfo-fragmentDensityMapOffset-06515", device, create_info_loc.dot(Field::usage),
639638
"includes VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT and image height (%" PRIu32 ") is greater than %" PRIu32
640639
".\n"
641640
"This is ceiling value of maxFramebufferHeight (%" PRIu32 ") / minFragmentDensityTexelSize.height (%" PRIu32 ").",
642-
pCreateInfo->extent.height, ceiling_height, device_limits->maxFramebufferHeight,
641+
pCreateInfo->extent.height, ceiling_height, phys_dev_props.limits.maxFramebufferHeight,
643642
phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.height);
644643
}
645644
}

layers/core_checks/cc_pipeline_graphics.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4091,16 +4091,15 @@ bool CoreChecks::ValidatePipelineVertexDivisors(const vvl::Pipeline &pipeline, c
40914091
// Can use raw Pipeline state values because not using the stride (which can be dynamic with
40924092
// VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE)
40934093
const auto &binding_descriptions = pipeline.GraphicsCreateInfo().pVertexInputState->pVertexBindingDescriptions;
4094-
const auto &binding_desc_count = pipeline.GraphicsCreateInfo().pVertexInputState->vertexBindingDescriptionCount;
4095-
const VkPhysicalDeviceLimits *device_limits = &phys_dev_props.limits;
4094+
const auto& binding_desc_count = pipeline.GraphicsCreateInfo().pVertexInputState->vertexBindingDescriptionCount;
40964095
for (uint32_t j = 0; j < divisor_state_info->vertexBindingDivisorCount; j++) {
40974096
const Location divisor_loc =
40984097
vertex_input_loc.pNext(Struct::VkVertexInputBindingDivisorDescription, Field::pVertexBindingDivisors, j);
40994098
const auto *vibdd = &(divisor_state_info->pVertexBindingDivisors[j]);
4100-
if (vibdd->binding >= device_limits->maxVertexInputBindings) {
4099+
if (vibdd->binding >= phys_dev_props.limits.maxVertexInputBindings) {
41014100
skip |= LogError("VUID-VkVertexInputBindingDivisorDescription-binding-01869", device, divisor_loc.dot(Field::binding),
41024101
"(%" PRIu32 ") exceeds device maxVertexInputBindings (%" PRIu32 ").", vibdd->binding,
4103-
device_limits->maxVertexInputBindings);
4102+
phys_dev_props.limits.maxVertexInputBindings);
41044103
}
41054104
if (vibdd->divisor > phys_dev_props_core14.maxVertexAttribDivisor) {
41064105
skip |= LogError("VUID-VkVertexInputBindingDivisorDescription-divisor-01870", device, divisor_loc.dot(Field::divisor),

0 commit comments

Comments
 (0)