i965: Get rid of the do_lower_unnormalized_offsets pass

We can do this in NIR now.  No need to keep a GLSL pass lying around for
it.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
(cherry picked from commit 67b7d876e4)
This commit is contained in:
Jason Ekstrand 2016-07-21 13:07:17 -07:00 committed by Emil Velikov
parent ddd048bbf5
commit eb96145c74
4 changed files with 0 additions and 109 deletions

View file

@ -134,7 +134,6 @@ i965_FILES = \
brw_gs_surface_state.c \
brw_link.cpp \
brw_lower_texture_gradients.cpp \
brw_lower_unnormalized_offset.cpp \
brw_meta_util.c \
brw_meta_util.h \
brw_misc_state.c \

View file

@ -1824,7 +1824,6 @@ brw_program_reloc(struct brw_context *brw, uint32_t state_offset,
bool brw_do_cubemap_normalize(struct exec_list *instructions);
bool brw_lower_texture_gradients(struct brw_context *brw,
struct exec_list *instructions);
bool brw_do_lower_unnormalized_offset(struct exec_list *instructions);
extern const char * const conditional_modifier[16];
extern const char *const pred_ctrl_align16[16];

View file

@ -126,7 +126,6 @@ process_glsl_ir(gl_shader_stage stage,
do_vec_index_to_cond_assign(shader->ir);
lower_vector_insert(shader->ir, true);
lower_offset_arrays(shader->ir);
brw_do_lower_unnormalized_offset(shader->ir);
lower_noise(shader->ir);
lower_quadop_vector(shader->ir, false);

View file

@ -1,106 +0,0 @@
/*
* Copyright © 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/**
* \file brw_lower_unnormalized_offset.cpp
*
* IR lower pass to convert a texture offset into an adjusted coordinate,
* for use with unnormalized coordinates. At least the gather4* messages
* on Ivybridge and Haswell make a mess with nonzero offsets.
*
* \author Chris Forbes <chrisf@ijw.co.nz>
*/
#include "compiler/glsl_types.h"
#include "compiler/glsl/ir.h"
#include "compiler/glsl/ir_builder.h"
using namespace ir_builder;
class brw_lower_unnormalized_offset_visitor : public ir_hierarchical_visitor {
public:
brw_lower_unnormalized_offset_visitor()
{
progress = false;
}
ir_visitor_status visit_leave(ir_texture *ir);
bool progress;
};
ir_visitor_status
brw_lower_unnormalized_offset_visitor::visit_leave(ir_texture *ir)
{
if (!ir->offset)
return visit_continue;
if (ir->op == ir_tg4 || ir->op == ir_tex) {
if (ir->sampler->type->sampler_dimensionality != GLSL_SAMPLER_DIM_RECT)
return visit_continue;
}
else if (ir->op != ir_txf) {
return visit_continue;
}
void *mem_ctx = ralloc_parent(ir);
if (ir->op == ir_txf) {
/* It appears that the ld instruction used for txf does its
* address bounds check before adding in the offset. To work
* around this, just add the integer offset to the integer texel
* coordinate, and don't put the offset in the header.
*/
ir_variable *var = new(mem_ctx) ir_variable(ir->coordinate->type,
"coordinate",
ir_var_temporary);
base_ir->insert_before(var);
base_ir->insert_before(assign(var, ir->coordinate));
base_ir->insert_before(assign(var,
add(swizzle_for_size(var, ir->offset->type->vector_elements), ir->offset),
(1 << ir->offset->type->vector_elements) - 1));
ir->coordinate = new(mem_ctx) ir_dereference_variable(var);
} else {
ir->coordinate = add(ir->coordinate, i2f(ir->offset));
}
ir->offset = NULL;
progress = true;
return visit_continue;
}
extern "C" {
bool
brw_do_lower_unnormalized_offset(exec_list *instructions)
{
brw_lower_unnormalized_offset_visitor v;
visit_list_elements(&v, instructions);
return v.progress;
}
}