summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_shader.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-11-02 10:26:51 +1000
committerDave Airlie <[email protected]>2017-11-10 08:39:36 +1000
commit06993e4ee350b9c2ab1e3ee7686878add3900d39 (patch)
tree354a8654e8f0ef19dd201b469b922f937e0f8085 /src/gallium/drivers/r600/r600_shader.h
parent9e62654d4b47adfd5bdd60389dee17fdd17dba73 (diff)
r600: add support for hw atomic counters. (v3)
This adds support for the evergreen/cayman atomic counters. These are implemented using GDS append/consume counters. The values for each counter are loaded before drawing and saved after each draw using special CP packets. v2: move hw atomic assignment into driver. v3: fix messing up caps (Gert Wollny), only store ranges in driver, drop buffers. Signed-off-by: Dave Airlie <[email protected]> Acked-by: Nicolai Hähnle <[email protected]> Tested-By: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.h')
-rw-r--r--src/gallium/drivers/r600/r600_shader.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.h b/src/gallium/drivers/r600/r600_shader.h
index 9032d508383..3fecda4c800 100644
--- a/src/gallium/drivers/r600/r600_shader.h
+++ b/src/gallium/drivers/r600/r600_shader.h
@@ -56,15 +56,25 @@ struct r600_shader_io {
int ring_offset;
};
+struct r600_shader_atomic {
+ unsigned start, end;
+ unsigned buffer_id;
+ unsigned hw_idx;
+ unsigned array_id;
+};
+
struct r600_shader {
unsigned processor_type;
struct r600_bytecode bc;
unsigned ninput;
unsigned noutput;
+ unsigned nhwatomic;
unsigned nlds;
unsigned nsys_inputs;
struct r600_shader_io input[64];
struct r600_shader_io output[64];
+ struct r600_shader_atomic atomics[8];
+ unsigned nhwatomic_ranges;
boolean uses_kill;
boolean fs_write_all;
boolean two_side;
@@ -105,26 +115,35 @@ struct r600_shader {
struct r600_shader_array * arrays;
boolean uses_doubles;
+ boolean uses_atomics;
+ uint8_t atomic_base;
};
union r600_shader_key {
struct {
unsigned nr_cbufs:4;
+ unsigned first_atomic_counter:4;
unsigned color_two_side:1;
unsigned alpha_to_one:1;
} ps;
struct {
unsigned prim_id_out:8;
+ unsigned first_atomic_counter:4;
unsigned as_es:1; /* export shader */
unsigned as_ls:1; /* local shader */
unsigned as_gs_a:1;
} vs;
struct {
+ unsigned first_atomic_counter:4;
unsigned as_es:1;
} tes;
struct {
+ unsigned first_atomic_counter:4;
unsigned prim_mode:3;
} tcs;
+ struct {
+ unsigned first_atomic_counter:4;
+ } gs;
};
struct r600_shader_array {