mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 09:10:11 +01:00
i965: Skip _mesa_load_state_parameters when there are zero parameters.
Saves a tiny bit of CPU overhead. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Acked-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
6f7371619c
commit
5e37a2a4a8
2 changed files with 11 additions and 11 deletions
|
|
@ -59,11 +59,6 @@ brw_upload_pull_constants(struct brw_context *brw,
|
||||||
int i;
|
int i;
|
||||||
uint32_t surf_index = prog_data->binding_table.pull_constants_start;
|
uint32_t surf_index = prog_data->binding_table.pull_constants_start;
|
||||||
|
|
||||||
/* Updates the ParamaterValues[i] pointers for all parameters of the
|
|
||||||
* basic type of PROGRAM_STATE_VAR.
|
|
||||||
*/
|
|
||||||
_mesa_load_state_parameters(&brw->ctx, prog->Parameters);
|
|
||||||
|
|
||||||
if (!prog_data->nr_pull_params) {
|
if (!prog_data->nr_pull_params) {
|
||||||
if (stage_state->surf_offset[surf_index]) {
|
if (stage_state->surf_offset[surf_index]) {
|
||||||
stage_state->surf_offset[surf_index] = 0;
|
stage_state->surf_offset[surf_index] = 0;
|
||||||
|
|
@ -72,6 +67,11 @@ brw_upload_pull_constants(struct brw_context *brw,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Updates the ParamaterValues[i] pointers for all parameters of the
|
||||||
|
* basic type of PROGRAM_STATE_VAR.
|
||||||
|
*/
|
||||||
|
_mesa_load_state_parameters(&brw->ctx, prog->Parameters);
|
||||||
|
|
||||||
/* CACHE_NEW_*_PROG | _NEW_PROGRAM_CONSTANTS */
|
/* CACHE_NEW_*_PROG | _NEW_PROGRAM_CONSTANTS */
|
||||||
uint32_t size = prog_data->nr_pull_params * 4;
|
uint32_t size = prog_data->nr_pull_params * 4;
|
||||||
drm_intel_bo *const_bo = NULL;
|
drm_intel_bo *const_bo = NULL;
|
||||||
|
|
|
||||||
|
|
@ -58,15 +58,15 @@ gen6_upload_push_constants(struct brw_context *brw,
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = &brw->ctx;
|
struct gl_context *ctx = &brw->ctx;
|
||||||
|
|
||||||
/* Updates the ParamaterValues[i] pointers for all parameters of the
|
|
||||||
* basic type of PROGRAM_STATE_VAR.
|
|
||||||
*/
|
|
||||||
/* XXX: Should this happen somewhere before to get our state flag set? */
|
|
||||||
_mesa_load_state_parameters(ctx, prog->Parameters);
|
|
||||||
|
|
||||||
if (prog_data->nr_params == 0) {
|
if (prog_data->nr_params == 0) {
|
||||||
stage_state->push_const_size = 0;
|
stage_state->push_const_size = 0;
|
||||||
} else {
|
} else {
|
||||||
|
/* Updates the ParamaterValues[i] pointers for all parameters of the
|
||||||
|
* basic type of PROGRAM_STATE_VAR.
|
||||||
|
*/
|
||||||
|
/* XXX: Should this happen somewhere before to get our state flag set? */
|
||||||
|
_mesa_load_state_parameters(ctx, prog->Parameters);
|
||||||
|
|
||||||
gl_constant_value *param;
|
gl_constant_value *param;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue