void emit_interpolation_setup_gen4();
void emit_interpolation_setup_gen6();
void compute_sample_position(fs_reg dst, fs_reg int_sample_pos);
- fs_reg rescale_texcoord(ir_texture *ir, fs_reg coordinate,
+ fs_reg rescale_texcoord(fs_reg coordinate, const glsl_type *coord_type,
bool is_rect, uint32_t sampler, int texunit);
fs_inst *emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate,
fs_reg shadow_comp, fs_reg lod, fs_reg lod2,
if (fpi->TexShadow)
shadow_c = offset(coordinate, 2);
- coordinate = rescale_texcoord(ir, coordinate,
+ coordinate = rescale_texcoord(coordinate, coordinate_type,
fpi->TexSrcTarget == TEXTURE_RECT_INDEX,
fpi->TexSrcUnit, fpi->TexSrcUnit);
}
fs_reg
-fs_visitor::rescale_texcoord(ir_texture *ir, fs_reg coordinate,
+fs_visitor::rescale_texcoord(fs_reg coordinate, const glsl_type *coord_type,
bool is_rect, uint32_t sampler, int texunit)
{
fs_inst *inst = NULL;
* tracking to get the scaling factor.
*/
if (brw->gen < 6 && is_rect) {
- fs_reg dst = fs_reg(this, ir->coordinate->type);
+ fs_reg dst = fs_reg(this, coord_type);
fs_reg src = coordinate;
coordinate = dst;
}
}
- if (ir->coordinate && needs_gl_clamp) {
- for (unsigned int i = 0;
- i < MIN2(ir->coordinate->type->vector_elements, 3); i++) {
+ if (coord_type && needs_gl_clamp) {
+ for (unsigned int i = 0; i < MIN2(coord_type->vector_elements, 3); i++) {
if (tex->gl_clamp_mask[i] & (1 << sampler)) {
fs_reg chan = coordinate;
chan = offset(chan, i);
if (ir->coordinate) {
ir->coordinate->accept(this);
- coordinate = rescale_texcoord(ir, this->result,
+ coordinate = rescale_texcoord(this->result,
+ ir->coordinate->type,
ir->sampler->type->sampler_dimensionality ==
GLSL_SAMPLER_DIM_RECT,
sampler, texunit);