diff options
author | Luca Barbieri <[email protected]> | 2010-01-20 09:04:37 +0100 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-04-13 09:55:49 +0200 |
commit | a79521d497bc87309cadc49f3a414703497522bc (patch) | |
tree | 626ec1037fd0e7fd3911bb3455fd4dbca86f5278 /src/gallium/drivers/nvfx/nvfx_state.h | |
parent | 9f39d3240b41639cbaa5b6c438a76c34d3f23444 (diff) |
nvfx: use dynamically sized rotating BO pool for fragment programs
Currently we used a single buffer for each fragment programs, leading to
rendering synchronization. This patch uses a doubly linked list of BOs,
which is dynamically resized if all the BOs are busy.
Note that inline image transfers could be an alternative option: this
will be explored later.
This removes one of the big performance limitations of the current
driver.
We also stop using pipe_resource internally in favor of using nouveau_bo
directly.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_state.h')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_state.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_state.h b/src/gallium/drivers/nvfx/nvfx_state.h index 555513a6428..9ceb2577ecc 100644 --- a/src/gallium/drivers/nvfx/nvfx_state.h +++ b/src/gallium/drivers/nvfx/nvfx_state.h @@ -46,6 +46,12 @@ struct nvfx_fragment_program_data { unsigned index; }; +struct nvfx_fragment_program_bo { + struct nvfx_fragment_program_bo* next; + struct nouveau_bo* bo; + char insn[] __attribute__((aligned(16))); +}; + struct nvfx_fragment_program { struct pipe_shader_state pipe; struct tgsi_shader_info info; @@ -58,12 +64,13 @@ struct nvfx_fragment_program { struct nvfx_fragment_program_data *consts; unsigned nr_consts; - - /* XXX: just use a nouveau_bo for this? - */ - struct pipe_resource *buffer; uint32_t fp_control; + + unsigned bo_prog_idx; + unsigned prog_size; + unsigned progs_per_bo; + struct nvfx_fragment_program_bo* fpbo; }; |