diff options
author | Marek Olšák <[email protected]> | 2017-11-25 21:21:57 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-11-29 18:21:30 +0100 |
commit | c63e225bff7417f792dc99f069dbdafc619e32d9 (patch) | |
tree | 65dc1b0bedd704c1a9d85d3562f7d9bbcd825cd6 /src/gallium/drivers/radeonsi/si_pipe.h | |
parent | 175ee084ff5e05398467ad66ea99ed812711f1a1 (diff) |
radeonsi: remove some definitions and helpers from r600_pipe_common.h
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.h')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index c0846f435b8..fd9ba3ae44c 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -34,6 +34,10 @@ #define SI_BIG_ENDIAN 0 #endif +#define ATI_VENDOR_ID 0x1002 + +#define SI_NOT_QUERY 0xffffffff + /* The base vertex and primitive restart can be any number, but we must pick * one which will mean "unknown" for the purpose of state tracking and * the number shouldn't be a commonly-used one. */ @@ -596,6 +600,12 @@ void si_init_clear_functions(struct si_context *sctx); SI_CPDMA_SKIP_GFX_SYNC | \ SI_CPDMA_SKIP_BO_LIST_UPDATE) +enum r600_coherency { + R600_COHERENCY_NONE, /* no cache flushes needed */ + R600_COHERENCY_SHADER, + R600_COHERENCY_CB_META, +}; + void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, uint64_t offset, uint64_t size, unsigned value, enum r600_coherency coher); @@ -660,6 +670,19 @@ void si_init_viewport_functions(struct si_context *ctx); */ static inline void +si_context_add_resource_size(struct pipe_context *ctx, struct pipe_resource *r) +{ + struct r600_common_context *rctx = (struct r600_common_context *)ctx; + struct r600_resource *res = (struct r600_resource *)r; + + if (res) { + /* Add memory usage for need_gfx_cs_space */ + rctx->vram += res->vram_usage; + rctx->gtt += res->gart_usage; + } +} + +static inline void si_invalidate_draw_sh_constants(struct si_context *sctx) { sctx->last_base_vertex = SI_BASE_VERTEX_UNKNOWN; @@ -793,4 +816,24 @@ si_make_DB_shader_coherent(struct si_context *sctx, unsigned num_samples, } } +static inline bool +si_can_sample_zs(struct r600_texture *tex, bool stencil_sampler) +{ + return (stencil_sampler && tex->can_sample_s) || + (!stencil_sampler && tex->can_sample_z); +} + +static inline bool +si_htile_enabled(struct r600_texture *tex, unsigned level) +{ + return tex->htile_offset && level == 0; +} + +static inline bool +vi_tc_compat_htile_enabled(struct r600_texture *tex, unsigned level) +{ + assert(!tex->tc_compatible_htile || tex->htile_offset); + return tex->tc_compatible_htile && level == 0; +} + #endif |