summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_fs.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-09-28 16:25:31 -0700
committerJason Ekstrand <[email protected]>2017-10-12 22:39:29 -0700
commit2975e4c56a7aeade5a324aa4d446f18cc176fa06 (patch)
treef08787f03d0781b1d7823095acabf3e86d5522ec /src/intel/compiler/brw_fs.cpp
parentfaad828b16448c1008a1b15ac8d8a72b13005c09 (diff)
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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_fs.cpp')
-rw-r--r--src/intel/compiler/brw_fs.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index a40b910c1a0..c1d67750a3a 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -2084,10 +2084,9 @@ fs_visitor::assign_constant_locations()
/* As the uniforms are going to be reordered, take the data from a temporary
* copy of the original param[].
*/
- gl_constant_value **param = ralloc_array(NULL, gl_constant_value*,
- stage_prog_data->nr_params);
+ uint32_t *param = ralloc_array(NULL, uint32_t, stage_prog_data->nr_params);
memcpy(param, stage_prog_data->param,
- sizeof(gl_constant_value*) * stage_prog_data->nr_params);
+ sizeof(uint32_t) * stage_prog_data->nr_params);
stage_prog_data->nr_params = num_push_constants;
stage_prog_data->nr_pull_params = num_pull_constants;
@@ -2115,8 +2114,7 @@ fs_visitor::assign_constant_locations()
*/
int new_thread_local_id_index = -1;
for (unsigned int i = 0; i < uniforms; i++) {
- const gl_constant_value *value = param[i];
-
+ uint32_t value = param[i];
if (pull_constant_loc[i] != -1) {
stage_prog_data->pull_param[pull_constant_loc[i]] = value;
} else if (push_constant_loc[i] != -1) {
@@ -5967,7 +5965,7 @@ fs_visitor::allocate_registers(bool allow_spilling)
}
bool
-fs_visitor::run_vs(gl_clip_plane *clip_planes)
+fs_visitor::run_vs()
{
assert(stage == MESA_SHADER_VERTEX);
@@ -5981,7 +5979,7 @@ fs_visitor::run_vs(gl_clip_plane *clip_planes)
if (failed)
return false;
- compute_clip_distance(clip_planes);
+ compute_clip_distance();
emit_urb_writes();