Added camera
Moved some math types Added some more vector types Did the camera matrix calulations Updated shaders to take push constants
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
VK_FUNC(CmdSetViewport);
|
||||
VK_FUNC(CmdSetScissor);
|
||||
|
||||
VK_FUNC(CmdPushConstants);
|
||||
VK_FUNC(CmdCopyBufferToImage);
|
||||
VK_FUNC(CmdPipelineBarrier2);
|
||||
VK_FUNC(CmdBeginRendering);
|
||||
|
||||
@@ -9,6 +9,11 @@ struct Vertex {
|
||||
uint pad;
|
||||
};
|
||||
|
||||
layout(push_constant, row_major)
|
||||
uniform Global {
|
||||
mat4 proj;
|
||||
};
|
||||
|
||||
layout(binding = 0, scalar)
|
||||
readonly buffer Vertices {
|
||||
Vertex vtx[];
|
||||
@@ -21,7 +26,7 @@ layout(location = 2) out flat uint idx;
|
||||
void main() {
|
||||
Vertex v = vtx[gl_VertexIndex];
|
||||
|
||||
gl_Position = v.p;
|
||||
gl_Position = proj * v.p;
|
||||
|
||||
frag_uv = v.uv;
|
||||
frag_c = vec4((v.c >> 24) & 0xFF, (v.c >> 16) & 0xFF, (v.c >> 8) & 0xFF, (v.c >> 0) & 0xFF) / 255.0f;
|
||||
|
||||
Reference in New Issue
Block a user