aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/radeon/drm/radeon_winsys.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-08-06 06:42:22 +0200
committerMarek Olšák <[email protected]>2013-08-17 01:48:25 +0200
commitc8e70e64accc914c58533b8336873e0995e901e7 (patch)
treeac049b7317a7fb4c33fa6a977b349a2b18165158 /src/gallium/winsys/radeon/drm/radeon_winsys.h
parent764502b481e2288cb5e751de739253fdee886e3e (diff)
radeonsi: add flexible shader descriptor management and use it for sampler views
It moves all sampler view descriptors to a buffer. It supports partial resource updates and it can also unbind resources (required for FMASK texturing). The buffer contains all sampler view descriptors for one shader stage, represented as an array. On top of that, there are N arrays in the buffer, which are used to emulate context registers as implemented by the previous ASICs (each array is a context). This uses the RCU synchronization approach to avoid read-after-write hazards as discussed in the thread: "radeonsi: add FMASK texture binding slots and resource setup" CP DMA is used to clear the descriptors at context initialization and to copy the descriptors from one context to the next. v2: - use PKT3_DMA_DATA on CIK (I'll test CIK later) - turn the bool CP DMA parameters into self-explanatory flags - add a nice simple API for packet emission to radeon_winsys.h - use 256 contexts, 128 causes texture corruption in openarena
Diffstat (limited to 'src/gallium/winsys/radeon/drm/radeon_winsys.h')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_winsys.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_winsys.h b/src/gallium/winsys/radeon/drm/radeon_winsys.h
index a619d709754..9c6589a7a96 100644
--- a/src/gallium/winsys/radeon/drm/radeon_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_winsys.h
@@ -501,4 +501,16 @@ struct radeon_winsys {
enum radeon_value_id value);
};
+static INLINE void radeon_emit(struct radeon_winsys_cs *cs, uint32_t value)
+{
+ cs->buf[cs->cdw++] = value;
+}
+
+static INLINE void radeon_emit_array(struct radeon_winsys_cs *cs,
+ const uint32_t *values, unsigned count)
+{
+ memcpy(cs->buf+cs->cdw, values, count * 4);
+ cs->cdw += count;
+}
+
#endif