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
c174222a
Commit
c174222a
authored
3 years ago
by
Lars Hoerttrich
Browse files
Options
Downloads
Patches
Plain Diff
[
#22
] Bugfixes in Constructors
parent
1cbb3910
No related branches found
No related tags found
1 merge request
!18
Resolve "Resource Management"
Pipeline
#24750
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/vkcv/Buffer.hpp
+11
-13
11 additions, 13 deletions
include/vkcv/Buffer.hpp
with
11 additions
and
13 deletions
include/vkcv/Buffer.hpp
+
11
−
13
View file @
c174222a
...
@@ -34,26 +34,24 @@ namespace vkcv {
...
@@ -34,26 +34,24 @@ namespace vkcv {
// explicit destruction of default constructor
// explicit destruction of default constructor
Buffer
<
T
>
()
=
delete
;
Buffer
<
T
>
()
=
delete
;
// is never called directly
// is never called directly
~
Buffer
<
T
>
()
{
~
Buffer
<
T
>
()
noexcept
{
m_Device
.
freeMemory
(
m_BufferMemory
);
m_Device
.
freeMemory
(
m_BufferMemory
);
m_Device
.
destroyBuffer
(
m_Buffer
);
m_Device
.
destroyBuffer
(
m_Buffer
);
}
//noexcept; //gibt Fehlermeldung
}
Buffer
<
T
>
(
const
Buffer
<
T
>&
other
)
=
delete
;
// copy-ctor
Buffer
<
T
>
(
const
Buffer
<
T
>&
other
)
=
delete
;
// copy-ctor
Buffer
<
T
>
(
Buffer
<
T
>&&
other
)
{
Buffer
<
T
>
(
Buffer
<
T
>&&
other
)
noexcept
{
other
.
m_Buffer
=
nullptr
;
other
.
m_Buffer
=
nullptr
;
other
.
m_BufferMemory
=
nullptr
;
other
.
m_BufferMemory
=
nullptr
;
other
.
m_Device
=
nullptr
;
other
.
m_Device
=
nullptr
;
other
.
m_MemoryRequirement
=
nullptr
;
//
other.m_MemoryRequirement = nullptr;
// WIP alternative to nullptr has to be found
other
.
m_Type
=
vkcv
::
VERTEX
;
other
.
m_Type
=
vkcv
::
VERTEX
;
//set to 0
other
.
m_Size
=
0
;
other
.
m_Size
=
0
;
other
.
m_DataP
=
nullptr
;
other
.
m_DataP
=
nullptr
;
}
// move-ctor
return
*
this
;
}
//noexcept; // move-ctor
Buffer
<
T
>&
operator
=
(
const
Buffer
<
T
>&
other
)
=
delete
;
// copy assignment
Buffer
<
T
>&
operator
=
(
const
Buffer
<
T
>&
other
)
=
delete
;
// copy assignment
Buffer
<
T
>&
operator
=
(
Buffer
<
T
>&&
other
)
{
Buffer
<
T
>&
operator
=
(
Buffer
<
T
>&&
other
)
noexcept
{
m_Buffer
=
other
.
m_Buffer
;
m_Buffer
=
other
.
m_Buffer
;
m_BufferMemory
=
other
.
m_BufferMemory
;
m_BufferMemory
=
other
.
m_BufferMemory
;
m_Device
=
other
.
m_Device
;
m_Device
=
other
.
m_Device
;
...
@@ -65,17 +63,17 @@ namespace vkcv {
...
@@ -65,17 +63,17 @@ namespace vkcv {
other
.
m_Buffer
=
nullptr
;
other
.
m_Buffer
=
nullptr
;
other
.
m_BufferMemory
=
nullptr
;
other
.
m_BufferMemory
=
nullptr
;
other
.
m_Device
=
nullptr
;
other
.
m_Device
=
nullptr
;
other
.
m_MemoryRequirement
=
nullptr
;
//
other.m_MemoryRequirement = nullptr;
// WIP alternative to nullptr has to be found
other
.
m_Type
=
vkcv
::
VERTEX
;
other
.
m_Type
=
vkcv
::
VERTEX
;
//set to 0
other
.
m_Size
=
0
;
other
.
m_Size
=
0
;
other
.
m_DataP
=
nullptr
;
other
.
m_DataP
=
nullptr
;
}
//
noexcept; //
move assignment
}
// move assignment
BufferType
getType
()
{
return
m_Type
;
};
BufferType
getType
()
{
return
m_Type
;
};
size_t
getSize
()
{
return
m_Size
;
};
size_t
getSize
()
{
return
m_Size
;
};
//i'm not sure what the input argument has to be, WORK IN PROGRESS
//i'm not sure what
type
the input argument has to be, WORK IN PROGRESS
//TODO
//TODO
void
fill
(
void
*
data
)
{
void
fill
(
void
*
data
)
{
m_DataP
=
static_cast
<
uint8_t
*>
(
m_Device
.
mapMemory
(
m_BufferMemory
,
0
,
m_MemoryRequirement
.
size
));
m_DataP
=
static_cast
<
uint8_t
*>
(
m_Device
.
mapMemory
(
m_BufferMemory
,
0
,
m_MemoryRequirement
.
size
));
...
...
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