[D3D12] Texture invalidation (incomplete)

This commit is contained in:
Triang3l
2018-08-18 15:23:48 +03:00
parent 9e21f5ab67
commit bfb781d293
4 changed files with 96 additions and 18 deletions

View File

@@ -181,9 +181,16 @@ class TextureCache {
uint32_t mip_offsets[14];
// Byte pitches of each mipmap within one slice (for linear layout mainly).
uint32_t mip_pitches[14];
// Whether the recent base level data has been loaded from the memory.
// Watch handles for the memory ranges (protected by the shared memory watch
// mutex).
SharedMemory::WatchHandle base_watch_handle;
SharedMemory::WatchHandle mip_watch_handle;
// Whether the recent base level data has been loaded from the memory
// (protected by the shared memory watch mutex).
bool base_in_sync;
// Whether the recent mip data has been loaded from the memory.
// Whether the recent mip data has been loaded from the memory (protected by
// the shared memory watch mutex).
bool mips_in_sync;
};
@@ -234,6 +241,10 @@ class TextureCache {
// allocates descriptors and copies!
bool LoadTextureData(Texture* texture);
// Shared memory callback for texture data invalidation.
static void WatchCallbackThunk(void* context, void* data, uint64_t argument);
void WatchCallback(Texture* texture, bool is_mip);
// Makes all bindings invalid. Also requesting textures after calling this
// will cause another attempt to create a texture or to untile it if there was
// an error.