Visual Studio
[Vulkan] Push constants 본문
소량의 데이터를 빠르게 전달할 때 사용한다. 변환 행렬 등을 쉐이더로 넘길 때도 사용할 수 있다.
모든 쉐이더 단계에 데이터를 전송할 수 있다.
Command Buffer 자체에 저장되기 때문에 Command Buffer를 다시 만들지 않는 한 변경할 수 없다.
vkCmdPushConstants() 함수를 사용하여 데이터를 Command Buffer에 입력한다.
쉐이더에서는 다음과 같이 사용한다.
layout( push_constant ) uniform constants
{
vec4 data;
mat4 render_matrix;
} PushConstants;
'Graphics' 카테고리의 다른 글
[Vulkan] Tangent, Bitangent, Normal 시각화 (0) | 2024.11.09 |
---|---|
[Vulkan] Instanced Rendering 시에 Instance Buffer와 Storage Buffer의 성능 비교 (0) | 2024.10.23 |
Early depth testing, Early z pass (0) | 2024.09.17 |
[Vulkan] Primary Command Buffer vs Secondary Command Buffer (0) | 2024.09.17 |
DirectX 11 Pipeline Stage (0) | 2022.06.07 |