Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions layers/core_checks/cc_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,50 +596,49 @@ 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<uint32_t>(ceilf(
static_cast<float>(device_limits->maxFramebufferWidth) /
static_cast<float>(phys_dev_props.limits.maxFramebufferWidth) /
std::max(static_cast<float>(phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.width), 1.0f)));
if (pCreateInfo->extent.width > ceiling_width) {
skip |= LogError(
"VUID-VkImageCreateInfo-fragmentDensityMapOffset-06514", device, create_info_loc.dot(Field::usage),
"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<uint32_t>(ceilf(
static_cast<float>(device_limits->maxFramebufferHeight) /
static_cast<float>(phys_dev_props.limits.maxFramebufferHeight) /
std::max(static_cast<float>(phys_dev_ext_props.fragment_density_map_props.minFragmentDensityTexelSize.height), 1.0f)));
if (pCreateInfo->extent.height > ceiling_height) {
skip |= LogError(
"VUID-VkImageCreateInfo-fragmentDensityMapOffset-06515", device, create_info_loc.dot(Field::usage),
"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);
}
}
Expand Down
7 changes: 3 additions & 4 deletions layers/core_checks/cc_pipeline_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down