Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Blending has likely been broken from the move to float tiles, since
values are no longer automatically clamped.
Also, we need to rework it to properly support blending for both
fixed and floating point formats.
Note that this approach is probably suboptimal, and we should instead
always keep tiles with whatever data type the resource has, and blend
in the resource data type.
Blending in the resource data type gives the correct clamping semantics
for free, and should be faster.
|
|
Changes in v2:
- don't try to use SSE3 swizzles, fixes x86-64 build
This is probably undesirable in this form, since it will
quadruplicate the memory bandwidth and cache occupation for all
resources. It might however reduce the number of instructions.
(It also quadruplicates RAM usage, but we are fine with this, since
system RAM is typically four times the size of VRAM)
Making a byte-based llvmpipe and a float-based one coexist should
be the appropriate solution, but is not done in this patch currently.
|
|
Apparently, we were never clamping fragment colors, resulting in
broken OpenGL compliance in presence of blending, even without
floating point targets.
|
|
This changes makes softpipe clamp blend source, destination input,
source factor and destination factor if the target is fixed point.
Also, it makes it support an unclamped blend color properly.
Note this is NOT related to vertex/fragment clamping and is
independent of these controls, and only dependent on the type of
_each_ color buffer.
This is supposed to be the behavior specified by OpenGL 4.1 and
ARB_color_buffer_float.
Not sure about other APIs.
|
|
These paths don't support vertex clamping, and are anyway
obsoleted by LLVM.
If you want to re-enable them, add vertex clamping and test that it
works with the ARB_color_buffer_float piglit tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Otherwise, we lose precision and get the data always clamped.
TODO: should we always try this for floating point input data?
TODO: do the transfer operations benefit from conversion to fixed point
TODO: happening only after them?
|
|
|
|
This assumes that Gallium is to be interpreted as given drivers the
responsibility to clamp these colors if necessary.
|
|
Changes in v2:
- Fixes brokenness due to outdated code generator
|
|
TODO: what about display lists?
|
|
This follows the idea in this comment:
/* XXX
* This test should probably go away. Have the caller set/clear the
* IMAGE_CLAMP_BIT as needed.
*/
We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where
the operation mandates it.
TODO: did I get the set of operations mandating it right?
|
|
Changes in v2:
- Fix attributes other than vertex color sometimes getting clamped
|
|
|
|
|
|
|
|
To do this, we make ClampColor call FLUSH_VERTICES with the appropriate
_NEW flag.
We introduce _NEW_FRAG_CLAMP since fragment clamping has wide-ranging
effects, despite being in the Color attrib group.
This may be easily changed by s/_NEW_FRAG_CLAMP/_NEW_COLOR/g
|
|
|
|
Other than the texel saturation just added, I think we fully
implement the ARB extension, as far as I can tell.
|
|
Changed in a later patch when ARB_color_buffer_float support is added.
|
|
This should be faster, and the state tracker will automatically fall back
to the 32-bit formats.
|
|
|
|
|
|
|
|
|
|
|
|
It seems that nothing else is needed, since the format helpers
already support it.
I might be missing something though
|
|
At some point this actually triggered, not sure if it still does.
Give a meaningful assert and refuse to smash the stack anyway.
|
|
The new GLSL compiler doesn't support it.
Advertising it prevents Unigine Heaven from working, since it attempts to
use it.
|
|
nv50 should switch to rules-ng-ng too at some point.
The classic Mesa Nouveau driver also includes a copy of nouveau_class.h,
and should convert to rules-ng-ng too and remove it.
|
|
|
|
This is the new register generation toolkit in use by nouveau.
As far as I know, this is the best register description toolkit in
existence, and you should use it too for your hardware :)
Thanks to Marcin Kościelnicki for inventing it and performing
invaluable reverse engineering work of nVidia chips.
|
|
|
|
Thanks for Dave Airlie and Jerome Glisse for their code which made
me realize I need this too.
|
|
Hardware sets it to 0, so we add an ADD to put an 1 there if the
application really wants the alpha channel.
|
|
Completely untested, since Mesa apparently never uses this currently.
In particular, it might not work with scalar slot op.
|
|
The old swtnl code was broken by the new shader linkage support for
GLSL.
This is a rewrite of swtnl support, which should instead work properly,
be faster and more closer to the much more tested hardware pipeline.
|
|
|
|
|
|
|
|
Intuition != mathematics, so this time I actually worked out the right
formula for first order approximation of perspective interpolation.
Ironically, per quad divide actually makes things slower when compared
with per pixel divide -- probably because the divide hardware unit is
rarely used, whereas the multiply unit is typically already saturated
and the first order approximation imply more multiplications.
|
|
These are the non-trivial conversions that this function recognizes,
which was produced by u_format_compatible_test.c:
b8g8r8a8_unorm -> b8g8r8x8_unorm
a8r8g8b8_unorm -> x8r8g8b8_unorm
b5g5r5a1_unorm -> b5g5r5x1_unorm
b4g4r4a4_unorm -> b4g4r4x4_unorm
l8_unorm -> r8_unorm
i8_unorm -> l8_unorm
i8_unorm -> a8_unorm
i8_unorm -> r8_unorm
l16_unorm -> r16_unorm
z24_unorm_s8_uscaled -> z24x8_unorm
s8_uscaled_z24_unorm -> x8z24_unorm
r8g8b8a8_unorm -> r8g8b8x8_unorm
a8b8g8r8_srgb -> x8b8g8r8_srgb
b8g8r8a8_srgb -> b8g8r8x8_srgb
a8r8g8b8_srgb -> x8r8g8b8_srgb
a8b8g8r8_unorm -> x8b8g8r8_unorm
r10g10b10a2_uscaled -> r10g10b10x2_uscaled
r10sg10sb10sa2u_norm -> r10g10b10x2_snorm
State trackers and pipe drivers should be updated to take advantage of
this knowledge, e.g., in surface_copy.
|
|
Also, include the color buffer in the key. Not having it there
causes a tight knots in the logic to determine when it is OK or not
to discard previous color buffer contents.
|