aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-09-08 20:56:59 -0400
committerIan Romanick <[email protected]>2017-09-21 10:29:49 -0500
commitc5b4a5b96775ef681ad33234505105d5091ee48b (patch)
tree208eaa5243a6758ec4ac54a087a550998d2b7ac6 /src/mesa/drivers/dri/nouveau
parent953a3cf0fd9ac5ebfdc0a1bcebead367b4719039 (diff)
nv20: Enable ARB_texture_border_clamp
Fixes quite a few 'texwrap [12]d border color only' tests on NV20 (10de:0201). All told, 40 more tests pass. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian RomanicK <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Tested-by: Ian RomanicK <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_state_tex.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
index 7972069dcbb..72df81476c5 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -165,7 +165,8 @@ nv20_emit_tex_obj(struct gl_context *ctx, int emit)
struct nouveau_surface *s;
struct gl_texture_image *ti;
const struct gl_sampler_object *sa;
- uint32_t tx_format, tx_filter, tx_wrap, tx_enable;
+ uint8_t r, g, b, a;
+ uint32_t tx_format, tx_filter, tx_wrap, tx_bcolor, tx_enable;
PUSH_RESET(push, BUFCTX_TEX(i));
@@ -211,6 +212,29 @@ nv20_emit_tex_obj(struct gl_context *ctx, int emit)
| nvgl_filter_mode(sa->MinFilter) << 16
| 2 << 12;
+ r = FLOAT_TO_UBYTE(sa->BorderColor.f[0]);
+ g = FLOAT_TO_UBYTE(sa->BorderColor.f[1]);
+ b = FLOAT_TO_UBYTE(sa->BorderColor.f[2]);
+ a = FLOAT_TO_UBYTE(sa->BorderColor.f[3]);
+ switch (ti->_BaseFormat) {
+ case GL_LUMINANCE:
+ a = 0xff;
+ /* fallthrough */
+ case GL_LUMINANCE_ALPHA:
+ g = b = r;
+ break;
+ case GL_RGB:
+ a = 0xff;
+ break;
+ case GL_INTENSITY:
+ g = b = a = r;
+ break;
+ case GL_ALPHA:
+ r = g = b = 0;
+ break;
+ }
+ tx_bcolor = b << 0 | g << 8 | r << 16 | a << 24;
+
tx_enable = NV20_3D_TEX_ENABLE_ENABLE
| log2i(sa->MaxAnisotropy) << 4;
@@ -259,6 +283,9 @@ nv20_emit_tex_obj(struct gl_context *ctx, int emit)
BEGIN_NV04(push, NV20_3D(TEX_FILTER(i)), 1);
PUSH_DATA (push, tx_filter);
+ BEGIN_NV04(push, NV20_3D(TEX_BORDER_COLOR(i)), 1);
+ PUSH_DATA (push, tx_bcolor);
+
BEGIN_NV04(push, NV20_3D(TEX_ENABLE(i)), 1);
PUSH_DATA (push, tx_enable);