Commit 5c3c881c authored by Libretro-Admin's avatar Libretro-Admin
Browse files
parent 95ea0e1a
......@@ -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())
......
......@@ -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();
......
......@@ -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();
......
......@@ -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();
......
......@@ -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 };
......
......@@ -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; }
......
......@@ -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++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment