summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_pipe.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-11-15 09:59:42 +1000
committerDave Airlie <[email protected]>2017-11-17 11:31:40 +1000
commita6b379284365e8adee780b691596d3a66de1ba93 (patch)
treec188e600e823ffc64a4f31006c648e50fda7505e /src/gallium/drivers/r600/r600_pipe.h
parent5689bb00229a422267ada6aef770dacc81e3319e (diff)
r600: add core pieces of image support.
This adds the atoms and gallium api implementations, along with support for compress/decompress paths for shader images. Tested-By: Gert Wollny <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.h')
-rw-r--r--src/gallium/drivers/r600/r600_pipe.h45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 4fbc82b43f2..ad7e499be21 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -38,7 +38,16 @@
#include "tgsi/tgsi_scan.h"
-#define R600_NUM_ATOMS 52
+#define R600_NUM_ATOMS 53
+
+#define R600_MAX_IMAGES 8
+/*
+ * ranges reserved for images on evergreen
+ * first set for the immediate buffers,
+ * second for the actual resources for RESQ.
+ */
+#define R600_IMAGE_IMMED_RESOURCE_OFFSET 160
+#define R600_IMAGE_REAL_RESOURCE_OFFSET 168
/* read caches */
#define R600_CONTEXT_INV_VERTEX_CACHE (R600_CONTEXT_PRIVATE_FLAG << 0)
@@ -135,6 +144,7 @@ struct r600_cb_misc_state {
unsigned blend_colormask; /* 8*4 bits for 8 RGBA colorbuffers */
unsigned nr_cbufs;
unsigned nr_ps_color_outputs;
+ unsigned nr_image_rats;
bool multiwrite;
bool dual_src_blend;
};
@@ -425,6 +435,33 @@ struct r600_atomic_buffer_state {
struct pipe_shader_buffer buffer[EG_MAX_ATOMIC_BUFFERS];
};
+struct r600_image_view {
+ struct pipe_image_view base;
+ uint32_t cb_color_base;
+ uint32_t cb_color_pitch;
+ uint32_t cb_color_slice;
+ uint32_t cb_color_view;
+ uint32_t cb_color_info;
+ uint32_t cb_color_attrib;
+ uint32_t cb_color_dim;
+ uint32_t cb_color_fmask;
+ uint32_t cb_color_fmask_slice;
+ uint32_t immed_resource_words[8];
+ uint32_t resource_words[8];
+ bool skip_mip_address_reloc;
+ uint32_t buf_size;
+};
+
+struct r600_image_state {
+ struct r600_atom atom;
+ uint32_t enabled_mask;
+ uint32_t dirty_mask;
+ uint32_t compressed_depthtex_mask;
+ uint32_t compressed_colortex_mask;
+ boolean dirty_buffer_constants;
+ struct r600_image_view views[R600_MAX_IMAGES];
+};
+
struct r600_context {
struct r600_common_context b;
struct r600_screen *screen;
@@ -480,6 +517,8 @@ struct r600_context {
struct r600_stencil_ref_state stencil_ref;
struct r600_vgt_state vgt_state;
struct r600_atomic_buffer_state atomic_buffer_state;
+ /* only have images on fragment shader */
+ struct r600_image_state fragment_images;
/* Shaders and shader resources. */
struct r600_cso_state vertex_fetch_shader;
struct r600_shader_state hw_shader_stages[EG_NUM_HW_STAGES];
@@ -648,8 +687,12 @@ bool evergreen_adjust_gprs(struct r600_context *rctx);
void r600_init_blit_functions(struct r600_context *rctx);
void r600_decompress_depth_textures(struct r600_context *rctx,
struct r600_samplerview_state *textures);
+void r600_decompress_depth_images(struct r600_context *rctx,
+ struct r600_image_state *images);
void r600_decompress_color_textures(struct r600_context *rctx,
struct r600_samplerview_state *textures);
+void r600_decompress_color_images(struct r600_context *rctx,
+ struct r600_image_state *images);
void r600_resource_copy_region(struct pipe_context *ctx,
struct pipe_resource *dst,
unsigned dst_level,