diff options
author | Francisco Jerez <[email protected]> | 2015-06-28 21:04:17 +0300 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2015-07-29 14:12:48 +0300 |
commit | a0c02d2bbb765b0e997ad524d8e51838e529d9c0 (patch) | |
tree | 449b9079b4995ea469b0db327411880cb9a4f222 /src/mesa/drivers/dri/i965/brw_fs.cpp | |
parent | bd0d6a9cce8b28357888bb261fac639e2833c51f (diff) |
i965: Define the setup_vector_uniform_values() backend_visitor interface.
This cleans up the VEC4 implementation of setup_uniform_values()
somewhat and will avoid duplication of the image uniform upload code
by having a common interface to upload a vector of uniforms on either
back-end.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 6d6de3bc677..289757f1e28 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -897,6 +897,18 @@ fs_visitor::import_uniforms(fs_visitor *v) this->param_size = v->param_size; } +void +fs_visitor::setup_vector_uniform_values(const gl_constant_value *values, unsigned n) +{ + static const gl_constant_value zero = { 0 }; + + for (unsigned i = 0; i < n; ++i) + stage_prog_data->param[uniforms++] = &values[i]; + + for (unsigned i = n; i < 4; ++i) + stage_prog_data->param[uniforms++] = &zero; +} + fs_reg * fs_visitor::emit_fragcoord_interpolation(bool pixel_center_integer, bool origin_upper_left) |