[Mesa-dev] [PATCH 03/10] i965/fs: Refactor rectangle/GL_CLAMP texture coordinate adjustment.
Eric Anholt
eric at anholt.net
Mon Sep 24 13:42:12 PDT 2012
Kenneth Graunke <kenneth at whitecape.org> writes:
> On 09/22/2012 02:04 PM, Eric Anholt wrote:
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> index da09538..5bd7238 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> @@ -1159,32 +1159,19 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
>> return inst;
>> }
>>
>> -/**
>> - * Emit code to produce the coordinates for a texture lookup.
>> - *
>> - * Returns the fs_reg containing the texture coordinate (as opposed to
>> - * setting this->result).
>> - */
>> fs_reg
>> -fs_visitor::emit_texcoord(ir_texture *ir, int sampler, int texunit)
>> +fs_visitor::rescale_texcoord(ir_texture *ir, fs_reg coordinate,
>> + bool is_rect, int sampler, int texunit)
>> {
>
> Do you actually want to pass an ir_texture* here? All you actually need
> is to pass ir->coordinate->type, which might be a little cleaner for
> your new code. Not sure.
I needed an ir_texture * in the new code anyway because emit_texture_*
wanted ir->op, ir->coordinate->type, ir->lod_info.*->type, and ir->type.
> The rectangle/GL_CLAMP coordinate adjustment was the entire reason I
> refactored this code into emit_texcoord(), and I feel like
> emit_texcoord() is rather pointless after your change. Can we just fold
> it back into visit()?
Sounds good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120924/41acd61b/attachment.pgp>
More information about the mesa-dev
mailing list