mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
i965/fs: make rescale_texcoord() not use ir_texture.
Our new IR won't have ir_texture objects, but using glsl_type is fine. v2 (Ken): Drop redundant ir->coordinate NULL check; rebase. Signed-off-by: Connor Abbott <connor.abbott@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
This commit is contained in:
parent
e599837fed
commit
a8905e8c09
3 changed files with 8 additions and 8 deletions
|
|
@ -468,7 +468,7 @@ public:
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ fs_visitor::emit_fragment_program_code()
|
|||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1689,7 +1689,7 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
@ -1751,7 +1751,7 @@ fs_visitor::rescale_texcoord(ir_texture *ir, fs_reg coordinate,
|
|||
* 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;
|
||||
|
||||
|
|
@ -1791,9 +1791,8 @@ fs_visitor::rescale_texcoord(ir_texture *ir, fs_reg coordinate,
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
@ -1923,7 +1922,8 @@ fs_visitor::visit(ir_texture *ir)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue