[D3D12] Fix texture binding hashing

This commit is contained in:
Triang3l
2018-10-04 23:57:08 +03:00
parent 131525e44d
commit d827bbeb6c
4 changed files with 57 additions and 56 deletions

View File

@@ -13,6 +13,7 @@
#include <atomic>
#include <unordered_map>
#include "xenia/gpu/d3d12/d3d12_shader.h"
#include "xenia/gpu/d3d12/shared_memory.h"
#include "xenia/gpu/register_file.h"
#include "xenia/gpu/texture_info.h"
@@ -72,12 +73,13 @@ class TextureCache {
// (notifying the command processor about that), so this must be called before
// binding the actual drawing pipeline.
void RequestTextures(uint32_t used_vertex_texture_mask,
uint32_t used_pixel_texture_mask,
uint64_t& descriptor_layout_vertex_hash_out,
uint64_t& descriptor_layout_pixel_hash_out);
inline uint64_t GetEmptyTextureBindingsHash() const {
return texture_bindings_empty_hash_;
}
uint32_t used_pixel_texture_mask);
// Returns the hash of the current bindings (must be called after
// RequestTextures) for the provided SRV descriptor layout.
uint64_t GetDescriptorHashForActiveTextures(
const D3D12Shader::TextureSRV* texture_srvs,
uint32_t texture_srv_count) const;
void WriteTextureSRV(uint32_t fetch_constant,
TextureDimension shader_dimension,
@@ -371,8 +373,6 @@ class TextureCache {
std::unordered_multimap<uint64_t, Texture*> textures_;
TextureBinding texture_bindings_[32] = {};
// Hash for no textures bound.
uint64_t texture_bindings_empty_hash_;
// Bit vector with bits reset on fetch constant writes to avoid getting
// texture keys from the fetch constants again and again.
uint32_t texture_keys_in_sync_ = 0;