Starting to drive command buffer actions down to a graphics driver.

This commit is contained in:
Ben Vanik
2013-10-06 21:09:58 -07:00
parent 371075f154
commit 651954ccae
12 changed files with 307 additions and 84 deletions

View File

@@ -0,0 +1,57 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include <xenia/gpu/nop/nop_graphics_driver.h>
#include <xenia/gpu/gpu-private.h>
using namespace xe;
using namespace xe::gpu;
using namespace xe::gpu::nop;
NopGraphicsDriver::NopGraphicsDriver(xe_memory_ref memory) :
GraphicsDriver(memory) {
}
NopGraphicsDriver::~NopGraphicsDriver() {
}
void NopGraphicsDriver::Initialize() {
}
void NopGraphicsDriver::InvalidateState(
uint32_t mask) {
if (mask == XE_GPU_INVALIDATE_MASK_ALL) {
XELOGGPU("NOP: (invalidate all)");
}
if (mask & XE_GPU_INVALIDATE_MASK_VERTEX_SHADER) {
XELOGGPU("NOP: invalidate vertex shader");
}
if (mask & XE_GPU_INVALIDATE_MASK_PIXEL_SHADER) {
XELOGGPU("NOP: invalidate pixel shader");
}
}
void NopGraphicsDriver::SetShader(
XE_GPU_SHADER_TYPE type,
uint32_t address,
uint32_t start,
uint32_t size_dwords) {
XELOGGPU("NOP: set shader %d at %0.8X (%db)",
type, address, size_dwords * 4);
}
void NopGraphicsDriver::DrawIndexed(
XE_GPU_PRIMITIVE_TYPE prim_type,
uint32_t index_count) {
XELOGGPU("NOP: draw indexed %d (%d indicies)",
prim_type, index_count);
}

View File

@@ -0,0 +1,51 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_GPU_NOP_NOP_GRAPHICS_DRIVER_H_
#define XENIA_GPU_NOP_NOP_GRAPHICS_DRIVER_H_
#include <xenia/core.h>
#include <xenia/gpu/graphics_driver.h>
#include <xenia/gpu/nop/nop-private.h>
namespace xe {
namespace gpu {
namespace nop {
class NopGraphicsDriver : public GraphicsDriver {
public:
NopGraphicsDriver(xe_memory_ref memory);
virtual ~NopGraphicsDriver();
virtual void Initialize();
virtual void InvalidateState(
uint32_t mask);
virtual void SetShader(
XE_GPU_SHADER_TYPE type,
uint32_t address,
uint32_t start,
uint32_t size_dwords);
virtual void DrawIndexed(
XE_GPU_PRIMITIVE_TYPE prim_type,
uint32_t index_count);
protected:
};
} // namespace nop
} // namespace gpu
} // namespace xe
#endif // XENIA_GPU_NOP_NOP_GRAPHICS_DRIVER_H_

View File

@@ -10,6 +10,7 @@
#include <xenia/gpu/nop/nop_graphics_system.h>
#include <xenia/gpu/gpu-private.h>
#include <xenia/gpu/nop/nop_graphics_driver.h>
using namespace xe;
@@ -42,6 +43,9 @@ NopGraphicsSystem::~NopGraphicsSystem() {
}
void NopGraphicsSystem::Initialize() {
XEASSERTNULL(driver_);
driver_ = new NopGraphicsDriver(memory_);
XEASSERTNULL(timer_queue_);
XEASSERTNULL(vsync_timer_);

View File

@@ -4,6 +4,8 @@
'nop-private.h',
'nop.cc',
'nop.h',
'nop_graphics_driver.cc',
'nop_graphics_driver.h',
'nop_graphics_system.cc',
'nop_graphics_system.h',
],