X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fnouveau%2Fnv10_render.c;h=9b2cf229f8542825fe5a77ae81819ca206cd1120;hb=HEAD;hp=20fb44784263d828f4fd458cd947d0037552842f;hpb=9032d2a13ecd019206a48767d9205c0aafa7cca2;p=mesa.git diff --git a/src/mesa/drivers/dri/nouveau/nv10_render.c b/src/mesa/drivers/dri/nouveau/nv10_render.c index 20fb4478426..9b2cf229f85 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_render.c +++ b/src/mesa/drivers/dri/nouveau/nv10_render.c @@ -72,19 +72,19 @@ static struct nouveau_attr_info nv10_vertex_attrs[VERT_ATTRIB_MAX] = { .imm_method = NV10_3D_VERTEX_FOG_1F, .imm_fields = 1, }, - [VERT_ATTRIB_GENERIC0] = { + [VERT_ATTRIB_MAT(0)] = { .emit = nv10_emit_material, }, - [VERT_ATTRIB_GENERIC2] = { + [VERT_ATTRIB_MAT(2)] = { .emit = nv10_emit_material, }, - [VERT_ATTRIB_GENERIC4] = { + [VERT_ATTRIB_MAT(4)] = { .emit = nv10_emit_material, }, - [VERT_ATTRIB_GENERIC6] = { + [VERT_ATTRIB_MAT(6)] = { .emit = nv10_emit_material, }, - [VERT_ATTRIB_GENERIC8] = { + [VERT_ATTRIB_MAT(8)] = { .emit = nv10_emit_material, }, }; @@ -99,7 +99,7 @@ get_hw_format(int type) case GL_UNSIGNED_SHORT: return NV10_3D_VTXBUF_FMT_TYPE_V16_SNORM; case GL_UNSIGNED_BYTE: - return NV10_3D_VTXBUF_FMT_TYPE_B8G8R8A8_UNORM; + return NV10_3D_VTXBUF_FMT_TYPE_U8_UNORM; default: assert(0); } @@ -109,8 +109,7 @@ static void nv10_render_set_format(struct gl_context *ctx) { struct nouveau_render_state *render = to_render_state(ctx); - struct nouveau_channel *chan = context_chan(ctx); - struct nouveau_grobj *celsius = context_eng3d(ctx); + struct nouveau_pushbuf *push = context_push(ctx); int i, attr, hw_format; FOR_EACH_ATTR(render, i, attr) { @@ -128,8 +127,8 @@ nv10_render_set_format(struct gl_context *ctx) hw_format = NV10_3D_VTXBUF_FMT_TYPE_V32_FLOAT; } - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_FMT(i), 1); - OUT_RING(chan, hw_format); + BEGIN_NV04(push, NV10_3D(VTXBUF_FMT(i)), 1); + PUSH_DATA (push, hw_format); } } @@ -137,59 +136,63 @@ static void nv10_render_bind_vertices(struct gl_context *ctx) { struct nouveau_render_state *render = to_render_state(ctx); - struct nouveau_bo_context *bctx = context_bctx(ctx, VERTEX); - struct nouveau_grobj *celsius = context_eng3d(ctx); + struct nouveau_pushbuf *push = context_push(ctx); int i, attr; FOR_EACH_BOUND_ATTR(render, i, attr) { struct nouveau_array *a = &render->attrs[attr]; - nouveau_bo_markl(bctx, celsius, - NV10_3D_VTXBUF_OFFSET(i), - a->bo, a->offset, - NOUVEAU_BO_GART | NOUVEAU_BO_RD); + BEGIN_NV04(push, NV10_3D(VTXBUF_OFFSET(i)), 1); + PUSH_MTHDl(push, NV10_3D(VTXBUF_OFFSET(i)), BUFCTX_VTX, + a->bo, a->offset, NOUVEAU_BO_GART | + NOUVEAU_BO_RD); } } +static void +nv10_render_release_vertices(struct gl_context *ctx) +{ + PUSH_RESET(context_push(ctx), BUFCTX_VTX); +} + /* Vertex array rendering defs. */ -#define RENDER_LOCALS(ctx) \ - struct nouveau_grobj *celsius = context_eng3d(ctx) +#define RENDER_LOCALS(ctx) #define BATCH_VALIDATE() \ - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_VALIDATE, 1); \ - OUT_RING(chan, 0) + BEGIN_NV04(push, NV10_3D(VTXBUF_VALIDATE), 1); \ + PUSH_DATA (push, 0) #define BATCH_BEGIN(prim) \ - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_BEGIN_END, 1); \ - OUT_RING(chan, prim) + BEGIN_NV04(push, NV10_3D(VTXBUF_BEGIN_END), 1); \ + PUSH_DATA (push, prim) #define BATCH_END() \ - BEGIN_RING(chan, celsius, NV10_3D_VTXBUF_BEGIN_END, 1); \ - OUT_RING(chan, 0) + BEGIN_NV04(push, NV10_3D(VTXBUF_BEGIN_END), 1); \ + PUSH_DATA (push, 0) #define MAX_PACKET 0x400 #define MAX_OUT_L 0x100 #define BATCH_PACKET_L(n) \ - BEGIN_RING_NI(chan, celsius, NV10_3D_VTXBUF_BATCH, n) + BEGIN_NI04(push, NV10_3D(VTXBUF_BATCH), n) #define BATCH_OUT_L(i, n) \ - OUT_RING(chan, ((n) - 1) << 24 | (i)) + PUSH_DATA (push, ((n) - 1) << 24 | (i)) #define MAX_OUT_I16 0x2 #define BATCH_PACKET_I16(n) \ - BEGIN_RING_NI(chan, celsius, NV10_3D_VTXBUF_ELEMENT_U16, n) + BEGIN_NI04(push, NV10_3D(VTXBUF_ELEMENT_U16), n) #define BATCH_OUT_I16(i0, i1) \ - OUT_RING(chan, (i1) << 16 | (i0)) + PUSH_DATA (push, (i1) << 16 | (i0)) #define MAX_OUT_I32 0x1 #define BATCH_PACKET_I32(n) \ - BEGIN_RING_NI(chan, celsius, NV10_3D_VTXBUF_ELEMENT_U32, n) + BEGIN_NI04(push, NV10_3D(VTXBUF_ELEMENT_U32), n) #define BATCH_OUT_I32(i) \ - OUT_RING(chan, i) + PUSH_DATA (push, i) #define IMM_PACKET(m, n) \ - BEGIN_RING(chan, celsius, m, n) + BEGIN_NV04(push, SUBC_3D(m), n) #define IMM_OUT(x) \ - OUT_RINGf(chan, x) + PUSH_DATAf(push, x) #define TAG(x) nv10_##x #include "nouveau_render_t.c"