Basic shader cache.

This commit is contained in:
Ben Vanik
2013-10-11 21:45:20 -07:00
parent 6e4fb87992
commit 1378fad3c0
20 changed files with 981 additions and 40 deletions

View File

@@ -11,6 +11,7 @@
#define XENIA_GPU_SHADER_H_
#include <xenia/core.h>
#include <xenia/gpu/xenos/xenos.h>
namespace xe {
@@ -19,8 +20,28 @@ namespace gpu {
class Shader {
public:
Shader();
Shader(xenos::XE_GPU_SHADER_TYPE type,
const uint8_t* src_ptr, size_t length,
uint64_t hash);
virtual ~Shader();
xenos::XE_GPU_SHADER_TYPE type() const { return type_; }
const uint32_t* dwords() const { return dwords_; }
size_t dword_count() const { return dword_count_; }
uint64_t hash() const { return hash_; }
// vfetch formats
// sampler formats
// constants/registers/etc used
// NOTE: xe_free() the returned string!
char* Disassemble();
protected:
xenos::XE_GPU_SHADER_TYPE type_;
uint32_t* dwords_;
size_t dword_count_;
uint64_t hash_;
};