Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: gpu/vulkan/vulkan_shader_module.h

Issue 1975183003: Added Vulkan Shader Modules with GLSL->SPIR-V translation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check padding Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/vulkan/tests/vulkan_test.cc ('k') | gpu/vulkan/vulkan_shader_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_VULKAN_VULKAN_SHADER_MODULE_H_
6 #define GPU_VULKAN_VULKAN_SHADER_MODULE_H_
7
8 #include <string>
9 #include <vulkan/vulkan.h>
10
11 #include "base/macros.h"
12 #include "gpu/vulkan/vulkan_export.h"
13
14 namespace gpu {
15
16 class VulkanDeviceQueue;
17
18 class VULKAN_EXPORT VulkanShaderModule {
19 public:
20 enum class ShaderType {
21 VERTEX,
22 FRAGMENT,
23 };
24
25 VulkanShaderModule(VulkanDeviceQueue* device_queue);
26 ~VulkanShaderModule();
27
28 bool InitializeGLSL(ShaderType type,
29 std::string name,
30 std::string entry_point,
31 std::string source);
32 bool InitializeSPIRV(ShaderType type,
33 std::string name,
34 std::string entry_point,
35 std::string source);
36 void Destroy();
37
38 bool IsValid() const { return handle_ != VK_NULL_HANDLE; }
39 std::string GetErrorMessages() const { return error_messages_; }
40
41 ShaderType shader_type() const { return shader_type_; }
42 const std::string& name() const { return name_; }
43 VkShaderModule handle() const { return handle_; }
44 const std::string& entry_point() const { return entry_point_; }
45
46 private:
47 VulkanDeviceQueue* device_queue_ = nullptr;
48 ShaderType shader_type_ = ShaderType::VERTEX;
49 VkShaderModule handle_ = VK_NULL_HANDLE;
50 std::string name_;
51 std::string entry_point_;
52 std::string error_messages_;
53
54 DISALLOW_COPY_AND_ASSIGN(VulkanShaderModule);
55 };
56
57 } // namespace gpu
58
59 #endif // GPU_VULKAN_VULKAN_SHADER_MODULE_H_
OLDNEW
« no previous file with comments | « gpu/vulkan/tests/vulkan_test.cc ('k') | gpu/vulkan/vulkan_shader_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698