[Mesa-dev] [PATCH 00/13] i965/fs: refactor the texture emission code

Connor Abbott cwabbott0 at gmail.com
Mon Aug 4 14:28:04 PDT 2014


I've been working on a new IR for Mesa, which hopefully I'll be able to
share patches for soon, and one of the first things I want to use it for
is the i965 fs backend, so we can handle converting to SSA in the new IR
and then combine that with Matt's SSA work. To do this, I have to write
a new pass to convert the new IR to the FS IR, but right now a lot of
the work that needs to get done for that, especially around textures, is
rather GLSL IR-specific. In this series, the texture emit code is
refactored to be mostly agnostic about which IR we're emitting from (we
still use ir_texture_opcode, but that's much better than passing around
an ir_texture *). Now there is only one function that each frontend has
to call, emit_texture(), that handles all the logic of creating a
texture instruction while not caring what IR it's emitting from. As a
side benefit, we also get to clean up the Mesa IR frontend which was
previously creating a fake ir_texture * to hack around the mess.

No piglit changes on my Ivy Bridge.

Connor Abbott (13):
  i965/fs: don't use ir->shadow_comparitor in emit_texture_*
  i965: make brw_texture_offset() more generic
  i965/fs: don't use ir->offset in emit_texture_*
  i965/fs: make emit_mcs_fetch() more generic
  i965/fs: make rescale_texcoord() more generic
  i965/fs: don't use ir->coordinate in emit_texture_*
  i965: don't use ir->lod_info.grad.dPd<x,y> in emit_texture_*
  i965/fs: don't use ir->type in emit_texture_gen4()
  i965/fs: don't pass in ir_texture to emit_texture_*
  i965/fs: make swizzle_result() more generic
  i965/fs: make gather_channel() more generic
  i965/fs: refactor the texture emission logic into a single function
  i965/fs: don't make a fake ir_texture in the Mesa IR frontend

 src/mesa/drivers/dri/i965/brw_fs.h             |  40 ++-
 src/mesa/drivers/dri/i965/brw_fs_fp.cpp        |  50 +---
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   | 348 ++++++++++++++-----------
 src/mesa/drivers/dri/i965/brw_shader.cpp       |  13 +-
 src/mesa/drivers/dri/i965/brw_shader.h         |   3 +-
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |   4 +-
 6 files changed, 246 insertions(+), 212 deletions(-)

-- 
1.9.3



More information about the mesa-dev mailing list