diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2015-11-17 01:07:39 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2015-12-22 02:12:05 -0800 |
commit | 24be658d13b13fdb8a1977208038b4ba43bce4ac (patch) | |
tree | 75d5bfdd7982207a64a9eed6d46d1f9ae5430bfa /src/mesa/drivers/dri/i965/brw_compiler.h | |
parent | a5038427c3624e559f954124d77304f9ae9b884c (diff) | |
download | external_mesa3d-24be658d13b13fdb8a1977208038b4ba43bce4ac.zip external_mesa3d-24be658d13b13fdb8a1977208038b4ba43bce4ac.tar.gz external_mesa3d-24be658d13b13fdb8a1977208038b4ba43bce4ac.tar.bz2 |
i965: Add tessellation control shaders.
The TCS is the first tessellation shader stage, and the most
complicated. It has access to each of the control points in the input
patch, and computes a new output patch. There is one logical invocation
per output control point; all invocations run in parallel, and can
communicate by reading and writing output variables.
One of the main responsibilities of the TCS is to write the special
gl_TessLevelOuter[] and gl_TessLevelInner[] output variables which
control how much new geometry the hardware tessellation engine will
produce. Otherwise, it simply writes outputs that are passed along
to the TES.
We run in SIMD4x2 mode, handling two logical invocations per EU thread.
The hardware doesn't properly manage the dispatch mask for us; it always
initializes it to 0xFF. We wrap the whole program in an IF..ENDIF block
to handle an odd number of invocations, essentially falling back to
SIMD4x1 on the last thread.
v2: Update comments (requested by Jordan Justen).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_compiler.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_compiler.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h index 64d831d..e6bae8e 100644 --- a/src/mesa/drivers/dri/i965/brw_compiler.h +++ b/src/mesa/drivers/dri/i965/brw_compiler.h @@ -191,6 +191,16 @@ struct brw_vs_prog_key { struct brw_sampler_prog_key_data tex; }; +/** The program key for Tessellation Control Shaders. */ +struct brw_tcs_prog_key +{ + unsigned program_string_id; + + GLenum tes_primitive_mode; + + struct brw_sampler_prog_key_data tex; +}; + /** The program key for Tessellation Evaluation Shaders. */ struct brw_tes_prog_key { @@ -677,6 +687,22 @@ brw_compile_vs(const struct brw_compiler *compiler, void *log_data, char **error_str); /** + * Compile a tessellation control shader. + * + * Returns the final assembly and the program's size. + */ +const unsigned * +brw_compile_tcs(const struct brw_compiler *compiler, + void *log_data, + void *mem_ctx, + const struct brw_tcs_prog_key *key, + struct brw_tcs_prog_data *prog_data, + const struct nir_shader *nir, + int shader_time_index, + unsigned *final_assembly_size, + char **error_str); + +/** * Compile a tessellation evaluation shader. * * Returns the final assembly and the program's size. |