[3/3] WineD3D: Create a common sampling function in GLSL
stefan at codeweavers.com
Wed Feb 25 14:13:42 CST 2009
This is a changed version that addresses Henri's concerns.
> You need to pass dst_swizzle as a swizzle + write mask instead of a
> string. As an API it's nicer than passing in random strings, but you
> will also need this when you're going to integrate the fixup code.
> I think it's a bit silly to pass sample_function to this function, the
> caller will only call shader_glsl_get_sample_function() to pass it to
> this function, so you might as well call it yourself.
Some instruction handlers need the info returned from get_sample_function
themselves to generate the address argument string. This also keeps the
number of parameters passed to shader_glsl_gen_sample_code in check.
> > + shader_glsl_append_dst(arg->buffer, arg);
> I'm not sure about this one. It's not strictly necessary to do this in
> the caller, but it would be more consistent between different
> instruction handlers to do it there, and have
> shader_glsl_gen_sample_code() only generate the second part of the
It allows shader_glsl_gen_sample_code() to read into a temp register if needed
for the color fixups, e.g. if we ever run into texld_bx2.
> > + sprintf(instr, "%sLod", sample_function.name);
> > + sample_function.name = instr;
> > + shader_glsl_gen_sample_code(arg, sampler_idx, coord_param.param_str,
> > + &sample_function, dst_swizzle,
> > + lod_param.param_str);
> This is just ugly.
Fixed that too
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 22508 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20090225/56c3fa0f/attachment-0001.patch
More information about the wine-patches