diff options
author | Axel Davy <[email protected]> | 2019-01-20 22:05:54 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2019-04-30 19:18:51 +0200 |
commit | 737df40a6387939f47eff38ab5294c24d7661bc7 (patch) | |
tree | 9bc3926dd1cbf511085b1349d249fbc6e0d1701a /src/gallium/state_trackers/nine | |
parent | d2cab4562cc82f3f6dd2436513f647b1ea271d50 (diff) |
st/nine: Track constant slots used
This tracking will be useful for constant compaction
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index e912ab3f643..dc3c6f3c9ea 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -508,6 +508,8 @@ struct shader_translator struct sm1_local_const *lconstb; unsigned num_lconstb; + boolean slots_used[NINE_MAX_CONST_ALL]; + boolean indirect_const_access; boolean failure; @@ -567,6 +569,8 @@ static struct ureg_src nine_float_constant_src(struct shader_translator *tx, int src = ureg_src_dimension(src, 0); } + if (!tx->info->swvp_on) + tx->slots_used[idx] = TRUE; if (tx->info->const_float_slots < (idx + 1)) tx->info->const_float_slots = idx + 1; @@ -585,8 +589,10 @@ static struct ureg_src nine_integer_constant_src(struct shader_translator *tx, i src = ureg_src_dimension(src, 0); } - if (!tx->info->swvp_on) + if (!tx->info->swvp_on) { + tx->slots_used[tx->info->const_i_base + idx] = TRUE; tx->info->int_slots_used[idx] = TRUE; + } if (tx->info->const_int_slots < (idx + 1)) tx->info->const_int_slots = idx + 1; @@ -609,8 +615,10 @@ static struct ureg_src nine_boolean_constant_src(struct shader_translator *tx, i } src = ureg_swizzle(src, s, s, s, s); - if (!tx->info->swvp_on) + if (!tx->info->swvp_on) { + tx->slots_used[tx->info->const_b_base + r] = TRUE; tx->info->bool_slots_used[idx] = TRUE; + } if (tx->info->const_bool_slots < (idx + 1)) tx->info->const_bool_slots = idx + 1; @@ -3517,6 +3525,7 @@ tx_ctor(struct shader_translator *tx, struct pipe_screen *screen, struct nine_sh info->position_t = FALSE; info->point_size = FALSE; + memset(tx->slots_used, 0, sizeof(tx->slots_used)); memset(info->int_slots_used, 0, sizeof(info->int_slots_used)); memset(info->bool_slots_used, 0, sizeof(info->bool_slots_used)); |