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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #else | 86 #else |
87 shaderc_shader_kind vk_shader_stage_to_shaderc_kind(VkShaderStageFlagBits stage)
{ | 87 shaderc_shader_kind vk_shader_stage_to_shaderc_kind(VkShaderStageFlagBits stage)
{ |
88 if (VK_SHADER_STAGE_VERTEX_BIT == stage) { | 88 if (VK_SHADER_STAGE_VERTEX_BIT == stage) { |
89 return shaderc_glsl_vertex_shader; | 89 return shaderc_glsl_vertex_shader; |
90 } | 90 } |
91 SkASSERT(VK_SHADER_STAGE_FRAGMENT_BIT == stage); | 91 SkASSERT(VK_SHADER_STAGE_FRAGMENT_BIT == stage); |
92 return shaderc_glsl_fragment_shader; | 92 return shaderc_glsl_fragment_shader; |
93 } | 93 } |
94 #endif | 94 #endif |
95 | 95 |
| 96 #include <fstream> |
| 97 #include <sstream> |
96 bool GrVkPipelineStateBuilder::CreateVkShaderModule(const GrVkGpu* gpu, | 98 bool GrVkPipelineStateBuilder::CreateVkShaderModule(const GrVkGpu* gpu, |
97 VkShaderStageFlagBits stage, | 99 VkShaderStageFlagBits stage, |
98 const GrGLSLShaderBuilder& b
uilder, | 100 const GrGLSLShaderBuilder& b
uilder, |
99 VkShaderModule* shaderModule
, | 101 VkShaderModule* shaderModule
, |
100 VkPipelineShaderStageCreateI
nfo* stageInfo) { | 102 VkPipelineShaderStageCreateI
nfo* stageInfo) { |
101 SkString shaderString; | 103 SkString shaderString; |
102 for (int i = 0; i < builder.fCompilerStrings.count(); ++i) { | 104 for (int i = 0; i < builder.fCompilerStrings.count(); ++i) { |
103 if (builder.fCompilerStrings[i]) { | 105 if (builder.fCompilerStrings[i]) { |
104 shaderString.append(builder.fCompilerStrings[i]); | 106 shaderString.append(builder.fCompilerStrings[i]); |
105 shaderString.append("\n"); | 107 shaderString.append("\n"); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 dsLayout[GrVkUniformHandler::kSamplerDescSet], | 300 dsLayout[GrVkUniformHandler::kSamplerDescSet], |
299 fUniformHandles, | 301 fUniformHandles, |
300 fUniformHandler.fUniforms, | 302 fUniformHandler.fUniforms, |
301 fUniformHandler.fCurrentVertexUBOOffset, | 303 fUniformHandler.fCurrentVertexUBOOffset, |
302 fUniformHandler.fCurrentFragmentUBOOffset, | 304 fUniformHandler.fCurrentFragmentUBOOffset, |
303 numSamplers, | 305 numSamplers, |
304 fGeometryProcessor, | 306 fGeometryProcessor, |
305 fXferProcessor, | 307 fXferProcessor, |
306 fFragmentProcessors); | 308 fFragmentProcessors); |
307 } | 309 } |
OLD | NEW |