Skip to content
Snippets Groups Projects
Commit 348f7525 authored by Artur Wasmut's avatar Artur Wasmut
Browse files

add camera push constant.

parent 99b22389
No related branches found
No related tags found
1 merge request!74Resolve "Mesh Shader Implementation"
......@@ -7,12 +7,16 @@ layout(local_size_x=32) in;
layout(triangles) out;
layout(max_vertices=64, max_primitives=126) out;
layout( push_constant ) uniform constants{
mat4 mvp;
};
// out uint gl_PrimitiveCountNV;
// out uint gl_PrimitiveIndicesNV[];
out gl_MeshPerVertexNV {
vec4 gl_Position;
} gl_MeshVerticesNV[];
//out gl_MeshPerVertexNV {
// vec4 gl_Position;
//} gl_MeshVerticesNV[];
void main() {
if(gl_LocalInvocationID.x == 0)
......@@ -22,8 +26,8 @@ void main() {
gl_PrimitiveIndicesNV[1] = 1;
gl_PrimitiveIndicesNV[2] = 2;
gl_MeshVerticesNV[0].gl_Position = vec4(-0.5, 0.5, 0.5, 1);
gl_MeshVerticesNV[1].gl_Position = vec4( 0.5, 0.5, 0.5, 1);
gl_MeshVerticesNV[2].gl_Position = vec4( 0 , -0.5, 0.5, 1);
gl_MeshVerticesNV[0].gl_Position = mvp * vec4(-0.5, 0.5, 0.5, 1);
gl_MeshVerticesNV[1].gl_Position = mvp * vec4( 0.5, 0.5, 0.5, 1);
gl_MeshVerticesNV[2].gl_Position = mvp * vec4( 0 , -0.5, 0.5, 1);
}
}
\ No newline at end of file
......@@ -152,7 +152,7 @@ int main(int argc, const char** argv) {
cmdStream,
renderPass,
meshShaderPipeline,
vkcv::PushConstantData(nullptr, 0),
pushConstantData,
{ vkcv::MeshShaderDrawcall({}, 1) },
{ swapchainInput });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment