summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_tex.c
diff options
context:
space:
mode:
authorMaarten Maathuis <[email protected]>2009-12-29 23:59:08 +0100
committerMaarten Maathuis <[email protected]>2010-01-05 19:13:34 +0100
commitc77ade8fed2be933af3f493932cedee7ca868b04 (patch)
tree4afeb8ee5930553c41bee8bc83b5715b307e09cf /src/gallium/drivers/nv50/nv50_tex.c
parent29d2ab37e65c9242d01f63cc5376cb6929f9285f (diff)
nouveau: rewrite nouveau_stateobj to use BEGIN_RING properly
- The previous solution was hacky and didn't do subchannel autobinding. - The beheaviour should match what libdrm_nouveau does closely. - The solution remains statically sized, but when debugging is on it will check for abuse. Signed-off-by: Maarten Maathuis <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_tex.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_tex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c
index c4ca096d6ac..bef548b7286 100644
--- a/src/gallium/drivers/nv50/nv50_tex.c
+++ b/src/gallium/drivers/nv50/nv50_tex.c
@@ -199,16 +199,18 @@ nv50_tex_validate(struct nv50_context *nv50)
{
struct nouveau_stateobj *so;
struct nouveau_grobj *tesla = nv50->screen->tesla;
- unsigned p, push, nrlc;
+ unsigned p, start, push, nrlc;
- for (nrlc = 0, push = 0, p = 0; p < PIPE_SHADER_TYPES; ++p) {
+ for (nrlc = 0, start = 0, push = 0, p = 0; p < PIPE_SHADER_TYPES; ++p) {
+ start += MAX2(nv50->miptree_nr[p], nv50->state.miptree_nr[p]);
push += MAX2(nv50->miptree_nr[p], nv50->state.miptree_nr[p]);
nrlc += nv50->miptree_nr[p];
}
- push = push * 11 + 23 * PIPE_SHADER_TYPES + 4;
+ start = start * 2 + 4 * PIPE_SHADER_TYPES + 2;
+ push = push * 9 + 19 * PIPE_SHADER_TYPES + 2;
nrlc = nrlc * 2 + 2 * PIPE_SHADER_TYPES;
- so = so_new(push, nrlc);
+ so = so_new(start, push, nrlc);
if (nv50_validate_textures(nv50, so, PIPE_SHADER_VERTEX) == FALSE ||
nv50_validate_textures(nv50, so, PIPE_SHADER_FRAGMENT) == FALSE) {