OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "vk/GrVkPipelineStateBuilder.h" | 8 #include "vk/GrVkPipelineStateBuilder.h" |
9 | 9 |
10 #include "vk/GrVkGpu.h" | 10 #include "vk/GrVkGpu.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 shaderString.append("\n"); | 92 shaderString.append("\n"); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 VkShaderModuleCreateInfo moduleCreateInfo; | 96 VkShaderModuleCreateInfo moduleCreateInfo; |
97 memset(&moduleCreateInfo, 0, sizeof(VkShaderModuleCreateInfo)); | 97 memset(&moduleCreateInfo, 0, sizeof(VkShaderModuleCreateInfo)); |
98 moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; | 98 moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; |
99 moduleCreateInfo.pNext = nullptr; | 99 moduleCreateInfo.pNext = nullptr; |
100 moduleCreateInfo.flags = 0; | 100 moduleCreateInfo.flags = 0; |
101 | 101 |
102 shaderc_compilation_result_t result; | 102 shaderc_compilation_result_t result = nullptr; |
103 | 103 |
104 if (gpu->vkCaps().canUseGLSLForShaderModule()) { | 104 if (gpu->vkCaps().canUseGLSLForShaderModule()) { |
105 moduleCreateInfo.codeSize = strlen(shaderString.c_str()); | 105 moduleCreateInfo.codeSize = strlen(shaderString.c_str()); |
106 moduleCreateInfo.pCode = (const uint32_t*)shaderString.c_str(); | 106 moduleCreateInfo.pCode = (const uint32_t*)shaderString.c_str(); |
107 } else { | 107 } else { |
108 | 108 |
109 shaderc_compiler_t compiler = gpu->shadercCompiler(); | 109 shaderc_compiler_t compiler = gpu->shadercCompiler(); |
110 | 110 |
111 shaderc_compile_options_t options = shaderc_compile_options_initialize()
; | 111 shaderc_compile_options_t options = shaderc_compile_options_initialize()
; |
112 shaderc_compile_options_set_forced_version_profile(options, 140, shaderc
_profile_none); | 112 shaderc_compile_options_set_forced_version_profile(options, 140, shaderc
_profile_none); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 dsLayout, | 295 dsLayout, |
296 fUniformHandles, | 296 fUniformHandles, |
297 fUniformHandler.fUniforms, | 297 fUniformHandler.fUniforms, |
298 fUniformHandler.fCurrentVertexUBOOffset, | 298 fUniformHandler.fCurrentVertexUBOOffset, |
299 fUniformHandler.fCurrentFragmentUBOOffset, | 299 fUniformHandler.fCurrentFragmentUBOOffset, |
300 numSamplers, | 300 numSamplers, |
301 fGeometryProcessor, | 301 fGeometryProcessor, |
302 fXferProcessor, | 302 fXferProcessor, |
303 fFragmentProcessors); | 303 fFragmentProcessors); |
304 } | 304 } |
OLD | NEW |