mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 10:50:10 +01:00
r300g: fix texturing with non-3D textures and wrap R mode set to sample border
If the wrap R (3rd) mode is set to CLAMP or CLAMP_TO_BORDER and the texture isn't 3D, r300 always samples the border color regardless of texture coordinates. I HATE THIS HARDWARE. NOTE: This is a candidate for the 7.10 branch.
This commit is contained in:
parent
466ce95ddf
commit
da8b4c0798
1 changed files with 6 additions and 0 deletions
|
|
@ -854,6 +854,12 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300)
|
|||
texstate->filter0 |= R300_TX_WRAP_T(R300_TX_CLAMP_TO_EDGE);
|
||||
}
|
||||
|
||||
/* The hardware doesn't like CLAMP and CLAMP_TO_BORDER
|
||||
* for the 3rd coordinate if the texture isn't 3D. */
|
||||
if (tex->b.b.b.target != PIPE_TEXTURE_3D) {
|
||||
texstate->filter0 &= ~R300_TX_WRAP_R_MASK;
|
||||
}
|
||||
|
||||
if (tex->tex.is_npot) {
|
||||
/* NPOT textures don't support mip filter, unfortunately.
|
||||
* This prevents incorrect rendering. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue