• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _VKTSHADEROBJECTCREATEUTIL_HPP
2 #define _VKTSHADEROBJECTCREATEUTIL_HPP
3 /*------------------------------------------------------------------------
4  * Vulkan Conformance Tests
5  * ------------------------
6  *
7  * Copyright (c) 2023 LunarG, Inc.
8  * Copyright (c) 2023 Nintendo
9  *
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
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
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.
21  *
22  *//*!
23  * \file
24  * \brief Utilities for vertex buffers.
25  *//*--------------------------------------------------------------------*/
26 
27 #include "vkRef.hpp"
28 #include "vkResourceInterface.hpp"
29 
30 namespace vk
31 {
32 
33 std::string				getShaderName						(vk::VkShaderStageFlagBits stage);
34 vk::VkShaderStageFlags	getShaderObjectNextStages			(vk::VkShaderStageFlagBits shaderStage, bool tessellationShaderFeature, bool geometryShaderFeature);
35 
36 Move<VkShaderEXT>		createShaderFromBinary				(const DeviceInterface& vk, VkDevice device, vk::VkShaderStageFlagBits shaderStage, size_t codeSize, const void* pCode, bool tessellationShaderFeature, bool geometryShaderFeature, vk::VkDescriptorSetLayout descriptorSetLayout);
37 Move<VkShaderEXT>		createShader						(const DeviceInterface& vk, VkDevice device, const vk::VkShaderCreateInfoEXT& shaderCreateInfo);
38 
39 void					addBasicShaderObjectShaders	(vk::SourceCollections& programCollection);
40 
41 vk::VkShaderCreateInfoEXT makeShaderCreateInfo				(vk::VkShaderStageFlagBits stage, const vk::ProgramBinary& programBinary, bool tessellationShaderFeature, bool geometryShaderFeature, const vk::VkDescriptorSetLayout* descriptorSetLayout = DE_NULL);
42 void					setDefaultShaderObjectDynamicStates	(const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, const std::vector<std::string>& deviceExtensions, vk::VkPrimitiveTopology topology = vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, bool meshShader = false, bool setViewport = false);
43 void					bindGraphicsShaders					(const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkShaderEXT vertShader, vk::VkShaderEXT tescShader, vk::VkShaderEXT teseShader, vk::VkShaderEXT geomShader, vk::VkShaderEXT fragShader, bool taskShaderSupported, bool meshShaderSupported);
44 void					bindComputeShader					(const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkShaderEXT compShader);
45 void					bindNullTaskMeshShaders				(const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkPhysicalDeviceMeshShaderFeaturesEXT meshShaderFeatures);
46 void					bindNullRasterizationShaders		(const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkPhysicalDeviceFeatures features);
47 
48 } // vkt
49 
50 #endif // _VKTSHADEROBJECTCREATEUTIL_HPP
51