summaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-04-24 08:58:52 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-04-24 11:02:37 -0600
commit06727c7f56d1080aff506a9ae1ae9d8c174b3e9d (patch)
tree46ed6c2783f741fee71e7167d4aa8030be61c684 /layers
parenta0cd07209eef7aaaac689c0b2c3ce1b2b4651c24 (diff)
layers: Final object-type cleanup and loose ends
Fixed a few DebugReport object type casts and a couple of missed spots with internal object type usage. Change-Id: Iaa8bdcf60d5ec89e1da64227f2b7367ce6c64dc1
Diffstat (limited to 'layers')
-rw-r--r--layers/core_validation.cpp14
-rw-r--r--layers/parameter_validation.cpp16
-rw-r--r--layers/unique_objects.cpp20
3 files changed, 25 insertions, 25 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 15ca79ea..fc048315 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3020,13 +3020,14 @@ static void UpdateDrawState(layer_data *dev_data, GLOBAL_CB_NODE *cb_state, cons
}
// Validate HW line width capabilities prior to setting requested line width.
-static bool verifyLineWidth(layer_data *dev_data, DRAW_STATE_ERROR dsError, VkDebugReportObjectTypeEXT object_type,
- const uint64_t &target, float lineWidth) {
+static bool verifyLineWidth(layer_data *dev_data, DRAW_STATE_ERROR dsError, VulkanObjectType object_type, const uint64_t &target,
+ float lineWidth) {
bool skip_call = false;
// First check to see if the physical device supports wide lines.
if ((VK_FALSE == dev_data->enabled_features.wideLines) && (1.0f != lineWidth)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, target, __LINE__, dsError, "DS",
+ skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target,
+ __LINE__, dsError, "DS",
"Attempt to set lineWidth to %f but physical device wideLines feature "
"not supported/enabled so lineWidth must be 1.0f!",
lineWidth);
@@ -3034,7 +3035,8 @@ static bool verifyLineWidth(layer_data *dev_data, DRAW_STATE_ERROR dsError, VkDe
// Otherwise, make sure the width falls in the valid range.
if ((dev_data->phys_dev_properties.properties.limits.lineWidthRange[0] > lineWidth) ||
(dev_data->phys_dev_properties.properties.limits.lineWidthRange[1] < lineWidth)) {
- skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, target, __LINE__, dsError, "DS",
+ skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, get_debug_report_enum[object_type], target,
+ __LINE__, dsError, "DS",
"Attempt to set lineWidth to %f but physical device limits line width "
"to between [%f, %f]!",
lineWidth, dev_data->phys_dev_properties.properties.limits.lineWidthRange[0],
@@ -3230,7 +3232,7 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE
if (!isDynamic(pPipeline, VK_DYNAMIC_STATE_LINE_WIDTH)) {
skip_call |=
verifyLineWidth(dev_data, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE,
- VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, reinterpret_cast<uint64_t const &>(pPipeline->pipeline),
+ kVulkanObjectTypePipeline, reinterpret_cast<uint64_t const &>(pPipeline->pipeline),
pPipeline->graphicsPipelineCI.pRasterizationState->lineWidth);
}
@@ -7121,7 +7123,7 @@ VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth(VkCommandBuffer commandBuffer, float
"flag. This is undefined behavior and could be ignored. %s",
validation_error_map[VALIDATION_ERROR_01476]);
} else {
- skip_call |= verifyLineWidth(dev_data, DRAWSTATE_INVALID_SET, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ skip_call |= verifyLineWidth(dev_data, DRAWSTATE_INVALID_SET, kVulkanObjectTypeCommandBuffer,
reinterpret_cast<uint64_t &>(commandBuffer), lineWidth);
}
}
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp
index ad074f0c..297f64ee 100644
--- a/layers/parameter_validation.cpp
+++ b/layers/parameter_validation.cpp
@@ -4730,19 +4730,19 @@ VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuff
skip |= parameter_validation_vkCmdUpdateBuffer(my_data->report_data, dstBuffer, dstOffset, dataSize, pData);
if (dstOffset & 3) {
- skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
+ skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
VALIDATION_ERROR_01147, LayerName,
"vkCmdUpdateBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s",
dstOffset, validation_error_map[VALIDATION_ERROR_01147]);
}
if ((dataSize <= 0) || (dataSize > 65536)) {
- skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
+ skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
VALIDATION_ERROR_01148, LayerName, "vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64
"), must be greater than zero and less than or equal to 65536. %s",
dataSize, validation_error_map[VALIDATION_ERROR_01148]);
} else if (dataSize & 3) {
- skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
+ skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
VALIDATION_ERROR_01149, LayerName,
"vkCmdUpdateBuffer() parameter, VkDeviceSize dataSize (0x%" PRIxLEAST64 "), is not a multiple of 4. %s",
dataSize, validation_error_map[VALIDATION_ERROR_01149]);
@@ -4762,7 +4762,7 @@ VKAPI_ATTR void VKAPI_CALL CmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer
skip |= parameter_validation_vkCmdFillBuffer(my_data->report_data, dstBuffer, dstOffset, size, data);
if (dstOffset & 3) {
- skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
+ skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__,
VALIDATION_ERROR_01133, LayerName,
"vkCmdFillBuffer() parameter, VkDeviceSize dstOffset (0x%" PRIxLEAST64 "), is not a multiple of 4. %s",
dstOffset, validation_error_map[VALIDATION_ERROR_01133]);
@@ -4770,13 +4770,13 @@ VKAPI_ATTR void VKAPI_CALL CmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer
if (size != VK_WHOLE_SIZE) {
if (size <= 0) {
- skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
- VALIDATION_ERROR_01134, LayerName,
+ skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01134, LayerName,
"vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), must be greater than zero. %s",
size, validation_error_map[VALIDATION_ERROR_01134]);
} else if (size & 3) {
- skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
- VALIDATION_ERROR_01136, LayerName,
+ skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01136, LayerName,
"vkCmdFillBuffer() parameter, VkDeviceSize size (0x%" PRIxLEAST64 "), is not a multiple of 4. %s", size,
validation_error_map[VALIDATION_ERROR_01136]);
}
diff --git a/layers/unique_objects.cpp b/layers/unique_objects.cpp
index d637ac64..0dc725c7 100644
--- a/layers/unique_objects.cpp
+++ b/layers/unique_objects.cpp
@@ -45,6 +45,7 @@
#include "vk_layer_utils.h"
#include "vk_enum_string_helper.h"
#include "vk_validation_error_messages.h"
+#include "vk_object_types.h"
#include "vulkan/vk_layer.h"
// This intentionally includes a cpp file
@@ -678,7 +679,7 @@ void *BuildUnwrappedUpdateTemplateBuffer(layer_data *dev_data, uint64_t descript
}
auto const &create_info = template_map_entry->second->create_info;
size_t allocation_size = 0;
- std::vector<std::tuple<size_t, VkDebugReportObjectTypeEXT, void *>> template_entries;
+ std::vector<std::tuple<size_t, VulkanObjectType, void *>> template_entries;
for (uint32_t i = 0; i < create_info.descriptorUpdateEntryCount; i++) {
for (uint32_t j = 0; j < create_info.pDescriptorUpdateEntries[i].descriptorCount; j++) {
@@ -699,8 +700,7 @@ void *BuildUnwrappedUpdateTemplateBuffer(layer_data *dev_data, uint64_t descript
dev_data->unique_id_mapping[reinterpret_cast<uint64_t &>(image_entry->sampler)]);
wrapped_entry->imageView = reinterpret_cast<VkImageView &>(
dev_data->unique_id_mapping[reinterpret_cast<uint64_t &>(image_entry->imageView)]);
- template_entries.emplace_back(offset, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT,
- reinterpret_cast<void *>(wrapped_entry));
+ template_entries.emplace_back(offset, kVulkanObjectTypeImage, reinterpret_cast<void *>(wrapped_entry));
} break;
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
@@ -713,8 +713,7 @@ void *BuildUnwrappedUpdateTemplateBuffer(layer_data *dev_data, uint64_t descript
VkDescriptorBufferInfo *wrapped_entry = new VkDescriptorBufferInfo(*buffer_entry);
wrapped_entry->buffer = reinterpret_cast<VkBuffer &>(
dev_data->unique_id_mapping[reinterpret_cast<uint64_t &>(buffer_entry->buffer)]);
- template_entries.emplace_back(offset, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT,
- reinterpret_cast<void *>(wrapped_entry));
+ template_entries.emplace_back(offset, kVulkanObjectTypeBuffer, reinterpret_cast<void *>(wrapped_entry));
} break;
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
@@ -723,8 +722,7 @@ void *BuildUnwrappedUpdateTemplateBuffer(layer_data *dev_data, uint64_t descript
allocation_size = std::max(allocation_size, offset + sizeof(VkBufferView));
uint64_t wrapped_entry = dev_data->unique_id_mapping[reinterpret_cast<uint64_t &>(*buffer_view_handle)];
- template_entries.emplace_back(offset, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT,
- reinterpret_cast<void *>(wrapped_entry));
+ template_entries.emplace_back(offset, kVulkanObjectTypeBufferView, reinterpret_cast<void *>(wrapped_entry));
} break;
default:
assert(0);
@@ -735,20 +733,20 @@ void *BuildUnwrappedUpdateTemplateBuffer(layer_data *dev_data, uint64_t descript
// Allocate required buffer size and populate with source/unwrapped data
void *unwrapped_data = malloc(allocation_size);
for (auto &this_entry : template_entries) {
- VkDebugReportObjectTypeEXT type = std::get<1>(this_entry);
+ VulkanObjectType type = std::get<1>(this_entry);
void *destination = (char *)unwrapped_data + std::get<0>(this_entry);
void *source = (char *)std::get<2>(this_entry);
switch (type) {
- case VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT:
+ case kVulkanObjectTypeImage:
*(reinterpret_cast<VkDescriptorImageInfo *>(destination)) = *(reinterpret_cast<VkDescriptorImageInfo *>(source));
delete reinterpret_cast<VkDescriptorImageInfo *>(source);
break;
- case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT:
+ case kVulkanObjectTypeBuffer:
*(reinterpret_cast<VkDescriptorBufferInfo *>(destination)) = *(reinterpret_cast<VkDescriptorBufferInfo *>(source));
delete reinterpret_cast<VkDescriptorBufferInfo *>(source);
break;
- case VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT:
+ case kVulkanObjectTypeBufferView:
*(reinterpret_cast<VkBufferView *>(destination)) = reinterpret_cast<VkBufferView>(source);
break;
default: