diff options
author | Chia-I Wu <[email protected]> | 2014-09-06 12:20:55 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-09-09 13:31:37 +0800 |
commit | d2acd673135318585fb956a2723a9a1ba89577d7 (patch) | |
tree | 97f5be7cf4bde77d96e7d95b454ddf7f3e6602f4 /src/gallium/drivers/ilo/ilo_cp.c | |
parent | 55f80a3290cb0e07db780265369eb504573b4e62 (diff) |
ilo: use ilo_builder for kernels and STATE_BASE_ADDRESS
Remove instruction buffer management from ilo_3d and adapt ilo_shader_cache to
upload kernels to ilo_builder. To be able to do that, we also let ilo_builder
manage STATE_BASE_ADDRESS.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_cp.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_cp.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c index 4f65d443f49..d6bdfcaea2a 100644 --- a/src/gallium/drivers/ilo/ilo_cp.c +++ b/src/gallium/drivers/ilo/ilo_cp.c @@ -27,11 +27,14 @@ #include "intel_winsys.h" +#include "ilo_shader.h" #include "ilo_cp.h" static struct intel_bo * ilo_cp_end_batch(struct ilo_cp *cp, unsigned *used) { + struct intel_bo *bo; + ilo_cp_set_owner(cp, NULL, 0); if (!ilo_builder_batch_used(&cp->builder)) { @@ -43,7 +46,13 @@ ilo_cp_end_batch(struct ilo_cp *cp, unsigned *used) assert(ilo_builder_batch_space(&cp->builder) >= 2); ilo_builder_batch_mi_batch_buffer_end(&cp->builder); - return ilo_builder_end(&cp->builder, used); + bo = ilo_builder_end(&cp->builder, used); + + /* we have to assume that kernel uploads also failed */ + if (!bo) + ilo_shader_cache_invalidate(cp->shader_cache); + + return bo; } /** @@ -101,7 +110,9 @@ ilo_cp_destroy(struct ilo_cp *cp) * Create a command parser. */ struct ilo_cp * -ilo_cp_create(const struct ilo_dev_info *dev, struct intel_winsys *winsys) +ilo_cp_create(const struct ilo_dev_info *dev, + struct intel_winsys *winsys, + struct ilo_shader_cache *shc) { struct ilo_cp *cp; @@ -110,6 +121,7 @@ ilo_cp_create(const struct ilo_dev_info *dev, struct intel_winsys *winsys) return NULL; cp->winsys = winsys; + cp->shader_cache = shc; cp->render_ctx = intel_winsys_create_context(winsys); if (!cp->render_ctx) { FREE(cp); |