Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
flycast
Commits
5c3c881c
Commit
5c3c881c
authored
Apr 11, 2021
by
Libretro-Admin
Browse files
Backport
https://github.com/flyinghead/flycast/commit/fe17d79e8da08692db31dd9b6610740b0f334a66
parent
95ea0e1a
Changes
7
Hide whitespace changes
Inline
Side-by-side
core/hw/sh4/dyna/blockmanager.cpp
View file @
5c3c881c
...
...
@@ -529,12 +529,12 @@ RuntimeBlockInfo::~RuntimeBlockInfo()
}
}
void
RuntimeBlockInfo
::
AddRef
(
RuntimeBlockInfoPtr
other
)
void
RuntimeBlockInfo
::
AddRef
(
const
RuntimeBlockInfoPtr
&
other
)
{
pre_refs
.
push_back
(
other
);
}
void
RuntimeBlockInfo
::
RemRef
(
RuntimeBlockInfoPtr
other
)
void
RuntimeBlockInfo
::
RemRef
(
const
RuntimeBlockInfoPtr
&
other
)
{
bm_List
::
iterator
it
=
std
::
find
(
pre_refs
.
begin
(),
pre_refs
.
end
(),
other
);
if
(
it
!=
pre_refs
.
end
())
...
...
core/hw/sh4/dyna/blockmanager.h
View file @
5c3c881c
...
...
@@ -77,8 +77,8 @@ struct RuntimeBlockInfo: RuntimeBlockInfo_Core
//predecessors references
vector
<
RuntimeBlockInfoPtr
>
pre_refs
;
void
AddRef
(
RuntimeBlockInfoPtr
other
);
void
RemRef
(
RuntimeBlockInfoPtr
other
);
void
AddRef
(
const
RuntimeBlockInfoPtr
&
other
);
void
RemRef
(
const
RuntimeBlockInfoPtr
&
other
);
void
Discard
();
void
UpdateRefs
();
...
...
core/rend/vulkan/buffer.cpp
View file @
5c3c881c
...
...
@@ -22,7 +22,7 @@
#include "utils.h"
#include "vulkan_context.h"
BufferData
::
BufferData
(
vk
::
DeviceSize
size
,
vk
::
BufferUsageFlags
usage
,
vk
::
MemoryPropertyFlags
propertyFlags
)
BufferData
::
BufferData
(
vk
::
DeviceSize
size
,
const
vk
::
BufferUsageFlags
&
usage
,
const
vk
::
MemoryPropertyFlags
&
propertyFlags
)
:
bufferSize
(
size
),
m_usage
(
usage
),
m_propertyFlags
(
propertyFlags
)
{
VulkanContext
*
context
=
VulkanContext
::
Instance
();
...
...
core/rend/vulkan/buffer.h
View file @
5c3c881c
...
...
@@ -24,8 +24,8 @@
struct
BufferData
{
BufferData
(
vk
::
DeviceSize
size
,
vk
::
BufferUsageFlags
usage
,
vk
::
MemoryPropertyFlags
propertyFlags
=
vk
::
MemoryPropertyFlagBits
::
eHostVisible
|
vk
::
MemoryPropertyFlagBits
::
eHostCoherent
);
BufferData
(
vk
::
DeviceSize
size
,
const
vk
::
BufferUsageFlags
&
usage
,
const
vk
::
MemoryPropertyFlags
&
propertyFlags
=
vk
::
MemoryPropertyFlagBits
::
eHostVisible
|
vk
::
MemoryPropertyFlagBits
::
eHostCoherent
);
~
BufferData
()
{
buffer
.
reset
();
...
...
core/rend/vulkan/texture.cpp
View file @
5c3c881c
...
...
@@ -226,8 +226,8 @@ void Texture::Init(u32 width, u32 height, vk::Format format, u32 dataSize, bool
CreateImage
(
imageTiling
,
usageFlags
,
initialLayout
,
vk
::
ImageAspectFlagBits
::
eColor
);
}
void
Texture
::
CreateImage
(
vk
::
ImageTiling
tiling
,
vk
::
ImageUsageFlags
usage
,
vk
::
ImageLayout
initialLayout
,
vk
::
ImageAspectFlags
aspectMask
)
void
Texture
::
CreateImage
(
vk
::
ImageTiling
tiling
,
const
vk
::
ImageUsageFlags
&
usage
,
vk
::
ImageLayout
initialLayout
,
const
vk
::
ImageAspectFlags
&
aspectMask
)
{
vk
::
ImageCreateInfo
imageCreateInfo
(
vk
::
ImageCreateFlags
(),
vk
::
ImageType
::
e2D
,
format
,
vk
::
Extent3D
(
extent
,
1
),
mipmapLevels
,
1
,
vk
::
SampleCountFlagBits
::
e1
,
tiling
,
usage
,
...
...
@@ -394,7 +394,7 @@ void Texture::GenerateMipmaps()
commandBuffer
.
pipelineBarrier
(
vk
::
PipelineStageFlagBits
::
eTransfer
,
vk
::
PipelineStageFlagBits
::
eFragmentShader
,
{},
nullptr
,
nullptr
,
barrier
);
}
void
FramebufferAttachment
::
Init
(
u32
width
,
u32
height
,
vk
::
Format
format
,
vk
::
ImageUsageFlags
usage
)
void
FramebufferAttachment
::
Init
(
u32
width
,
u32
height
,
vk
::
Format
format
,
const
vk
::
ImageUsageFlags
&
usage
)
{
this
->
format
=
format
;
this
->
extent
=
vk
::
Extent2D
{
width
,
height
};
...
...
core/rend/vulkan/texture.h
View file @
5c3c881c
...
...
@@ -52,8 +52,8 @@ public:
private:
void
Init
(
u32
width
,
u32
height
,
vk
::
Format
format
,
u32
dataSize
,
bool
mipmapped
,
bool
mipmapsIncluded
);
void
SetImage
(
u32
size
,
void
*
data
,
bool
isNew
,
bool
genMipmaps
);
void
CreateImage
(
vk
::
ImageTiling
tiling
,
vk
::
ImageUsageFlags
usage
,
vk
::
ImageLayout
initialLayout
,
vk
::
ImageAspectFlags
aspectMask
);
void
CreateImage
(
vk
::
ImageTiling
tiling
,
const
vk
::
ImageUsageFlags
&
usage
,
vk
::
ImageLayout
initialLayout
,
const
vk
::
ImageAspectFlags
&
aspectMask
);
void
GenerateMipmaps
();
vk
::
Format
format
=
vk
::
Format
::
eUndefined
;
...
...
@@ -118,7 +118,7 @@ public:
FramebufferAttachment
(
vk
::
PhysicalDevice
physicalDevice
,
vk
::
Device
device
)
:
format
(
vk
::
Format
::
eUndefined
),
physicalDevice
(
physicalDevice
),
device
(
device
)
{}
void
Init
(
u32
width
,
u32
height
,
vk
::
Format
format
,
vk
::
ImageUsageFlags
usage
);
void
Init
(
u32
width
,
u32
height
,
vk
::
Format
format
,
const
vk
::
ImageUsageFlags
&
usage
);
void
Reset
()
{
image
.
reset
();
imageView
.
reset
();
}
vk
::
ImageView
GetImageView
()
const
{
return
*
imageView
;
}
...
...
core/rend/vulkan/utils.h
View file @
5c3c881c
...
...
@@ -60,7 +60,7 @@ static inline vk::BlendFactor getBlendFactor(u32 instr, bool src)
}
}
static
inline
u32
findMemoryType
(
vk
::
PhysicalDeviceMemoryProperties
const
&
memoryProperties
,
u32
typeBits
,
vk
::
MemoryPropertyFlags
requirementsMask
)
static
inline
u32
findMemoryType
(
vk
::
PhysicalDeviceMemoryProperties
const
&
memoryProperties
,
u32
typeBits
,
const
vk
::
MemoryPropertyFlags
&
requirementsMask
)
{
u32
typeIndex
=
u32
(
~
0
);
for
(
u32
i
=
0
;
i
<
memoryProperties
.
memoryTypeCount
;
i
++
)
...
...
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