1 // 2 // Copyright 2016 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // GlslangWrapperVk: Wrapper for Vulkan's glslang compiler. 7 // 8 9 #ifndef LIBANGLE_RENDERER_VULKAN_GLSLANG_WRAPPER_H_ 10 #define LIBANGLE_RENDERER_VULKAN_GLSLANG_WRAPPER_H_ 11 12 #include "libANGLE/renderer/ProgramImpl.h" 13 #include "libANGLE/renderer/glslang_wrapper_utils.h" 14 #include "libANGLE/renderer/vulkan/vk_utils.h" 15 16 namespace angle 17 { 18 struct FeaturesVk; 19 } // namespace angle 20 21 namespace rx 22 { 23 // This class currently holds no state. If we want to hold state we would need to solve the 24 // potential race conditions with multiple threads. 25 class GlslangWrapperVk 26 { 27 public: 28 static GlslangSourceOptions CreateSourceOptions(const angle::FeaturesVk &features); 29 30 static void ResetGlslangProgramInterfaceInfo( 31 GlslangProgramInterfaceInfo *glslangProgramInterfaceInfo); 32 33 static void GetShaderCode(const angle::FeaturesVk &features, 34 const gl::ProgramState &programState, 35 const gl::ProgramLinkedResources &resources, 36 GlslangProgramInterfaceInfo *programInterfaceInfo, 37 gl::ShaderMap<const angle::spirv::Blob *> *spirvBlobsOut, 38 ShaderInterfaceVariableInfoMap *variableInfoMapOut); 39 40 static angle::Result TransformSpirV(const GlslangSpirvOptions &options, 41 const ShaderInterfaceVariableInfoMap &variableInfoMap, 42 const angle::spirv::Blob &initialSpirvBlob, 43 angle::spirv::Blob *shaderCodeOut); 44 }; 45 } // namespace rx 46 47 #endif // LIBANGLE_RENDERER_VULKAN_GLSLANG_WRAPPER_H_ 48