[3/5] WineD3D: Fix D3DFMT_R32F, R16F, G16R16F, ... in the pixel shader

Henri Verbeet hverbeet at gmail.com
Thu Nov 27 07:09:04 CST 2008

2008/11/27 Stefan Dösinger <stefan at codeweavers.com>:
>> I'm not really convinced either. I would prefer something more
>> descriptive, (like the way EXT_texture_swizzle handles this, for
>> example), rather than listing every combination we use in an enum.
> I don't think that gains us a lot(and how do you describe something like YUV
> conversions?) These texture fixups apply to the shader, while
> GL_EXT_texture_swizzle applies to the texture.
It's not about gaining stuff, it's about creating an interface that
makes sense, even in the long term. If I look at the shader_color_conv
enum, I might be able to guess what each element is supposed to do,
but I don't really know until I look at what formats it's used with,
and how GLSL and ARB implement that specific conversion. That's bad if
I would want to implement a shader backend, but it's also bad if I
want to add support for a new format that needs this kind of
conversion. I would need to look through the list and implementation
to see if there's a conversion that does what I want, and if there
isn't, add an element to the list and implement it in all backends.
Describing the operation that needs to be performed on each component
on the other hand would allow both the implementation and the code
using it to be mostly generic.

More information about the wine-devel mailing list