diff options
author | Jason Ekstrand <[email protected]> | 2017-09-29 10:50:07 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-10-12 22:39:30 -0700 |
commit | 4dfb8b3416e2c7c069ac11736362e9dc3860f72c (patch) | |
tree | 3925c5de5807606ad1bf07512a18166e3d6142d8 /src/intel/compiler | |
parent | 6bcc5c0c75226bb89f35d7529de11182051c729e (diff) |
intel/vs: Grow the param array for clip planes
Instead of requiring the caller of brw_compile_vs to figure it out, just
grow the param array on-demand.
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r-- | src/intel/compiler/brw_fs_visitor.cpp | 7 | ||||
-rw-r--r-- | src/intel/compiler/brw_vec4_vs_visitor.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_fs_visitor.cpp b/src/intel/compiler/brw_fs_visitor.cpp index 4ee1d4e0022..32fe0fc054b 100644 --- a/src/intel/compiler/brw_fs_visitor.cpp +++ b/src/intel/compiler/brw_fs_visitor.cpp @@ -470,6 +470,13 @@ fs_visitor::setup_uniform_clipplane_values() const struct brw_vs_prog_key *key = (const struct brw_vs_prog_key *) this->key; + if (key->nr_userclip_plane_consts == 0) + return; + + assert(stage_prog_data->nr_params == uniforms); + brw_stage_prog_data_add_params(stage_prog_data, + key->nr_userclip_plane_consts * 4); + for (int i = 0; i < key->nr_userclip_plane_consts; i++) { this->userplane[i] = fs_reg(UNIFORM, uniforms); for (int j = 0; j < 4; ++j) { diff --git a/src/intel/compiler/brw_vec4_vs_visitor.cpp b/src/intel/compiler/brw_vec4_vs_visitor.cpp index 86f365e2f0f..4d8ae23b0c7 100644 --- a/src/intel/compiler/brw_vec4_vs_visitor.cpp +++ b/src/intel/compiler/brw_vec4_vs_visitor.cpp @@ -119,6 +119,13 @@ vec4_vs_visitor::emit_clip_distances(dst_reg reg, int offset) void vec4_vs_visitor::setup_uniform_clipplane_values() { + if (key->nr_userclip_plane_consts == 0) + return; + + assert(stage_prog_data->nr_params == (unsigned)this->uniforms * 4); + brw_stage_prog_data_add_params(stage_prog_data, + key->nr_userclip_plane_consts * 4); + for (int i = 0; i < key->nr_userclip_plane_consts; ++i) { this->userplane[i] = dst_reg(UNIFORM, this->uniforms); this->userplane[i].type = BRW_REGISTER_TYPE_F; |