summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-11-01 13:10:11 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-09 23:29:42 +0000
commit5bdd4fc273176bbbfb9adfe6cc397a6b0525c1d2 (patch)
tree7b07084a1bee830d7427000eb5124e305736644f /src/intel/vulkan/anv_private.h
parentc4643f5f1eb431e6780ec263dbdfe21796b0bf5d (diff)
downloadexternal_mesa3d-5bdd4fc273176bbbfb9adfe6cc397a6b0525c1d2.zip
external_mesa3d-5bdd4fc273176bbbfb9adfe6cc397a6b0525c1d2.tar.gz
external_mesa3d-5bdd4fc273176bbbfb9adfe6cc397a6b0525c1d2.tar.bz2
anv/allocator: Simplify anv_scratch_pool
The previous implementation was being overly clever and using the anv_bo::size field as its mutex. Scratch pool allocations don't happen often, will happen at most a fixed number of times, and never happen in the critical path (they only happen in shader compilation). We can make this much simpler by just using the device mutex. This also means that we can start using anv_bo_init_new directly on the bo and avoid setting fields one-at-a-time. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit bd0f8d50706fce400ff0768c659acc90696aadb6)
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index b4f7e92..1302df7 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -450,9 +450,14 @@ VkResult anv_bo_pool_alloc(struct anv_bo_pool *pool, struct anv_bo *bo,
uint32_t size);
void anv_bo_pool_free(struct anv_bo_pool *pool, const struct anv_bo *bo);
+struct anv_scratch_bo {
+ bool exists;
+ struct anv_bo bo;
+};
+
struct anv_scratch_pool {
/* Indexed by Per-Thread Scratch Space number (the hardware value) and stage */
- struct anv_bo bos[16][MESA_SHADER_STAGES];
+ struct anv_scratch_bo bos[16][MESA_SHADER_STAGES];
};
void anv_scratch_pool_init(struct anv_device *device,