-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add test file for BP and move 1 test
Fix formatting issue Change-Id: I40d125805b7d41da7a4715e194dbe945e4f91591
- Loading branch information
1 parent
ca8f9cb
commit 29b16be
Showing
3 changed files
with
54 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2015-2019 The Khronos Group Inc. | ||
* Copyright (c) 2015-2019 Valve Corporation | ||
* Copyright (c) 2015-2019 LunarG, Inc. | ||
* Copyright (c) 2015-2019 Google, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Author: Camden Stocker <[email protected]> | ||
*/ | ||
|
||
#include "cast_utils.h" | ||
#include "layer_validation_tests.h" | ||
|
||
TEST_F(VkLayerTest, CmdClearAttachmentTest) { | ||
TEST_DESCRIPTION("Various tests for validating usage of vkCmdClearAttachments"); | ||
|
||
VkValidationFeatureEnableEXT enables[] = {VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT}; | ||
VkValidationFeaturesEXT features = {}; | ||
features.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT; | ||
features.enabledValidationFeatureCount = 1; | ||
features.pEnabledValidationFeatures = enables; | ||
InitFramework(myDbgFunc, m_errorMonitor, &features); | ||
InitState(); | ||
ASSERT_NO_FATAL_FAILURE(InitRenderTarget()); | ||
|
||
m_commandBuffer->begin(); | ||
m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); | ||
|
||
// Main thing we care about for this test is that the VkImage obj we're | ||
// clearing matches Color Attachment of FB | ||
// Also pass down other dummy params to keep driver and paramchecker happy | ||
VkClearAttachment color_attachment; | ||
color_attachment.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; | ||
color_attachment.clearValue.color.float32[0] = 1.0; | ||
color_attachment.clearValue.color.float32[1] = 1.0; | ||
color_attachment.clearValue.color.float32[2] = 1.0; | ||
color_attachment.clearValue.color.float32[3] = 1.0; | ||
color_attachment.colorAttachment = 0; | ||
VkClearRect clear_rect = {{{0, 0}, {(uint32_t)m_width, (uint32_t)m_height}}, 0, 1}; | ||
|
||
// Call for full-sized FB Color attachment prior to issuing a Draw | ||
m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, | ||
"UNASSIGNED-CoreValidation-DrawState-ClearCmdBeforeDraw"); | ||
vk::CmdClearAttachments(m_commandBuffer->handle(), 1, &color_attachment, 1, &clear_rect); | ||
m_errorMonitor->VerifyFound(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters