Initial refactoring of gpu/.

Runs too fast - now there are ringbuffer wrapping issues.
This commit is contained in:
Ben Vanik
2014-06-08 11:23:55 -07:00
parent 4072640a64
commit 295910c3d8
70 changed files with 5923 additions and 6095 deletions

View File

@@ -11,7 +11,9 @@
#define XENIA_GPU_GRAPHICS_DRIVER_H_
#include <xenia/core.h>
#include <xenia/gpu/xenos/registers.h>
#include <xenia/gpu/draw_command.h>
#include <xenia/gpu/register_file.h>
#include <xenia/gpu/resource_cache.h>
#include <xenia/gpu/xenos/xenos.h>
@@ -24,38 +26,45 @@ public:
virtual ~GraphicsDriver();
Memory* memory() const { return memory_; }
xenos::RegisterFile* register_file() { return &register_file_; };
virtual ResourceCache* resource_cache() const = 0;
RegisterFile* register_file() { return &register_file_; };
void set_address_translation(uint32_t value) {
address_translation_ = value;
}
virtual void Initialize() = 0;
virtual int Initialize() = 0;
virtual void InvalidateState(
uint32_t mask) = 0;
virtual void SetShader(
xenos::XE_GPU_SHADER_TYPE type,
uint32_t address,
uint32_t start,
uint32_t length) = 0;
virtual void DrawIndexBuffer(
xenos::XE_GPU_PRIMITIVE_TYPE prim_type,
bool index_32bit, uint32_t index_count,
uint32_t index_base, uint32_t index_size, uint32_t endianness) = 0;
//virtual void DrawIndexImmediate();
virtual void DrawIndexAuto(
xenos::XE_GPU_PRIMITIVE_TYPE prim_type,
uint32_t index_count) = 0;
int LoadShader(xenos::XE_GPU_SHADER_TYPE type,
uint32_t address, uint32_t length,
uint32_t start);
int PrepareDraw(DrawCommand& command);
int PrepareDrawIndexBuffer(DrawCommand& command,
uint32_t address, uint32_t length,
xenos::XE_GPU_ENDIAN endianness,
IndexFormat format);
virtual int Draw(const DrawCommand& command) = 0;
virtual int Resolve() = 0;
private:
int PopulateState(DrawCommand& command);
int PopulateConstantBuffers(DrawCommand& command);
int PopulateShaders(DrawCommand& command);
int PopulateInputAssembly(DrawCommand& command);
int PopulateSamplers(DrawCommand& command);
int PopulateSamplerSet(const ShaderResource::SamplerDesc& src_input,
DrawCommand::SamplerInput& dst_input);
protected:
GraphicsDriver(Memory* memory);
Memory* memory_;
xenos::RegisterFile register_file_;
RegisterFile register_file_;
uint32_t address_translation_;
VertexShaderResource* vertex_shader_;
PixelShaderResource* pixel_shader_;
};