Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Dependencies
Cpp
mirrage
Commits
f89c2ca0
Commit
f89c2ca0
authored
Mar 26, 2019
by
Florian Oetke
Browse files
fixed move operators
parent
308a750e
Pipeline
#2688
passed with stage
in 9 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/mirrage/graphic/include/mirrage/graphic/vk_wrapper.hpp
View file @
f89c2ca0
...
...
@@ -56,7 +56,10 @@ namespace mirrage::graphic {
};
struct
Image_dimensions
{
Image_dimensions
(
std
::
int32_t
width
,
std
::
int32_t
height
,
std
::
int32_t
depth
,
std
::
int32_t
layers
)
Image_dimensions
(
std
::
int32_t
width
=
1
,
std
::
int32_t
height
=
1
,
std
::
int32_t
depth
=
1
,
std
::
int32_t
layers
=
1
)
:
width
(
width
),
height
(
height
),
depth
(
depth
),
layers
(
layers
)
{
}
...
...
@@ -71,22 +74,28 @@ namespace mirrage::graphic {
template
<
>
struct
Image_dimensions_t
<
Image_type
::
single_1d
>
:
Image_dimensions
{
Image_dimensions_t
(
std
::
int32_t
width
)
:
Image_dimensions
(
width
,
1
,
1
,
1
)
{}
Image_dimensions_t
(
std
::
int32_t
width
=
1
)
:
Image_dimensions
(
width
,
1
,
1
,
1
)
{}
};
template
<
>
struct
Image_dimensions_t
<
Image_type
::
single_2d
>
:
Image_dimensions
{
Image_dimensions_t
(
std
::
int32_t
width
,
std
::
int32_t
height
)
:
Image_dimensions
(
width
,
height
,
1
,
1
)
{}
Image_dimensions_t
(
std
::
int32_t
width
=
1
,
std
::
int32_t
height
=
1
)
:
Image_dimensions
(
width
,
height
,
1
,
1
)
{
}
};
template
<
>
struct
Image_dimensions_t
<
Image_type
::
array_2d
>
:
Image_dimensions
{
Image_dimensions_t
(
std
::
int32_t
width
,
std
::
int32_t
height
,
std
::
int32_t
layers
)
Image_dimensions_t
(
std
::
int32_t
width
=
1
,
std
::
int32_t
height
=
1
,
std
::
int32_t
layers
=
1
)
:
Image_dimensions
(
width
,
height
,
1
,
layers
)
{
}
};
template
<
>
struct
Image_dimensions_t
<
Image_type
::
cubemap
>
:
Image_dimensions
{
Image_dimensions_t
(
std
::
int32_t
width
,
std
::
int32_t
height
)
:
Image_dimensions
(
width
,
height
,
1
,
6
)
{}
Image_dimensions_t
(
std
::
int32_t
width
=
1
,
std
::
int32_t
height
=
1
)
:
Image_dimensions
(
width
,
height
,
1
,
6
)
{
}
};
...
...
@@ -123,7 +132,7 @@ namespace mirrage::graphic {
private:
friend
class
Device
;
const
vk
::
Device
&
_device
;
const
vk
::
Device
*
_device
;
vk
::
UniqueFence
_fence
;
Fence
(
const
vk
::
Device
&
device
,
bool
signaled
);
...
...
src/mirrage/graphic/src/vk_wrapper.cpp
View file @
f89c2ca0
...
...
@@ -30,14 +30,14 @@ namespace mirrage::graphic {
}
Fence
::
operator
bool
()
const
{
return
_device
.
getFenceStatus
(
*
_fence
)
==
vk
::
Result
::
eSuccess
;
}
void
Fence
::
reset
()
{
_device
.
resetFences
({
*
_fence
});
}
void
Fence
::
wait
()
{
_device
.
waitForFences
({
*
_fence
},
true
,
std
::
numeric_limits
<
std
::
uint64_t
>::
max
());
}
Fence
::
operator
bool
()
const
{
return
_device
->
getFenceStatus
(
*
_fence
)
==
vk
::
Result
::
eSuccess
;
}
void
Fence
::
reset
()
{
_device
->
resetFences
({
*
_fence
});
}
void
Fence
::
wait
()
{
_device
->
waitForFences
({
*
_fence
},
true
,
std
::
numeric_limits
<
std
::
uint64_t
>::
max
());
}
Fence
::
Fence
(
const
vk
::
Device
&
device
,
bool
signaled
)
:
_device
(
device
)
,
_fence
(
_device
.
createFenceUnique
({
signaled
?
vk
::
FenceCreateFlags
{
vk
::
FenceCreateFlagBits
::
eSignaled
}
:
vk
::
FenceCreateFlags
{}}))
:
_device
(
&
device
)
,
_fence
(
_device
->
createFenceUnique
({
signaled
?
vk
::
FenceCreateFlags
{
vk
::
FenceCreateFlagBits
::
eSignaled
}
:
vk
::
FenceCreateFlags
{}}))
{
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment