티스토리 뷰
먼넘의 문법이;
http://www.duskborn.com/wp-content/uploads/2015/03/AnIntroductionToSPIR-V.pdf
https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.pdf
3.32 Instructions
word count > opcode > result<id> > operands
실제 disasemble 에서 보이는건,
%5 = OpTypeFloat 32
%6 = OpTypeInt 32 0
%7 = OpTypeVector %5 4
%9 = OpConstant %5 0.4
%10 = OpConstant %5 0.8
%11 = OpConstant %6 1
%12 = OpConstantComposite %7 %9 %9 %10 %11
vec4(0.4, 0.4, 0.8, 1)
spirv_cross 사용한 reflection 설명
http://techblog.sega.jp/entry/2017/03/27/100000
https://github.com/khalladay/VkMaterialSystem/blob/master/ShaderPipeline/main.cpp
spirv_cross::CompilerGLSL glsl(ir, wordCount);
spirv_cross::ShaderResources resources = glsl.get_shader_resources();
for (spirv_cross::Resource res : resources.push_constant_buffers)
{
createUniformBlockForResource(&data.pushConstants, res, glsl);
}
https://github.com/KhronosGroup/SPIRV-Cross/wiki/Reflection-API-user-guide https://www.khronos.org/assets/uploads/developers/library/2018-vulkanised/04-SPIRVCross_Vulkanised2018.pdf https://www.khronos.org/assets/uploads/developers/library/2016-vulkan-devday-uk/4-Using-spir-v-with-spirv-cross.pdf
API가 좀 구리다
https://github.com/chaoticbob/SPIRV-Reflect
cross가 크다고 많이들 이야기하네;
http://kylehalladay.com/blog/tutorial/2017/11/27/Vulkan-Material-System.html
'Game > 작업일지' 카테고리의 다른 글
Vulkan 11 번째 - shader reflection (0) | 2018.12.05 |
---|---|
Vulkan 10 번째: 새로 시작 (0) | 2018.12.04 |
Vulkan 6 번째 메모리 타입 및 푸시디스크립터 (0) | 2018.11.23 |
SetStablePowerState (0) | 2018.11.23 |
Vulkan 5번째 timer (0) | 2018.11.22 |
- Total
- Today
- Yesterday