intel: Rewrite the world of push/pull params

This moves us away to the array of pointers model and onto a model where
each param is represented by a generic uint32_t handle.  We reserve 2^16
of these handles for builtins that get generated by somewhere inside the
compiler and have well-defined meanings.  Generic params have handles
whose meanings are defined by the driver.

The primary downside to this new approach is that it moves a little bit
of the work that we would normally do at compile time to draw time.  On
my laptop this hurts OglBatch6 by no more than 1% and doesn't seem to
have any measurable affect on OglBatch7.  So, while this may come back
to bite us, it doesn't look too bad.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Jason Ekstrand
2017-09-28 16:25:31 -07:00
parent faad828b16
commit 2975e4c56a
23 changed files with 288 additions and 151 deletions

View File

@@ -465,7 +465,7 @@ fs_visitor::emit_fb_writes()
}
void
fs_visitor::setup_uniform_clipplane_values(gl_clip_plane *clip_planes)
fs_visitor::setup_uniform_clipplane_values()
{
const struct brw_vs_prog_key *key =
(const struct brw_vs_prog_key *) this->key;
@@ -474,7 +474,7 @@ fs_visitor::setup_uniform_clipplane_values(gl_clip_plane *clip_planes)
this->userplane[i] = fs_reg(UNIFORM, uniforms);
for (int j = 0; j < 4; ++j) {
stage_prog_data->param[uniforms + j] =
(gl_constant_value *) &clip_planes[i][j];
BRW_PARAM_BUILTIN_CLIP_PLANE(i, j);
}
uniforms += 4;
}
@@ -486,7 +486,7 @@ fs_visitor::setup_uniform_clipplane_values(gl_clip_plane *clip_planes)
* This does nothing if the shader uses gl_ClipDistance or user clipping is
* disabled altogether.
*/
void fs_visitor::compute_clip_distance(gl_clip_plane *clip_planes)
void fs_visitor::compute_clip_distance()
{
struct brw_vue_prog_data *vue_prog_data = brw_vue_prog_data(prog_data);
const struct brw_vs_prog_key *key =
@@ -518,7 +518,7 @@ void fs_visitor::compute_clip_distance(gl_clip_plane *clip_planes)
if (outputs[clip_vertex].file == BAD_FILE)
return;
setup_uniform_clipplane_values(clip_planes);
setup_uniform_clipplane_values();
const fs_builder abld = bld.annotate("user clip distances");