mirror of
https://github.com/AlexAltea/nucleus.git
synced 2024-06-11 16:57:40 -04:00
Renamed Audio/Graphics interface
This commit is contained in:
parent
08c5688e99
commit
57f38c3a10
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace audio {
|
||||
|
||||
class Backend {
|
||||
class AudioBackend {
|
||||
public:
|
||||
virtual bool initialize() = 0;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ struct IXAudio2MasteringVoice;
|
|||
namespace audio {
|
||||
namespace xaudio2 {
|
||||
|
||||
class XAudio2Backend : public Backend {
|
||||
class XAudio2Backend : public AudioBackend {
|
||||
IXAudio2* xaudio2;
|
||||
IXAudio2MasteringVoice* masteringVoice;
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ class Emulator {
|
|||
bool load_ps4(const std::string& path);
|
||||
|
||||
public:
|
||||
std::shared_ptr<audio::Backend> audio;
|
||||
std::shared_ptr<gfx::IBackend> graphics;
|
||||
std::shared_ptr<audio::AudioBackend> audio;
|
||||
std::shared_ptr<gfx::GraphicsBackend> graphics;
|
||||
std::shared_ptr<ui::UI> ui;
|
||||
|
||||
// Hardware & OS
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
// Forward declarations
|
||||
namespace gfx { class Texture; }
|
||||
namespace gfx { class IBackend; }
|
||||
namespace gfx { class GraphicsBackend; }
|
||||
|
||||
namespace gpu {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace gpu {
|
||||
namespace r10xx {
|
||||
|
||||
R10XX::R10XX(std::shared_ptr<gfx::IBackend> graphics) {
|
||||
R10XX::R10XX(std::shared_ptr<gfx::GraphicsBackend> graphics) {
|
||||
}
|
||||
|
||||
gfx::Texture* R10XX::getFrontBuffer() {
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace r10xx {
|
|||
|
||||
class R10XX : public GPU {
|
||||
public:
|
||||
R10XX(std::shared_ptr<gfx::IBackend> graphics);
|
||||
R10XX(std::shared_ptr<gfx::GraphicsBackend> graphics);
|
||||
|
||||
virtual gfx::Texture* getFrontBuffer() override;
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
namespace gpu {
|
||||
namespace rsx {
|
||||
|
||||
RSX::RSX(std::shared_ptr<mem::Memory> mem, std::shared_ptr<gfx::IBackend> graphics) :
|
||||
RSX::RSX(std::shared_ptr<mem::Memory> mem, std::shared_ptr<gfx::GraphicsBackend> graphics) :
|
||||
memory(mem), pgraph(std::move(graphics), this, mem.get()) {
|
||||
// HACK: We store the data in memory (the PS3 stores the data in the GPU and maps it later through a LV2 syscall)
|
||||
memory->getSegment(mem::SEG_RSX_MAP_MEMORY).allocFixed(0x40000000, 0x1000);
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
std::vector<rsx_iomap_t> iomaps;
|
||||
|
||||
// Constructor
|
||||
RSX(std::shared_ptr<mem::Memory> memory, std::shared_ptr<gfx::IBackend> graphics);
|
||||
RSX(std::shared_ptr<mem::Memory> memory, std::shared_ptr<gfx::GraphicsBackend> graphics);
|
||||
|
||||
U32 io_read8(U32 offset);
|
||||
U32 io_read16(U32 offset);
|
||||
|
|
|
@ -267,7 +267,7 @@ void RSXFragmentProgram::decompile(const rsx_fp_instruction_t* buffer) {
|
|||
builder.addMemoryModel(ADDRESSING_MODEL_LOGICAL, MEMORY_MODEL_GLSL450);
|
||||
}
|
||||
|
||||
void RSXFragmentProgram::compile(gfx::IBackend* backend) {
|
||||
void RSXFragmentProgram::compile(gfx::GraphicsBackend* backend) {
|
||||
// TODO: Remove this
|
||||
for (const auto& i : module->hCapabilities) { module->header.push_back(i); }
|
||||
for (const auto& i : module->hExtensions) { module->header.push_back(i); }
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
namespace gfx {
|
||||
|
||||
class Shader;
|
||||
class IBackend;
|
||||
class GraphicsBackend;
|
||||
|
||||
} // namespace gfx
|
||||
|
||||
|
@ -238,7 +238,7 @@ public:
|
|||
* @param[in] backend Graphics backend to compile the module with
|
||||
* @return Non-zero shader pointer on success, otherwise nullptr
|
||||
*/
|
||||
void compile(gfx::IBackend* backend);
|
||||
void compile(gfx::GraphicsBackend* backend);
|
||||
};
|
||||
|
||||
} // namespace rsx
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
namespace gpu {
|
||||
namespace rsx {
|
||||
|
||||
PGRAPH::PGRAPH(std::shared_ptr<gfx::IBackend> backend, RSX* rsx, mem::Memory* memory) :
|
||||
PGRAPH::PGRAPH(std::shared_ptr<gfx::GraphicsBackend> backend, RSX* rsx, mem::Memory* memory) :
|
||||
graphics(std::move(backend)), rsx(rsx), memory(memory), surface(), cacheTexture(256_MB) {
|
||||
cmdQueue = graphics->getGraphicsCommandQueue();
|
||||
cmdBuffer = graphics->createCommandBuffer();
|
||||
|
|
|
@ -147,7 +147,7 @@ struct alignas(sizeof(Hash)) Pipeline {
|
|||
|
||||
// RSX's PGRAPH engine (Curie)
|
||||
class PGRAPH {
|
||||
std::shared_ptr<gfx::IBackend> graphics;
|
||||
std::shared_ptr<gfx::GraphicsBackend> graphics;
|
||||
mem::Memory* memory;
|
||||
RSX* rsx;
|
||||
|
||||
|
@ -224,7 +224,7 @@ public:
|
|||
U32 fp_control; // Control the performance of the program
|
||||
|
||||
// Constructor
|
||||
PGRAPH(std::shared_ptr<gfx::IBackend> graphics, RSX* rsx, mem::Memory* memory);
|
||||
PGRAPH(std::shared_ptr<gfx::GraphicsBackend> graphics, RSX* rsx, mem::Memory* memory);
|
||||
~PGRAPH();
|
||||
|
||||
// Auxiliary methods
|
||||
|
|
|
@ -270,7 +270,7 @@ void RSXVertexProgram::decompile(const rsx_vp_instruction_t* buffer) {
|
|||
builder.addMemoryModel(ADDRESSING_MODEL_LOGICAL, MEMORY_MODEL_GLSL450);
|
||||
}
|
||||
|
||||
void RSXVertexProgram::compile(gfx::IBackend* backend) {
|
||||
void RSXVertexProgram::compile(gfx::GraphicsBackend* backend) {
|
||||
// TODO: Remove this
|
||||
for (const auto& i : module->hCapabilities) { module->header.push_back(i); }
|
||||
for (const auto& i : module->hExtensions) { module->header.push_back(i); }
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
namespace gfx {
|
||||
|
||||
class Shader;
|
||||
class IBackend;
|
||||
class GraphicsBackend;
|
||||
|
||||
} // namespace gfx
|
||||
|
||||
|
@ -196,7 +196,7 @@ public:
|
|||
* @param[in] backend Graphics backend to compile the module with
|
||||
* @return Non-zero shader pointer on success, otherwise nullptr
|
||||
*/
|
||||
void compile(gfx::IBackend* backend);
|
||||
void compile(gfx::GraphicsBackend* backend);
|
||||
};
|
||||
|
||||
} // namespace rsx
|
||||
|
|
|
@ -19,7 +19,7 @@ class IDXGISwapChain;
|
|||
namespace gfx {
|
||||
namespace direct3d11 {
|
||||
|
||||
class Direct3D11Backend : public IBackend {
|
||||
class Direct3D11Backend : public GraphicsBackend {
|
||||
IDXGIAdapter1* adapter;
|
||||
ID3D11Device* device;
|
||||
ID3D11DeviceContext* deviceContext;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
namespace gfx {
|
||||
namespace direct3d12 {
|
||||
|
||||
Direct3D12Backend::Direct3D12Backend() : IBackend() {
|
||||
Direct3D12Backend::Direct3D12Backend() : GraphicsBackend() {
|
||||
}
|
||||
|
||||
Direct3D12Backend::~Direct3D12Backend() {
|
||||
|
|
|
@ -20,7 +20,7 @@ struct IDXGISwapChain3;
|
|||
namespace gfx {
|
||||
namespace direct3d12 {
|
||||
|
||||
class Direct3D12Backend : public IBackend {
|
||||
class Direct3D12Backend : public GraphicsBackend {
|
||||
private:
|
||||
// Debugging
|
||||
Direct3D12Debug debug;
|
||||
|
|
|
@ -30,7 +30,7 @@ using OpenGLContext = HGLRC;
|
|||
// Forward declarations
|
||||
class OpenGLCommandQueue;
|
||||
|
||||
class OpenGLBackend : public IBackend {
|
||||
class OpenGLBackend : public GraphicsBackend {
|
||||
private:
|
||||
OpenGLContext context = 0;
|
||||
OpenGLContext subContext[8];
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
namespace gfx {
|
||||
namespace vulkan {
|
||||
|
||||
VulkanBackend::VulkanBackend() : IBackend() {
|
||||
VulkanBackend::VulkanBackend() : GraphicsBackend() {
|
||||
}
|
||||
|
||||
VulkanBackend::~VulkanBackend() {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace gfx {
|
||||
namespace vulkan {
|
||||
|
||||
class VulkanBackend : public IBackend {
|
||||
class VulkanBackend : public GraphicsBackend {
|
||||
VkInstance instance;
|
||||
VkPhysicalDevice physicalDevice;
|
||||
VkPhysicalDeviceProperties physicalDeviceProperties;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace gfx {
|
||||
|
||||
IBackend::IBackend() {
|
||||
GraphicsBackend::GraphicsBackend() {
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
|
|
|
@ -48,7 +48,7 @@ struct BackendParameters {
|
|||
Size height;
|
||||
};
|
||||
|
||||
class IBackend {
|
||||
class GraphicsBackend {
|
||||
protected:
|
||||
BackendParameters parameters;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
ColorTarget* screenFrontTarget;
|
||||
|
||||
// Constructor
|
||||
IBackend();
|
||||
GraphicsBackend();
|
||||
|
||||
virtual bool initialize(const BackendParameters& params) = 0;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ Surface::Surface(Size width, Size height) :
|
|||
proportion = float(width) / float(height);
|
||||
}
|
||||
|
||||
void Surface::update(gfx::IBackend* backend) {
|
||||
void Surface::update(gfx::GraphicsBackend* backend) {
|
||||
if (!changed) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
* Apply surface updates and configure graphics backend accordingly
|
||||
* @param[in] backend Graphics backend to be configured
|
||||
*/
|
||||
void update(gfx::IBackend* backend);
|
||||
void update(gfx::GraphicsBackend* backend);
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace ui {
|
||||
|
||||
UI::UI(std::shared_ptr<gfx::IBackend> backend, Size width, Size height) :
|
||||
UI::UI(std::shared_ptr<gfx::GraphicsBackend> backend, Size width, Size height) :
|
||||
graphics(std::move(backend)), language(), surface(width, height) {
|
||||
cmdQueue = graphics->getGraphicsCommandQueue();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class UI {
|
|||
std::queue<std::unique_ptr<Screen>> newScreens;
|
||||
|
||||
public:
|
||||
std::shared_ptr<gfx::IBackend> graphics;
|
||||
std::shared_ptr<gfx::GraphicsBackend> graphics;
|
||||
|
||||
// Events
|
||||
std::mutex eventMutex;
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
std::unique_ptr<Font> fontIcon;
|
||||
|
||||
// Constructor
|
||||
UI(std::shared_ptr<gfx::IBackend> graphics, Size width, Size height);
|
||||
UI(std::shared_ptr<gfx::GraphicsBackend> graphics, Size width, Size height);
|
||||
|
||||
// RSX connection
|
||||
bool rsxChanged = false;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace ui {
|
||||
|
||||
gfx::Pipeline* WidgetContainer::createPipeline(gfx::IBackend& backend) {
|
||||
gfx::Pipeline* WidgetContainer::createPipeline(gfx::GraphicsBackend& backend) {
|
||||
gfx::ShaderDesc vertDesc = {};
|
||||
gfx::ShaderDesc fragDesc = {};
|
||||
core::Resource resVS(core::RES_SHADER_UI_WIDGET_CONTAINER_VS);
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
* Create a pipeline to process this kind of widgets
|
||||
* @param[in] backend Graphics backend where the pipeline state object will be created
|
||||
*/
|
||||
static gfx::Pipeline* createPipeline(gfx::IBackend& backend);
|
||||
static gfx::Pipeline* createPipeline(gfx::GraphicsBackend& backend);
|
||||
|
||||
/**
|
||||
* Add an element to this container
|
||||
|
|
|
@ -26,7 +26,7 @@ void WidgetImage::init() {
|
|||
heap = manager->graphics->createHeap(heapDesc);
|
||||
}
|
||||
|
||||
gfx::Pipeline* WidgetImage::createPipeline(gfx::IBackend& backend) {
|
||||
gfx::Pipeline* WidgetImage::createPipeline(gfx::GraphicsBackend& backend) {
|
||||
gfx::ShaderDesc vertDesc = {};
|
||||
gfx::ShaderDesc fragDesc = {};
|
||||
core::Resource resVS(core::RES_SHADER_UI_WIDGET_IMAGE_VS);
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
* Create a pipeline to process this kind of widgets
|
||||
* @param[in] backend Graphics backend where the pipeline state object will be created
|
||||
*/
|
||||
static gfx::Pipeline* createPipeline(gfx::IBackend& backend);
|
||||
static gfx::Pipeline* createPipeline(gfx::GraphicsBackend& backend);
|
||||
|
||||
/**
|
||||
* Read image from resource
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace ui {
|
||||
|
||||
gfx::Pipeline* WidgetText::createPipeline(gfx::IBackend& backend) {
|
||||
gfx::Pipeline* WidgetText::createPipeline(gfx::GraphicsBackend& backend) {
|
||||
gfx::ShaderDesc vertDesc = {};
|
||||
gfx::ShaderDesc fragDesc = {};
|
||||
core::Resource resVS(core::RES_SHADER_UI_WIDGET_TEXT_VS);
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
* Create a pipeline to process this kind of widgets
|
||||
* @param[in] backend Graphics backend where the pipeline state object will be created
|
||||
*/
|
||||
static gfx::Pipeline* createPipeline(gfx::IBackend& backend);
|
||||
static gfx::Pipeline* createPipeline(gfx::GraphicsBackend& backend);
|
||||
|
||||
/**
|
||||
* Update the Widget texture given a text string to render and a font family and size to use
|
||||
|
|
Loading…
Reference in a new issue