| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrVkUtil.h" | 8 #include "GrVkUtil.h" |
| 9 | 9 |
| 10 #include "vk/GrVkGpu.h" | 10 #include "vk/GrVkGpu.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 } | 305 } |
| 306 moduleCreateInfo.codeSize = code.size(); | 306 moduleCreateInfo.codeSize = code.size(); |
| 307 moduleCreateInfo.pCode = (const uint32_t*)code.c_str(); | 307 moduleCreateInfo.pCode = (const uint32_t*)code.c_str(); |
| 308 #else | 308 #else |
| 309 shaderc_compiler_t compiler = gpu->shadercCompiler(); | 309 shaderc_compiler_t compiler = gpu->shadercCompiler(); |
| 310 | 310 |
| 311 shaderc_compile_options_t options = shaderc_compile_options_initialize()
; | 311 shaderc_compile_options_t options = shaderc_compile_options_initialize()
; |
| 312 | 312 |
| 313 shaderc_shader_kind shadercStage = vk_shader_stage_to_shaderc_kind(stage
); | 313 shaderc_shader_kind shadercStage = vk_shader_stage_to_shaderc_kind(stage
); |
| 314 result = shaderc_compile_into_spv(compiler, | 314 result = shaderc_compile_into_spv(compiler, |
| 315 shaderString.c_str(), | 315 shaderString, |
| 316 strlen(shaderString), | 316 strlen(shaderString), |
| 317 shadercStage, | 317 shadercStage, |
| 318 "shader", | 318 "shader", |
| 319 "main", | 319 "main", |
| 320 options); | 320 options); |
| 321 shaderc_compile_options_release(options); | 321 shaderc_compile_options_release(options); |
| 322 #ifdef SK_DEBUG | 322 #ifdef SK_DEBUG |
| 323 if (shaderc_result_get_num_errors(result)) { | 323 if (shaderc_result_get_num_errors(result)) { |
| 324 SkDebugf("%s\n", shaderString); | 324 SkDebugf("%s\n", shaderString); |
| 325 SkDebugf("%s\n", shaderc_result_get_error_message(result)); | 325 SkDebugf("%s\n", shaderc_result_get_error_message(result)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 350 stageInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; | 350 stageInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; |
| 351 stageInfo->pNext = nullptr; | 351 stageInfo->pNext = nullptr; |
| 352 stageInfo->flags = 0; | 352 stageInfo->flags = 0; |
| 353 stageInfo->stage = stage; | 353 stageInfo->stage = stage; |
| 354 stageInfo->module = *shaderModule; | 354 stageInfo->module = *shaderModule; |
| 355 stageInfo->pName = "main"; | 355 stageInfo->pName = "main"; |
| 356 stageInfo->pSpecializationInfo = nullptr; | 356 stageInfo->pSpecializationInfo = nullptr; |
| 357 | 357 |
| 358 return true; | 358 return true; |
| 359 } | 359 } |
| OLD | NEW |