diff options
author | Kenneth Graunke <[email protected]> | 2015-10-19 11:44:28 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-11-13 15:15:41 -0800 |
commit | 134728fdaef9d2a5d072d25b31437ac0fecd9076 (patch) | |
tree | e7f64a77d46e769a4872082ddf1a8eba687ed38e /src/glsl/nir/nir_validate.c | |
parent | c51d7d5fe3425b0b1cb551f47979a1e41f1f73d8 (diff) |
nir: Allow outputs reads and add the relevant intrinsics.
Normally, we rely on nir_lower_outputs_to_temporaries to create shadow
variables for outputs, buffering the results and writing them all out
at the end of the program. However, this is infeasible for tessellation
control shader outputs.
Tessellation control shaders can generate multiple output vertices, and
write per-vertex outputs. These are arrays indexed by the vertex
number; each thread only writes one element, but can read any other
element - including those being concurrently written by other threads.
The barrier() intrinsic synchronizes between threads.
Even if we tried to shadow every output element (which is of dubious
value), we'd have to read updated values in at barrier() time, which
means we need to allow output reads.
Most stages should continue using nir_lower_outputs_to_temporaries(),
but in theory drivers could choose not to if they really wanted.
v2: Rebase to accomodate Jason's review feedback.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_validate.c')
-rw-r--r-- | src/glsl/nir/nir_validate.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index 51c2529dc38..ed374b921fa 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -405,7 +405,6 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state) (instr->variables[0]->var->data.mode == nir_var_uniform && glsl_get_base_type(type) == GLSL_TYPE_SUBROUTINE)); assert(instr->num_components == glsl_get_vector_elements(type)); - assert(instr->variables[0]->var->data.mode != nir_var_shader_out); break; } case nir_intrinsic_store_var: { @@ -426,7 +425,6 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state) assert(instr->variables[0]->var->data.mode != nir_var_shader_in && instr->variables[0]->var->data.mode != nir_var_uniform && instr->variables[0]->var->data.mode != nir_var_shader_storage); - assert(instr->variables[1]->var->data.mode != nir_var_shader_out); break; default: break; |