summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-09-22 07:30:05 -0600
committerTobin Ehlis <tobine@google.com>2016-09-22 07:30:05 -0600
commit12d5600c2f9e32343016fd944432ba95df370797 (patch)
tree3b3f66f058a603a65f7d752e3e3ac98caae6e41a
parent333b2211e317f6fefe2709a8514b18fcf3515839 (diff)
layers: A few minor clean-ups from code review
Better use of auto and killing some unneeded code.
-rw-r--r--layers/core_validation.cpp4
-rw-r--r--layers/core_validation_types.h2
-rw-r--r--tests/layer_validation_tests.cpp5
3 files changed, 3 insertions, 8 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 2d1214fb..df0e180a 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3730,7 +3730,7 @@ template <class OBJECT, class LAYOUT> void SetLayout(OBJECT *pObject, VkImage im
void SetLayout(const layer_data *dev_data, GLOBAL_CB_NODE *pCB, VkImageView imageView, const VkImageLayout &layout) {
auto view_state = getImageViewState(dev_data, imageView);
assert(view_state);
- const VkImage &image = view_state->create_info.image;
+ auto image = view_state->create_info.image;
const VkImageSubresourceRange &subRange = view_state->create_info.subresourceRange;
// TODO: Do not iterate over every possibility - consolidate where possible
for (uint32_t j = 0; j < subRange.levelCount; j++) {
@@ -9213,7 +9213,7 @@ static bool ValidateFramebufferCreateInfo(layer_data *dev_data, const VkFramebuf
const VkImageView *image_views = pCreateInfo->pAttachments;
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) {
auto view_state = getImageViewState(dev_data, image_views[i]);
- auto ivci = view_state->create_info;
+ auto &ivci = view_state->create_info;
if (ivci.format != rpci->pAttachments[i].format) {
skip_call |= log_msg(
dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h
index ff2cdbf8..5d38a1a4 100644
--- a/layers/core_validation_types.h
+++ b/layers/core_validation_types.h
@@ -162,7 +162,6 @@ class BUFFER_NODE : public BASE_NODE {
class BUFFER_VIEW_STATE : public BASE_NODE {
public:
- using BASE_NODE::in_use;
VkBufferView buffer_view;
VkBufferViewCreateInfo create_info;
BUFFER_VIEW_STATE() : buffer_view(VK_NULL_HANDLE), create_info{} {};
@@ -200,7 +199,6 @@ class IMAGE_NODE : public BASE_NODE {
class IMAGE_VIEW_STATE : public BASE_NODE {
public:
- using BASE_NODE::in_use;
VkImageView image_view;
VkImageViewCreateInfo create_info;
IMAGE_VIEW_STATE() : image_view(VK_NULL_HANDLE), create_info{} {};
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 2ffaa4e6..0ea2e696 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -6874,9 +6874,6 @@ TEST_F(VkLayerTest, FramebufferImageInUseDestroyedSignaled) {
VkFormatProperties format_properties;
VkResult err = VK_SUCCESS;
vkGetPhysicalDeviceFormatProperties(gpu(), VK_FORMAT_B8G8R8A8_UNORM, &format_properties);
- if (!(format_properties.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
- return;
- }
ASSERT_NO_FATAL_FAILURE(InitState());
ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
@@ -6893,7 +6890,7 @@ TEST_F(VkLayerTest, FramebufferImageInUseDestroyedSignaled) {
image_ci.arrayLayers = 1;
image_ci.samples = VK_SAMPLE_COUNT_1_BIT;
image_ci.tiling = VK_IMAGE_TILING_OPTIMAL;
- image_ci.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
+ image_ci.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
image_ci.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
image_ci.flags = 0;
VkImage image;