1 #ifndef _VKTDYNAMICSTATEBASECLASS_HPP
2 #define _VKTDYNAMICSTATEBASECLASS_HPP
3 /*------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2015 The Khronos Group Inc.
8 * Copyright (c) 2015 Intel Corporation
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 * \brief Dynamic State Tests - Base Class
25 *//*--------------------------------------------------------------------*/
27 #include "tcuDefs.hpp"
28 #include "vktTestCase.hpp"
30 #include "vktDynamicStateTestCaseUtil.hpp"
31 #include "vktDrawImageObjectUtil.hpp"
32 #include "vktDrawBufferObjectUtil.hpp"
33 #include "vktDrawCreateInfoUtil.hpp"
37 namespace DynamicState
40 class DynamicStateBaseClass : public TestInstance
43 DynamicStateBaseClass (Context& context, const char* vertexShaderName, const char* fragmentShaderName);
46 void initialize (void);
48 virtual void initPipeline (const vk::VkDevice device);
50 virtual tcu::TestStatus iterate (void);
52 void beginRenderPass (void);
54 void beginRenderPassWithClearColor (const vk::VkClearColorValue& clearColor);
56 void setDynamicViewportState (const deUint32 width,
57 const deUint32 height);
59 void setDynamicViewportState (deUint32 viewportCount,
60 const vk::VkViewport* pViewports,
61 const vk::VkRect2D* pScissors);
63 void setDynamicRasterizationState (const float lineWidth = 1.0f,
64 const float depthBiasConstantFactor = 0.0f,
65 const float depthBiasClamp = 0.0f,
66 const float depthBiasSlopeFactor = 0.0f);
68 void setDynamicBlendState (const float const1 = 0.0f, const float const2 = 0.0f,
69 const float const3 = 0.0f, const float const4 = 0.0f);
71 void setDynamicDepthStencilState (const float minDepthBounds = -1.0f,
72 const float maxDepthBounds = 1.0f,
73 const deUint32 stencilFrontCompareMask = 0xffffffffu,
74 const deUint32 stencilFrontWriteMask = 0xffffffffu,
75 const deUint32 stencilFrontReference = 0,
76 const deUint32 stencilBackCompareMask = 0xffffffffu,
77 const deUint32 stencilBackWriteMask = 0xffffffffu,
78 const deUint32 stencilBackReference = 0);
85 vk::VkFormat m_colorAttachmentFormat;
87 vk::VkPrimitiveTopology m_topology;
89 const vk::DeviceInterface& m_vk;
91 vk::Move<vk::VkPipeline> m_pipeline;
92 vk::Move<vk::VkPipelineLayout> m_pipelineLayout;
94 de::SharedPtr<Draw::Image> m_colorTargetImage;
95 vk::Move<vk::VkImageView> m_colorTargetView;
97 Draw::PipelineCreateInfo::VertexInputState m_vertexInputState;
98 de::SharedPtr<Draw::Buffer> m_vertexBuffer;
100 vk::Move<vk::VkCommandPool> m_cmdPool;
101 vk::Move<vk::VkCommandBuffer> m_cmdBuffer;
103 vk::Move<vk::VkFramebuffer> m_framebuffer;
104 vk::Move<vk::VkRenderPass> m_renderPass;
106 const std::string m_vertexShaderName;
107 const std::string m_fragmentShaderName;
108 std::vector<PositionColorVertex> m_data;
114 #endif // _VKTDYNAMICSTATEBASECLASS_HPP