Better vertex buffer construction, supporting packed data.

This commit is contained in:
Ben Vanik
2014-01-18 00:12:57 -08:00
parent ba9d343c51
commit 99c72f24f2
5 changed files with 241 additions and 164 deletions

View File

@@ -34,7 +34,24 @@ public:
const char* disasm_src() const { return disasm_src_; }
const xenos::instr_fetch_vtx_t* GetFetchVtxBySlot(uint32_t fetch_slot);
typedef struct {
xenos::instr_fetch_vtx_t vtx_fetch;
uint32_t format;
uint32_t offset_words;
uint32_t size_words;
} vtx_buffer_element_t;
typedef struct {
uint32_t input_index;
uint32_t fetch_slot;
uint32_t stride_words;
uint32_t element_count;
vtx_buffer_element_t elements[16];
} vtx_buffer_desc_t;
typedef struct {
uint32_t count;
vtx_buffer_desc_t descs[16];
} vtx_buffer_inputs_t;
const vtx_buffer_inputs_t* GetVertexBufferInputs();
typedef struct {
uint32_t positions;
@@ -62,8 +79,7 @@ protected:
alloc_counts_t alloc_counts_;
std::vector<xenos::instr_cf_exec_t> execs_;
std::vector<xenos::instr_cf_alloc_t> allocs_;
std::vector<xenos::instr_fetch_vtx_t> fetch_vtxs_;
xenos::instr_fetch_vtx_t fetch_vtx_slots_[96];
vtx_buffer_inputs_t vtx_buffer_inputs_;
std::vector<xenos::instr_fetch_tex_t> fetch_texs_;
};