Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
b288f279
Commit
b288f279
authored
3 years ago
by
Alex Laptop
Browse files
Options
Downloads
Patches
Plain Diff
[
#105
] Sort out (some) of the vertex mess
parent
b01d37c7
No related branches found
No related tags found
1 merge request
!88
Resolve "Indirect Draw"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/draw_indirect/src/main.cpp
+1
-7
1 addition, 7 deletions
projects/draw_indirect/src/main.cpp
src/vkcv/VertexLayout.cpp
+1
-1
1 addition, 1 deletion
src/vkcv/VertexLayout.cpp
with
2 additions
and
8 deletions
projects/draw_indirect/src/main.cpp
+
1
−
7
View file @
b288f279
...
@@ -227,12 +227,7 @@ int main(int argc, const char** argv) {
...
@@ -227,12 +227,7 @@ int main(int argc, const char** argv) {
// vertex layout for the pipeline. (assumed to be) used by all sponza meshes.
// vertex layout for the pipeline. (assumed to be) used by all sponza meshes.
const
std
::
vector
<
vkcv
::
VertexAttachment
>
vertexAttachments
=
sponzaProgram
.
getVertexAttachments
();
const
std
::
vector
<
vkcv
::
VertexAttachment
>
vertexAttachments
=
sponzaProgram
.
getVertexAttachments
();
std
::
vector
<
vkcv
::
VertexBinding
>
bindings
;
const
vkcv
::
VertexLayout
sponzaVertexLayout
({
vkcv
::
VertexBinding
(
0
,
{
vertexAttachments
})
});
for
(
size_t
i
=
0
;
i
<
vertexAttachments
.
size
();
i
++
)
{
bindings
.
push_back
(
vkcv
::
VertexBinding
(
i
,
{
vertexAttachments
[
i
]
}));
}
const
vkcv
::
VertexLayout
sponzaVertexLayout
(
bindings
);
// recreation of VertexBufferBindings YET AGAIN,
// recreation of VertexBufferBindings YET AGAIN,
// since these are used in the command buffer to bind and draw from the vertex shaders
// since these are used in the command buffer to bind and draw from the vertex shaders
...
@@ -247,7 +242,6 @@ int main(int argc, const char** argv) {
...
@@ -247,7 +242,6 @@ int main(int argc, const char** argv) {
compiledIndexBuffer
,
compiledIndexBuffer
,
indexedIndirectCommands
);
indexedIndirectCommands
);
vkcv
::
Buffer
<
vk
::
DrawIndexedIndirectCommand
>
indirectBuffer
=
core
.
createBuffer
<
vk
::
DrawIndexedIndirectCommand
>
(
vkcv
::
Buffer
<
vk
::
DrawIndexedIndirectCommand
>
indirectBuffer
=
core
.
createBuffer
<
vk
::
DrawIndexedIndirectCommand
>
(
vkcv
::
BufferType
::
INDIRECT
,
vkcv
::
BufferType
::
INDIRECT
,
indexedIndirectCommands
.
size
()
*
sizeof
(
vk
::
DrawIndexedIndirectCommand
),
indexedIndirectCommands
.
size
()
*
sizeof
(
vk
::
DrawIndexedIndirectCommand
),
...
...
This diff is collapsed.
Click to expand it.
src/vkcv/VertexLayout.cpp
+
1
−
1
View file @
b288f279
...
@@ -46,8 +46,8 @@ namespace vkcv {
...
@@ -46,8 +46,8 @@ namespace vkcv {
uint32_t
offset
=
0
;
uint32_t
offset
=
0
;
for
(
auto
&
attachment
:
vertexAttachments
)
for
(
auto
&
attachment
:
vertexAttachments
)
{
{
offset
+=
getFormatSize
(
attachment
.
format
);
attachment
.
offset
=
offset
;
attachment
.
offset
=
offset
;
offset
+=
getFormatSize
(
attachment
.
format
);
}
}
stride
=
offset
;
stride
=
offset
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment