summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-08-24 21:51:28 -0700
committerMatt Turner <[email protected]>2014-09-24 09:42:46 -0700
commit153d148e9e1f89a567b5079003b4b8070925ddcd (patch)
treea667145749bc6944c36666b430dd3fc9111677b2 /src
parent72bb3f81c621931e42759148bc8bddc511266dd0 (diff)
i965: Replace initialization loops with memset().
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp10
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp10
2 files changed, 5 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 323abff6744..cfc725dfcfb 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1514,9 +1514,8 @@ fs_visitor::calculate_urb_setup()
brw_wm_prog_data *prog_data = (brw_wm_prog_data*) this->prog_data;
brw_wm_prog_key *key = (brw_wm_prog_key*) this->key;
- for (unsigned int i = 0; i < VARYING_SLOT_MAX; i++) {
- prog_data->urb_setup[i] = -1;
- }
+ memset(prog_data->urb_setup, -1,
+ sizeof(prog_data->urb_setup[0]) * VARYING_SLOT_MAX);
int urb_next = 0;
/* Figure out where each of the incoming setup attributes lands. */
@@ -1820,10 +1819,7 @@ fs_visitor::move_uniform_array_access_to_pull_constants()
return;
pull_constant_loc = ralloc_array(mem_ctx, int, uniforms);
-
- for (unsigned int i = 0; i < uniforms; i++) {
- pull_constant_loc[i] = -1;
- }
+ memset(pull_constant_loc, -1, sizeof(pull_constant_loc[0]) * uniforms);
/* Walk through and find array access of uniforms. Put a copy of that
* uniform in the pull constant buffer.
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index ce0b2a730f2..92990290eb4 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -3332,10 +3332,7 @@ void
vec4_visitor::move_grf_array_access_to_scratch()
{
int scratch_loc[this->virtual_grf_count];
-
- for (int i = 0; i < this->virtual_grf_count; i++) {
- scratch_loc[i] = -1;
- }
+ memset(scratch_loc, -1, sizeof(scratch_loc));
/* First, calculate the set of virtual GRFs that need to be punted
* to scratch due to having any array access on them, and where in
@@ -3438,10 +3435,7 @@ void
vec4_visitor::move_uniform_array_access_to_pull_constants()
{
int pull_constant_loc[this->uniforms];
-
- for (int i = 0; i < this->uniforms; i++) {
- pull_constant_loc[i] = -1;
- }
+ memset(pull_constant_loc, -1, sizeof(pull_constant_loc));
/* Walk through and find array access of uniforms. Put a copy of that
* uniform in the pull constant buffer.