Renamed Audio/Graphics interface

This commit is contained in:
Alexandro Sánchez Bach 2016-09-04 21:38:14 +02:00
parent 08c5688e99
commit 57f38c3a10
32 changed files with 38 additions and 38 deletions

View file

@ -7,7 +7,7 @@
namespace audio {
class Backend {
class AudioBackend {
public:
virtual bool initialize() = 0;

View file

@ -14,7 +14,7 @@ struct IXAudio2MasteringVoice;
namespace audio {
namespace xaudio2 {
class XAudio2Backend : public Backend {
class XAudio2Backend : public AudioBackend {
IXAudio2* xaudio2;
IXAudio2MasteringVoice* masteringVoice;

View file

@ -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

View file

@ -7,7 +7,7 @@
// Forward declarations
namespace gfx { class Texture; }
namespace gfx { class IBackend; }
namespace gfx { class GraphicsBackend; }
namespace gpu {

View file

@ -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() {

View file

@ -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;
};

View file

@ -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);

View file

@ -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);

View file

@ -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); }

View file

@ -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

View file

@ -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();

View file

@ -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

View file

@ -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); }

View file

@ -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

View file

@ -19,7 +19,7 @@ class IDXGISwapChain;
namespace gfx {
namespace direct3d11 {
class Direct3D11Backend : public IBackend {
class Direct3D11Backend : public GraphicsBackend {
IDXGIAdapter1* adapter;
ID3D11Device* device;
ID3D11DeviceContext* deviceContext;

View file

@ -25,7 +25,7 @@
namespace gfx {
namespace direct3d12 {
Direct3D12Backend::Direct3D12Backend() : IBackend() {
Direct3D12Backend::Direct3D12Backend() : GraphicsBackend() {
}
Direct3D12Backend::~Direct3D12Backend() {

View file

@ -20,7 +20,7 @@ struct IDXGISwapChain3;
namespace gfx {
namespace direct3d12 {
class Direct3D12Backend : public IBackend {
class Direct3D12Backend : public GraphicsBackend {
private:
// Debugging
Direct3D12Debug debug;

View file

@ -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];

View file

@ -23,7 +23,7 @@
namespace gfx {
namespace vulkan {
VulkanBackend::VulkanBackend() : IBackend() {
VulkanBackend::VulkanBackend() : GraphicsBackend() {
}
VulkanBackend::~VulkanBackend() {

View file

@ -13,7 +13,7 @@
namespace gfx {
namespace vulkan {
class VulkanBackend : public IBackend {
class VulkanBackend : public GraphicsBackend {
VkInstance instance;
VkPhysicalDevice physicalDevice;
VkPhysicalDeviceProperties physicalDeviceProperties;

View file

@ -7,7 +7,7 @@
namespace gfx {
IBackend::IBackend() {
GraphicsBackend::GraphicsBackend() {
}
} // namespace gfx

View file

@ -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;

View file

@ -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;
}

View file

@ -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

View file

@ -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();
}

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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