A texture cache that never invalidates.

This commit is contained in:
Ben Vanik
2015-01-03 01:05:56 -08:00
parent 79179c28ef
commit 718762746a
8 changed files with 303 additions and 141 deletions

View File

@@ -9,12 +9,16 @@
#include <xenia/gpu/sampler_info.h>
#include <third_party/xxhash/xxhash.h>
namespace xe {
namespace gpu {
bool SamplerInfo::Prepare(const xenos::xe_gpu_texture_fetch_t& fetch,
const ucode::instr_fetch_tex_t& fetch_instr,
SamplerInfo* out_info) {
std::memset(out_info, 0, sizeof(SamplerInfo));
out_info->min_filter = static_cast<ucode::instr_tex_filter_t>(
fetch_instr.min_filter == 3 ? fetch.min_filter : fetch_instr.min_filter);
out_info->mag_filter = static_cast<ucode::instr_tex_filter_t>(
@@ -27,5 +31,9 @@ bool SamplerInfo::Prepare(const xenos::xe_gpu_texture_fetch_t& fetch,
return true;
}
uint64_t SamplerInfo::hash() const {
return XXH64(this, sizeof(SamplerInfo), 0);
}
} // namespace gpu
} // namespace xe