[Mesa-dev] [PATCH] r600g: implement fast color clears on evergreen+

Marek Olšák maraeo at gmail.com
Tue Jun 11 04:11:32 PDT 2013


On Tue, Jun 11, 2013 at 3:16 AM, Roland Scheidegger <sroland at vmware.com> wrote:
> Am 11.06.2013 02:41, schrieb Marek Olšák:
>>
>> Hi Grirogi,
>>
>> Is this for disallowing integer textures? You probably wanted to use
>> util_format_is_pure_integer, which is more clear. pack_rgba_float
>> should be non-NULL for every non-integer format.
>>
>> Anyway, it should be possible to support integer textures too, though
>> util_pack_color might need some improvements. If you are convinced
>> integer textures are not important, it's alright with me.
> Yes there's workarounds for not using util_pack_color in llvmpipe too
> for integer textures. I was considering if it would be worth extending
> it but didn't do it in the end. The problem is at least for OpenGL you'd
> also need other input format, not just floats otherwise you won't end up
> with exact values for int32 formats (for d3d10 this is actually not a
> problem since clear values and the like are always float32 and yes it
> means you can't clear int32 formats to an exact value, at least not if
> that value is > 2^24).

The input type can be a union, like this:

void util_pack_color(const pipe_color_union *input, enum pipe_format
format, union util_color *uc);


>
>>
>>
>>> +
>>> +               /* array textures (and cubemaps) are not supported */
>>> +               if (tex->surface.array_size != 1) {
>>> +                       return false;
>>> +               }
>>
>> Cubemaps have array_size == 1. You need to check the texture target
>> instead. (The depth clear code seems to have the same bug.)
> Or I guess you could take the array_size from the base type if it is
> around somewhere - because in gallium cubemaps do have array_size == 6.
> (Though I'm not sure if you also need to distinguish "fake" array
> textures which were generated as an array texture but with array size 1
> from non-array texture.)

This is news to me. I thought array_size was undefined if the target
wasn't an array. Anyway, I don't really trust state trackers on this
one.

Marek


More information about the mesa-dev mailing list