Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "GrVkUtil.h" |
| 9 | |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 10 | #include "vk/GrVkGpu.h" |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 11 | #include "SkSLCompiler.h" |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 12 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 13 | bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format) { |
| 14 | VkFormat dontCare; |
| 15 | if (!format) { |
| 16 | format = &dontCare; |
| 17 | } |
| 18 | |
| 19 | switch (config) { |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 20 | case kUnknown_GrPixelConfig: |
| 21 | return false; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 22 | case kRGBA_8888_GrPixelConfig: |
| 23 | *format = VK_FORMAT_R8G8B8A8_UNORM; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 24 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 25 | case kBGRA_8888_GrPixelConfig: |
| 26 | *format = VK_FORMAT_B8G8R8A8_UNORM; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 27 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 28 | case kSRGBA_8888_GrPixelConfig: |
| 29 | *format = VK_FORMAT_R8G8B8A8_SRGB; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 30 | return true; |
jvanverth | 9f37246 | 2016-04-06 06:08:59 -0700 | [diff] [blame] | 31 | case kSBGRA_8888_GrPixelConfig: |
| 32 | *format = VK_FORMAT_B8G8R8A8_SRGB; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 33 | return true; |
| 34 | case kRGBA_8888_sint_GrPixelConfig: |
| 35 | *format = VK_FORMAT_R8G8B8A8_SINT; |
| 36 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 37 | case kRGB_565_GrPixelConfig: |
| 38 | *format = VK_FORMAT_R5G6B5_UNORM_PACK16; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 39 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 40 | case kRGBA_4444_GrPixelConfig: |
egdaniel | 3fe0327 | 2016-08-15 10:59:17 -0700 | [diff] [blame] | 41 | // R4G4B4A4 is not required to be supported so we actually |
| 42 | // store the data is if it was B4G4R4A4 and swizzle in shaders |
| 43 | *format = VK_FORMAT_B4G4R4A4_UNORM_PACK16; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 44 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 45 | case kIndex_8_GrPixelConfig: |
jvanverth | 9f37246 | 2016-04-06 06:08:59 -0700 | [diff] [blame] | 46 | // No current vulkan support for this config |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 47 | return false; |
| 48 | case kAlpha_8_GrPixelConfig: |
| 49 | *format = VK_FORMAT_R8_UNORM; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 50 | return true; |
Brian Osman | 986563b | 2017-01-10 14:20:02 -0500 | [diff] [blame^] | 51 | case kGray_8_GrPixelConfig: |
| 52 | *format = VK_FORMAT_R8_UNORM; |
| 53 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 54 | case kETC1_GrPixelConfig: |
| 55 | // converting to ETC2 which is a superset of ETC1 |
| 56 | *format = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 57 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 58 | case kLATC_GrPixelConfig: |
jvanverth | 9f37246 | 2016-04-06 06:08:59 -0700 | [diff] [blame] | 59 | // No current vulkan support for this config |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 60 | return false; |
| 61 | case kR11_EAC_GrPixelConfig: |
| 62 | *format = VK_FORMAT_EAC_R11_UNORM_BLOCK; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 63 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 64 | case kASTC_12x12_GrPixelConfig: |
| 65 | *format = VK_FORMAT_ASTC_12x12_UNORM_BLOCK; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 66 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 67 | case kRGBA_float_GrPixelConfig: |
| 68 | *format = VK_FORMAT_R32G32B32A32_SFLOAT; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 69 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 70 | case kRGBA_half_GrPixelConfig: |
| 71 | *format = VK_FORMAT_R16G16B16A16_SFLOAT; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 72 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 73 | case kAlpha_half_GrPixelConfig: |
| 74 | *format = VK_FORMAT_R16_SFLOAT; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 75 | return true; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 76 | } |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 77 | SkFAIL("Unexpected config"); |
| 78 | return false; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 79 | } |
| 80 | |
jvanverth | 9f37246 | 2016-04-06 06:08:59 -0700 | [diff] [blame] | 81 | bool GrVkFormatToPixelConfig(VkFormat format, GrPixelConfig* config) { |
| 82 | GrPixelConfig dontCare; |
| 83 | if (!config) { |
| 84 | config = &dontCare; |
| 85 | } |
| 86 | |
| 87 | switch (format) { |
| 88 | case VK_FORMAT_R8G8B8A8_UNORM: |
| 89 | *config = kRGBA_8888_GrPixelConfig; |
| 90 | break; |
| 91 | case VK_FORMAT_B8G8R8A8_UNORM: |
| 92 | *config = kBGRA_8888_GrPixelConfig; |
| 93 | break; |
| 94 | case VK_FORMAT_R8G8B8A8_SRGB: |
| 95 | *config = kSRGBA_8888_GrPixelConfig; |
| 96 | break; |
| 97 | case VK_FORMAT_B8G8R8A8_SRGB: |
| 98 | *config = kSBGRA_8888_GrPixelConfig; |
| 99 | break; |
Brian Salomon | bf7b620 | 2016-11-11 16:08:03 -0500 | [diff] [blame] | 100 | case VK_FORMAT_R8G8B8A8_SINT: |
| 101 | *config = kRGBA_8888_sint_GrPixelConfig; |
| 102 | break; |
jvanverth | 9f37246 | 2016-04-06 06:08:59 -0700 | [diff] [blame] | 103 | case VK_FORMAT_R5G6B5_UNORM_PACK16: |
| 104 | *config = kRGB_565_GrPixelConfig; |
| 105 | break; |
egdaniel | 3fe0327 | 2016-08-15 10:59:17 -0700 | [diff] [blame] | 106 | case VK_FORMAT_B4G4R4A4_UNORM_PACK16: |
| 107 | // R4G4B4A4 is not required to be supported so we actually |
| 108 | // store RGBA_4444 data as B4G4R4A4. |
jvanverth | 9f37246 | 2016-04-06 06:08:59 -0700 | [diff] [blame] | 109 | *config = kRGBA_4444_GrPixelConfig; |
| 110 | break; |
| 111 | case VK_FORMAT_R8_UNORM: |
| 112 | *config = kAlpha_8_GrPixelConfig; |
| 113 | break; |
| 114 | case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: |
| 115 | *config = kETC1_GrPixelConfig; |
| 116 | break; |
| 117 | case VK_FORMAT_EAC_R11_UNORM_BLOCK: |
| 118 | *config = kR11_EAC_GrPixelConfig; |
| 119 | break; |
| 120 | case VK_FORMAT_ASTC_12x12_UNORM_BLOCK: |
| 121 | *config = kASTC_12x12_GrPixelConfig; |
| 122 | break; |
| 123 | case VK_FORMAT_R32G32B32A32_SFLOAT: |
| 124 | *config = kRGBA_float_GrPixelConfig; |
| 125 | break; |
| 126 | case VK_FORMAT_R16G16B16A16_SFLOAT: |
| 127 | *config = kRGBA_half_GrPixelConfig; |
| 128 | break; |
| 129 | case VK_FORMAT_R16_SFLOAT: |
| 130 | *config = kAlpha_half_GrPixelConfig; |
| 131 | break; |
| 132 | default: |
| 133 | return false; |
| 134 | } |
| 135 | return true; |
| 136 | } |
| 137 | |
brianosman | f05ab1b | 2016-05-12 11:01:10 -0700 | [diff] [blame] | 138 | bool GrVkFormatIsSRGB(VkFormat format, VkFormat* linearFormat) { |
| 139 | VkFormat linearFmt = format; |
| 140 | switch (format) { |
| 141 | case VK_FORMAT_R8_SRGB: |
| 142 | linearFmt = VK_FORMAT_R8_UNORM; |
| 143 | break; |
| 144 | case VK_FORMAT_R8G8_SRGB: |
| 145 | linearFmt = VK_FORMAT_R8G8_UNORM; |
| 146 | break; |
| 147 | case VK_FORMAT_R8G8B8_SRGB: |
| 148 | linearFmt = VK_FORMAT_R8G8B8_UNORM; |
| 149 | break; |
| 150 | case VK_FORMAT_B8G8R8_SRGB: |
| 151 | linearFmt = VK_FORMAT_B8G8R8_UNORM; |
| 152 | break; |
| 153 | case VK_FORMAT_R8G8B8A8_SRGB: |
| 154 | linearFmt = VK_FORMAT_R8G8B8A8_UNORM; |
| 155 | break; |
| 156 | case VK_FORMAT_B8G8R8A8_SRGB: |
| 157 | linearFmt = VK_FORMAT_B8G8R8A8_UNORM; |
| 158 | break; |
| 159 | case VK_FORMAT_A8B8G8R8_SRGB_PACK32: |
| 160 | linearFmt = VK_FORMAT_A8B8G8R8_UNORM_PACK32; |
| 161 | break; |
| 162 | case VK_FORMAT_BC1_RGB_SRGB_BLOCK: |
| 163 | linearFmt = VK_FORMAT_BC1_RGB_UNORM_BLOCK; |
| 164 | break; |
| 165 | case VK_FORMAT_BC1_RGBA_SRGB_BLOCK: |
| 166 | linearFmt = VK_FORMAT_BC1_RGBA_UNORM_BLOCK; |
| 167 | break; |
| 168 | case VK_FORMAT_BC2_SRGB_BLOCK: |
| 169 | linearFmt = VK_FORMAT_BC2_UNORM_BLOCK; |
| 170 | break; |
| 171 | case VK_FORMAT_BC3_SRGB_BLOCK: |
| 172 | linearFmt = VK_FORMAT_BC3_UNORM_BLOCK; |
| 173 | break; |
| 174 | case VK_FORMAT_BC7_SRGB_BLOCK: |
| 175 | linearFmt = VK_FORMAT_BC7_UNORM_BLOCK; |
| 176 | break; |
| 177 | case VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: |
| 178 | linearFmt = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK; |
| 179 | break; |
| 180 | case VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: |
| 181 | linearFmt = VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK; |
| 182 | break; |
| 183 | case VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: |
| 184 | linearFmt = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; |
| 185 | break; |
| 186 | case VK_FORMAT_ASTC_4x4_SRGB_BLOCK: |
| 187 | linearFmt = VK_FORMAT_ASTC_4x4_UNORM_BLOCK; |
| 188 | break; |
| 189 | case VK_FORMAT_ASTC_5x4_SRGB_BLOCK: |
| 190 | linearFmt = VK_FORMAT_ASTC_5x4_UNORM_BLOCK; |
| 191 | break; |
| 192 | case VK_FORMAT_ASTC_5x5_SRGB_BLOCK: |
| 193 | linearFmt = VK_FORMAT_ASTC_5x5_UNORM_BLOCK; |
| 194 | break; |
| 195 | case VK_FORMAT_ASTC_6x5_SRGB_BLOCK: |
| 196 | linearFmt = VK_FORMAT_ASTC_6x5_UNORM_BLOCK; |
| 197 | break; |
| 198 | case VK_FORMAT_ASTC_6x6_SRGB_BLOCK: |
| 199 | linearFmt = VK_FORMAT_ASTC_6x6_UNORM_BLOCK; |
| 200 | break; |
| 201 | case VK_FORMAT_ASTC_8x5_SRGB_BLOCK: |
| 202 | linearFmt = VK_FORMAT_ASTC_8x5_UNORM_BLOCK; |
| 203 | break; |
| 204 | case VK_FORMAT_ASTC_8x6_SRGB_BLOCK: |
| 205 | linearFmt = VK_FORMAT_ASTC_8x6_UNORM_BLOCK; |
| 206 | break; |
| 207 | case VK_FORMAT_ASTC_8x8_SRGB_BLOCK: |
| 208 | linearFmt = VK_FORMAT_ASTC_8x8_UNORM_BLOCK; |
| 209 | break; |
| 210 | case VK_FORMAT_ASTC_10x5_SRGB_BLOCK: |
| 211 | linearFmt = VK_FORMAT_ASTC_10x5_UNORM_BLOCK; |
| 212 | break; |
| 213 | case VK_FORMAT_ASTC_10x6_SRGB_BLOCK: |
| 214 | linearFmt = VK_FORMAT_ASTC_10x6_UNORM_BLOCK; |
| 215 | break; |
| 216 | case VK_FORMAT_ASTC_10x8_SRGB_BLOCK: |
| 217 | linearFmt = VK_FORMAT_ASTC_10x8_UNORM_BLOCK; |
| 218 | break; |
| 219 | case VK_FORMAT_ASTC_10x10_SRGB_BLOCK: |
| 220 | linearFmt = VK_FORMAT_ASTC_10x10_UNORM_BLOCK; |
| 221 | break; |
| 222 | case VK_FORMAT_ASTC_12x10_SRGB_BLOCK: |
| 223 | linearFmt = VK_FORMAT_ASTC_12x10_UNORM_BLOCK; |
| 224 | break; |
| 225 | case VK_FORMAT_ASTC_12x12_SRGB_BLOCK: |
| 226 | linearFmt = VK_FORMAT_ASTC_12x12_UNORM_BLOCK; |
| 227 | break; |
| 228 | default: |
| 229 | break; |
| 230 | } |
| 231 | if (linearFormat) { |
| 232 | *linearFormat = linearFmt; |
| 233 | } |
| 234 | return (linearFmt != format); |
| 235 | } |
| 236 | |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 237 | bool GrSampleCountToVkSampleCount(uint32_t samples, VkSampleCountFlagBits* vkSamples) { |
| 238 | switch (samples) { |
| 239 | case 0: // fall through |
| 240 | case 1: |
| 241 | *vkSamples = VK_SAMPLE_COUNT_1_BIT; |
| 242 | return true; |
| 243 | case 2: |
| 244 | *vkSamples = VK_SAMPLE_COUNT_2_BIT; |
| 245 | return true; |
| 246 | case 4: |
egdaniel | bf63e61 | 2016-08-17 06:26:16 -0700 | [diff] [blame] | 247 | *vkSamples = VK_SAMPLE_COUNT_4_BIT; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 248 | return true; |
| 249 | case 8: |
egdaniel | bf63e61 | 2016-08-17 06:26:16 -0700 | [diff] [blame] | 250 | *vkSamples = VK_SAMPLE_COUNT_8_BIT; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 251 | return true; |
| 252 | case 16: |
egdaniel | bf63e61 | 2016-08-17 06:26:16 -0700 | [diff] [blame] | 253 | *vkSamples = VK_SAMPLE_COUNT_16_BIT; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 254 | return true; |
| 255 | case 32: |
egdaniel | bf63e61 | 2016-08-17 06:26:16 -0700 | [diff] [blame] | 256 | *vkSamples = VK_SAMPLE_COUNT_32_BIT; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 257 | return true; |
| 258 | case 64: |
egdaniel | bf63e61 | 2016-08-17 06:26:16 -0700 | [diff] [blame] | 259 | *vkSamples = VK_SAMPLE_COUNT_64_BIT; |
Greg Daniel | 164a9f0 | 2016-02-22 09:56:40 -0500 | [diff] [blame] | 260 | return true; |
| 261 | default: |
| 262 | return false; |
| 263 | } |
| 264 | } |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 265 | |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 266 | SkSL::Program::Kind vk_shader_stage_to_skiasl_kind(VkShaderStageFlagBits stage) { |
| 267 | if (VK_SHADER_STAGE_VERTEX_BIT == stage) { |
| 268 | return SkSL::Program::kVertex_Kind; |
| 269 | } |
| 270 | SkASSERT(VK_SHADER_STAGE_FRAGMENT_BIT == stage); |
| 271 | return SkSL::Program::kFragment_Kind; |
| 272 | } |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 273 | |
| 274 | VkShaderStageFlagBits skiasl_kind_to_vk_shader_stage(SkSL::Program::Kind kind) { |
| 275 | if (SkSL::Program::kVertex_Kind == kind) { |
| 276 | return VK_SHADER_STAGE_VERTEX_BIT; |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 277 | } |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 278 | SkASSERT(SkSL::Program::kFragment_Kind == kind); |
| 279 | return VK_SHADER_STAGE_FRAGMENT_BIT; |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 280 | } |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 281 | |
| 282 | bool GrCompileVkShaderModule(const GrVkGpu* gpu, |
| 283 | const char* shaderString, |
| 284 | VkShaderStageFlagBits stage, |
| 285 | VkShaderModule* shaderModule, |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 286 | VkPipelineShaderStageCreateInfo* stageInfo, |
| 287 | const SkSL::Program::Settings& settings, |
| 288 | SkSL::Program::Inputs* outInputs) { |
| 289 | std::unique_ptr<SkSL::Program> program = gpu->shaderCompiler()->convertProgram( |
| 290 | vk_shader_stage_to_skiasl_kind(stage), |
| 291 | SkString(shaderString), |
| 292 | settings); |
| 293 | if (!program) { |
| 294 | SkDebugf("SkSL error:\n%s\n", gpu->shaderCompiler()->errorText().c_str()); |
| 295 | SkASSERT(false); |
| 296 | } |
| 297 | *outInputs = program->fInputs; |
| 298 | SkString code; |
| 299 | if (!gpu->shaderCompiler()->toSPIRV(*program, &code)) { |
| 300 | SkDebugf("%s\n", gpu->shaderCompiler()->errorText().c_str()); |
| 301 | return false; |
| 302 | } |
| 303 | |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 304 | VkShaderModuleCreateInfo moduleCreateInfo; |
| 305 | memset(&moduleCreateInfo, 0, sizeof(VkShaderModuleCreateInfo)); |
| 306 | moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; |
| 307 | moduleCreateInfo.pNext = nullptr; |
| 308 | moduleCreateInfo.flags = 0; |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 309 | moduleCreateInfo.codeSize = code.size(); |
| 310 | moduleCreateInfo.pCode = (const uint32_t*)code.c_str(); |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 311 | |
| 312 | VkResult err = GR_VK_CALL(gpu->vkInterface(), CreateShaderModule(gpu->device(), |
| 313 | &moduleCreateInfo, |
| 314 | nullptr, |
| 315 | shaderModule)); |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 316 | if (err) { |
| 317 | return false; |
| 318 | } |
| 319 | |
| 320 | memset(stageInfo, 0, sizeof(VkPipelineShaderStageCreateInfo)); |
| 321 | stageInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; |
| 322 | stageInfo->pNext = nullptr; |
| 323 | stageInfo->flags = 0; |
Ethan Nicholas | 941e7e2 | 2016-12-12 15:33:30 -0500 | [diff] [blame] | 324 | stageInfo->stage = skiasl_kind_to_vk_shader_stage(program->fKind); |
egdaniel | 88987d8 | 2016-09-19 10:17:34 -0700 | [diff] [blame] | 325 | stageInfo->module = *shaderModule; |
| 326 | stageInfo->pName = "main"; |
| 327 | stageInfo->pSpecializationInfo = nullptr; |
| 328 | |
| 329 | return true; |
| 330 | } |