diff options
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_program.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index d7b240a8b9c..5bfdcca216b 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -143,9 +143,30 @@ brwProgramStringNotify(struct gl_context *ctx, _tnl_program_string(ctx, target, prog); } + brw_add_texrect_params(prog); + return true; } +void +brw_add_texrect_params(struct gl_program *prog) +{ + for (int texunit = 0; texunit < BRW_MAX_TEX_UNIT; texunit++) { + if (!(prog->TexturesUsed[texunit] & (1 << TEXTURE_RECT_INDEX))) + continue; + + int tokens[STATE_LENGTH] = { + STATE_INTERNAL, + STATE_TEXRECT_SCALE, + texunit, + 0, + 0 + }; + + _mesa_add_state_reference(prog->Parameters, (gl_state_index *)tokens); + } +} + /* Per-thread scratch space is a power-of-two multiple of 1KB. */ int brw_get_scratch_size(int size) |