Skip to content

r300: move presubtract pass later

The big picture is that we want to move presubtract after rc_remove_constants because we can't reswizzle presubtract sources and we need to pack multiple float uniforms into vec4 slots (which we can't if they are used in presubtract source) to be able to run glamor shaders on R400. I have a WIP branch for the packing, and I'm operating really close to the HW limits there, so every little bit helps.

The pass mostly works OK as is, the detection logic just needs to recognize the case when 2.0 was converted to inline constant for the bias presub op.

There are some improvements in omod at the expense of presubtracts (because we now do omod first so imagine a sequnce like 4.0 * (a+b) which would be previously turned to add presubtract of the mul, and now will be omod*4 of the add), but it should be more or less even in total. The second patch is a small optimization for inline constants (turns out we can have inline constant as presubtract source) and we can access the inline constant with any swizzle so add some reswizzling to increase the chance of passing the presubtract requirements.

Shader-db stats in the individual commits.

Merge request reports