diff options
author | Chia-I Wu <[email protected]> | 2013-08-11 22:44:44 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-08-12 11:49:51 +0800 |
commit | a9b800aa81cffdcaef2490ff49986099feae2663 (patch) | |
tree | de2c4238599df421d46da7267d17e8f14e76cbb7 /src/gallium/drivers/ilo/ilo_gpe.h | |
parent | b2f79a3823bd5fca3f3080351f87b41e2396c8f6 (diff) |
ilo: initialize constant buffer SURFACE_STATE early
Fix ilo_gpe_init_view_surface_for_buffer to allow buffer to be NULL, and add
ilo_gpe_set_view_surface_bo to set it later. This allows us to set up
SURFACE_STATE early for constant buffers backed by user buffers.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_gpe.h')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_gpe.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/ilo/ilo_gpe.h b/src/gallium/drivers/ilo/ilo_gpe.h index f0768b9de5c..17b131b0bc1 100644 --- a/src/gallium/drivers/ilo/ilo_gpe.h +++ b/src/gallium/drivers/ilo/ilo_gpe.h @@ -53,6 +53,9 @@ #define ILO_WM_CONST_SURFACE(i) (ILO_MAX_DRAW_BUFFERS + i) #define ILO_WM_TEXTURE_SURFACE(i) (ILO_MAX_DRAW_BUFFERS + ILO_MAX_CONST_BUFFERS + i) +#define ILO_GPE_VALID_GEN(dev, min_gen, max_gen) \ + assert((dev)->gen >= ILO_GEN(min_gen) && (dev)->gen <= ILO_GEN(max_gen)) + struct ilo_buffer; struct ilo_texture; struct ilo_shader_state; @@ -467,6 +470,18 @@ ilo_gpe_init_view_surface_for_texture(const struct ilo_dev_info *dev, } } +static inline void +ilo_gpe_set_view_surface_bo(const struct ilo_dev_info *dev, + struct intel_bo *bo, unsigned offset, + struct ilo_view_surface *surf) +{ + ILO_GPE_VALID_GEN(dev, 6, 7); + + /* do not increment reference count */ + surf->bo = bo; + surf->payload[1] = offset; +} + void ilo_gpe_init_zs_surface(const struct ilo_dev_info *dev, const struct ilo_texture *tex, |