mirror of https://github.com/snes9xgit/snes9x.git
Vulkan: Favor default initializers.
This commit is contained in:
parent
932b093d98
commit
170a6aa1a4
|
@ -19,14 +19,6 @@
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::to_string;
|
using std::to_string;
|
||||||
|
|
||||||
SlangPreset::SlangPreset()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
SlangPreset::~SlangPreset()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SlangPreset::load_preset_file(string filename)
|
bool SlangPreset::load_preset_file(string filename)
|
||||||
{
|
{
|
||||||
if (!ends_with(filename, ".slangp"))
|
if (!ends_with(filename, ".slangp"))
|
||||||
|
|
|
@ -7,9 +7,6 @@
|
||||||
|
|
||||||
struct SlangPreset
|
struct SlangPreset
|
||||||
{
|
{
|
||||||
SlangPreset();
|
|
||||||
~SlangPreset();
|
|
||||||
|
|
||||||
void print();
|
void print();
|
||||||
bool load_preset_file(std::string filename);
|
bool load_preset_file(std::string filename);
|
||||||
bool introspect();
|
bool introspect();
|
||||||
|
|
|
@ -4,14 +4,6 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
|
|
||||||
IniFile::IniFile()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
IniFile::~IniFile()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string trim_comments(std::string str)
|
static std::string trim_comments(std::string str)
|
||||||
{
|
{
|
||||||
for (auto &comment : { "//", "#" })
|
for (auto &comment : { "//", "#" })
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
struct IniFile
|
struct IniFile
|
||||||
{
|
{
|
||||||
IniFile();
|
|
||||||
~IniFile();
|
|
||||||
bool load_file(std::string filename);
|
bool load_file(std::string filename);
|
||||||
std::string get_string(std::string key, std::string default_string);
|
std::string get_string(std::string key, std::string default_string);
|
||||||
int get_int(std::string key, int default_int);
|
int get_int(std::string key, int default_int);
|
||||||
|
|
|
@ -14,15 +14,6 @@
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
SlangShader::SlangShader()
|
|
||||||
{
|
|
||||||
ubo_size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SlangShader::~SlangShader()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Recursively load shader file and included files into memory, applying
|
Recursively load shader file and included files into memory, applying
|
||||||
#include and #pragma directives. Will strip all directives except
|
#include and #pragma directives. Will strip all directives except
|
||||||
|
|
|
@ -65,9 +65,6 @@ struct SlangShader
|
||||||
Fragment
|
Fragment
|
||||||
};
|
};
|
||||||
|
|
||||||
SlangShader();
|
|
||||||
~SlangShader();
|
|
||||||
|
|
||||||
bool preprocess_shader_file(std::string filename, std::vector<std::string> &lines);
|
bool preprocess_shader_file(std::string filename, std::vector<std::string> &lines);
|
||||||
void set_base_path(std::string filename);
|
void set_base_path(std::string filename);
|
||||||
bool load_file(std::string new_filename = "");
|
bool load_file(std::string new_filename = "");
|
||||||
|
|
|
@ -7,18 +7,6 @@
|
||||||
namespace Vulkan
|
namespace Vulkan
|
||||||
{
|
{
|
||||||
|
|
||||||
PipelineImage::PipelineImage()
|
|
||||||
{
|
|
||||||
image_width = 0;
|
|
||||||
image_height = 0;
|
|
||||||
device = nullptr;
|
|
||||||
command_pool = nullptr;
|
|
||||||
allocator = nullptr;
|
|
||||||
queue = nullptr;
|
|
||||||
image = nullptr;
|
|
||||||
current_layout = vk::ImageLayout::eUndefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
PipelineImage::~PipelineImage()
|
PipelineImage::~PipelineImage()
|
||||||
{
|
{
|
||||||
destroy();
|
destroy();
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace Vulkan
|
||||||
|
|
||||||
struct PipelineImage
|
struct PipelineImage
|
||||||
{
|
{
|
||||||
PipelineImage();
|
PipelineImage() = default;
|
||||||
void init(vk::Device device, vk::CommandPool command, vk::Queue queue, vma::Allocator allocator);
|
void init(vk::Device device, vk::CommandPool command, vk::Queue queue, vma::Allocator allocator);
|
||||||
void init(Vulkan::Context *context);
|
void init(Vulkan::Context *context);
|
||||||
~PipelineImage();
|
~PipelineImage();
|
||||||
|
|
|
@ -65,18 +65,6 @@ vk::SamplerAddressMode wrap_mode_from_string(std::string s)
|
||||||
return vk::SamplerAddressMode::eClampToBorder;
|
return vk::SamplerAddressMode::eClampToBorder;
|
||||||
}
|
}
|
||||||
|
|
||||||
SlangPipeline::SlangPipeline()
|
|
||||||
{
|
|
||||||
device = nullptr;
|
|
||||||
shader = nullptr;
|
|
||||||
uniform_buffer = nullptr;
|
|
||||||
uniform_buffer_allocation = nullptr;
|
|
||||||
source_width = 0;
|
|
||||||
source_height = 0;
|
|
||||||
destination_width = 0;
|
|
||||||
destination_height = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SlangPipeline::init(Context *context_, SlangShader *shader_)
|
void SlangPipeline::init(Context *context_, SlangShader *shader_)
|
||||||
{
|
{
|
||||||
this->context = context_;
|
this->context = context_;
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace Vulkan
|
||||||
class SlangPipeline
|
class SlangPipeline
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SlangPipeline();
|
SlangPipeline() = default;
|
||||||
void init(Context *context_, SlangShader *shader_);
|
void init(Context *context_, SlangShader *shader_);
|
||||||
~SlangPipeline();
|
~SlangPipeline();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ Swapchain::Swapchain(Context &context_)
|
||||||
command_pool(context.command_pool.get()),
|
command_pool(context.command_pool.get()),
|
||||||
surface(context.surface.get())
|
surface(context.surface.get())
|
||||||
{
|
{
|
||||||
end_render_pass_function = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Swapchain::~Swapchain()
|
Swapchain::~Swapchain()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Swapchain
|
||||||
vk::RenderPass &get_render_pass();
|
vk::RenderPass &get_render_pass();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::function<void()> end_render_pass_function;
|
std::function<void()> end_render_pass_function = nullptr;
|
||||||
void create_render_pass();
|
void create_render_pass();
|
||||||
|
|
||||||
struct Frame
|
struct Frame
|
||||||
|
@ -79,11 +79,11 @@ class Swapchain
|
||||||
std::vector<ImageData> image_data;
|
std::vector<ImageData> image_data;
|
||||||
|
|
||||||
Vulkan::Context &context;
|
Vulkan::Context &context;
|
||||||
vk::SurfaceKHR &surface;
|
|
||||||
vk::Device &device;
|
vk::Device &device;
|
||||||
vk::CommandPool &command_pool;
|
|
||||||
vk::PhysicalDevice &physical_device;
|
|
||||||
vk::Queue &queue;
|
vk::Queue &queue;
|
||||||
|
vk::PhysicalDevice &physical_device;
|
||||||
|
vk::CommandPool &command_pool;
|
||||||
|
vk::SurfaceKHR &surface;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Vulkan
|
} // namespace Vulkan
|
|
@ -7,20 +7,6 @@
|
||||||
namespace Vulkan
|
namespace Vulkan
|
||||||
{
|
{
|
||||||
|
|
||||||
Texture::Texture()
|
|
||||||
{
|
|
||||||
image_width = 0;
|
|
||||||
image_height = 0;
|
|
||||||
buffer_size = 0;
|
|
||||||
device = nullptr;
|
|
||||||
command_pool = nullptr;
|
|
||||||
allocator = nullptr;
|
|
||||||
queue = nullptr;
|
|
||||||
buffer = nullptr;
|
|
||||||
image = nullptr;
|
|
||||||
sampler = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
Texture::~Texture()
|
Texture::~Texture()
|
||||||
{
|
{
|
||||||
destroy();
|
destroy();
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Vulkan
|
||||||
|
|
||||||
struct Texture
|
struct Texture
|
||||||
{
|
{
|
||||||
Texture();
|
Texture() = default;
|
||||||
void init(vk::Device device, vk::CommandPool command, vk::Queue queue, vma::Allocator allocator);
|
void init(vk::Device device, vk::CommandPool command, vk::Queue queue, vma::Allocator allocator);
|
||||||
void init(Context *context);
|
void init(Context *context);
|
||||||
~Texture();
|
~Texture();
|
||||||
|
|
Loading…
Reference in New Issue