In my vertex shader i have this push constant:
layout(push_constant) uniform Push {
vec2 globalOffset;
vec2 globalScale;
int cols;
int rows;
float spacing;
} push;
I want to update globalOffset
and globalScale
quite often, but cols, rows and spacing only once at the beginning of the programm.
I just can’t get it to work, because i do not understand what components i need to do that.
Currently i have a workaround with
if (statistics.totalDrawFrames == 0)
setRuntimePushConstants(commandBuffer);
which is in my recordCommandBuffer()
function and just contains one vkCmdPushConstants(...)
call. It works, but it’s obviously bad to check every frame if it’s the very first frame.
What do i need to make a single time vkCmdPushConstants(...)
work?