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
3042e8c1
Commit
3042e8c1
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#66
] Put push constant data into struct
parent
fbbe5021
No related branches found
No related tags found
1 merge request
!54
Resolve "Cmd/Sync-Rework"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/vkcv/Core.hpp
+8
-2
8 additions, 2 deletions
include/vkcv/Core.hpp
projects/cmd_sync_test/src/main.cpp
+1
-2
1 addition, 2 deletions
projects/cmd_sync_test/src/main.cpp
src/vkcv/Core.cpp
+9
-3
9 additions, 3 deletions
src/vkcv/Core.cpp
with
18 additions
and
7 deletions
include/vkcv/Core.hpp
+
8
−
2
View file @
3042e8c1
...
@@ -37,6 +37,13 @@ namespace vkcv
...
@@ -37,6 +37,13 @@ namespace vkcv
size_t
indexCount
;
size_t
indexCount
;
};
};
struct
PushConstantData
{
inline
PushConstantData
(
void
*
data
,
size_t
sizePerDrawcall
)
:
data
(
data
),
sizePerDrawcall
(
sizePerDrawcall
){}
void
*
data
;
size_t
sizePerDrawcall
;
};
// forward declarations
// forward declarations
class
PassManager
;
class
PassManager
;
class
PipelineManager
;
class
PipelineManager
;
...
@@ -232,8 +239,7 @@ namespace vkcv
...
@@ -232,8 +239,7 @@ namespace vkcv
void
renderMesh
(
void
renderMesh
(
const
PassHandle
renderpassHandle
,
const
PassHandle
renderpassHandle
,
const
PipelineHandle
pipelineHandle
,
const
PipelineHandle
pipelineHandle
,
const
size_t
pushConstantSize
,
const
PushConstantData
&
pushConstantData
,
const
void
*
pushConstantData
,
const
Mesh
&
mesh
,
const
Mesh
&
mesh
,
const
std
::
vector
<
DescriptorSetUsage
>
&
descriptorSets
,
const
std
::
vector
<
DescriptorSetUsage
>
&
descriptorSets
,
const
std
::
vector
<
ImageHandle
>
&
renderTargets
);
const
std
::
vector
<
ImageHandle
>
&
renderTargets
);
...
...
This diff is collapsed.
Click to expand it.
projects/cmd_sync_test/src/main.cpp
+
1
−
2
View file @
3042e8c1
...
@@ -164,8 +164,7 @@ int main(int argc, const char** argv) {
...
@@ -164,8 +164,7 @@ int main(int argc, const char** argv) {
core
.
renderMesh
(
core
.
renderMesh
(
trianglePass
,
trianglePass
,
trianglePipeline
,
trianglePipeline
,
sizeof
(
mvp
),
vkcv
::
PushConstantData
((
void
*
)
&
mvp
,
sizeof
(
mvp
)),
&
mvp
,
boxMesh
,
boxMesh
,
{
vkcv
::
DescriptorSetUsage
(
0
,
descriptorSet
)
},
{
vkcv
::
DescriptorSetUsage
(
0
,
descriptorSet
)
},
{
swapchainInput
,
depthBuffer
});
{
swapchainInput
,
depthBuffer
});
...
...
This diff is collapsed.
Click to expand it.
src/vkcv/Core.cpp
+
9
−
3
View file @
3042e8c1
...
@@ -144,8 +144,7 @@ namespace vkcv
...
@@ -144,8 +144,7 @@ namespace vkcv
void
Core
::
renderMesh
(
void
Core
::
renderMesh
(
const
PassHandle
renderpassHandle
,
const
PassHandle
renderpassHandle
,
const
PipelineHandle
pipelineHandle
,
const
PipelineHandle
pipelineHandle
,
const
size_t
pushConstantSize
,
const
PushConstantData
&
pushConstantData
,
const
void
*
pushConstantData
,
const
Mesh
&
mesh
,
const
Mesh
&
mesh
,
const
std
::
vector
<
DescriptorSetUsage
>
&
descriptorSets
,
const
std
::
vector
<
DescriptorSetUsage
>
&
descriptorSets
,
const
std
::
vector
<
ImageHandle
>
&
renderTargets
)
{
const
std
::
vector
<
ImageHandle
>
&
renderTargets
)
{
...
@@ -273,7 +272,14 @@ namespace vkcv
...
@@ -273,7 +272,14 @@ namespace vkcv
const
vk
::
Buffer
indexBuffer
=
m_BufferManager
->
getBuffer
(
mesh
.
indexBuffer
);
const
vk
::
Buffer
indexBuffer
=
m_BufferManager
->
getBuffer
(
mesh
.
indexBuffer
);
cmdBuffer
.
bindIndexBuffer
(
indexBuffer
,
0
,
vk
::
IndexType
::
eUint16
);
//FIXME: choose proper size
cmdBuffer
.
bindIndexBuffer
(
indexBuffer
,
0
,
vk
::
IndexType
::
eUint16
);
//FIXME: choose proper size
cmdBuffer
.
pushConstants
(
pipelineLayout
,
vk
::
ShaderStageFlagBits
::
eAll
,
0
,
pushConstantSize
,
pushConstantData
);
cmdBuffer
.
pushConstants
(
pipelineLayout
,
vk
::
ShaderStageFlagBits
::
eAll
,
0
,
pushConstantData
.
sizePerDrawcall
,
pushConstantData
.
data
);
cmdBuffer
.
drawIndexed
(
mesh
.
indexCount
,
1
,
0
,
0
,
{});
cmdBuffer
.
drawIndexed
(
mesh
.
indexCount
,
1
,
0
,
0
,
{});
cmdBuffer
.
endRenderPass
();
cmdBuffer
.
endRenderPass
();
};
};
...
...
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