From 43c347c63ee10db95bd912fc39b1127fa35305a4 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 21:27:11 +0100 Subject: dri/nouveau: Pack client arrays as they're copied to the real BO. --- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 44 ++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 02c8580760..8a2caff63e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -24,8 +24,11 @@ * */ -#include "main/bufferobj.h" #include "nouveau_bufferobj.h" +#include "nouveau_util.h" + +#include "main/bufferobj.h" +#include "main/image.h" /* Arbitrary pushbuf length we can assume we can get with a single * WAIT_RING. */ @@ -58,7 +61,11 @@ vbo_init_array(struct nouveau_array_state *a, int attr, int stride, } else { nouveau_bo_ref(NULL, &a->bo); a->offset = 0; - a->buf = ptr; + + if (map) + a->buf = ptr; + else + a->buf = NULL; } if (a->buf) @@ -94,11 +101,20 @@ vbo_init_arrays(GLcontext *ctx, const struct _mesa_index_buffer *ib, if (attr >= 0) { const struct gl_client_array *array = arrays[attr]; + int stride; + + if (render->mode == VBO && + !_mesa_is_bufferobj(array->BufferObj)) + /* Pack client buffers. */ + stride = align(_mesa_sizeof_type(array->Type) + * array->Size, 4); + else + stride = array->StrideB; vbo_init_array(&render->attrs[attr], attr, - array->StrideB, array->Size, - array->Type, array->BufferObj, - array->Ptr, render->mode == IMM); + stride, array->Size, array->Type, + array->BufferObj, array->Ptr, + render->mode == IMM); } } } @@ -276,17 +292,21 @@ vbo_bind_vertices(GLcontext *ctx, const struct gl_client_array **arrays, if (attr >= 0) { const struct gl_client_array *array = arrays[attr]; struct nouveau_array_state *a = &render->attrs[attr]; - unsigned delta = (basevertex + min_index) * a->stride, - size = (max_index - min_index + 1) * a->stride; + unsigned delta = (basevertex + min_index) + * array->StrideB; if (a->bo) { a->offset = (intptr_t)array->Ptr + delta; } else { - void *scratch = get_scratch_vbo(ctx, size, - &a->bo, - &a->offset); - - memcpy(scratch, a->buf + delta, size); + int j, n = max_index - min_index + 1; + char *sp = (char *)array->Ptr + delta; + char *dp = get_scratch_vbo(ctx, n * a->stride, + &a->bo, &a->offset); + + for (j = 0; j < n; j++) + memcpy(dp + j * a->stride, + sp + j * array->StrideB, + a->stride); } } } -- cgit v1.2.3 From 80316cbefaa28454ab9d6da44ac93805608c3685 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 21:32:07 +0100 Subject: dri/nouveau: Try to keep client buffers smaller than the scratch VBO length. --- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 8a2caff63e..69a9b96f0c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -243,6 +243,23 @@ vbo_choose_attrs(GLcontext *ctx, const struct gl_client_array **arrays) vbo_emit_attr(ctx, arrays, VERT_ATTRIB_POS); } +static unsigned +get_max_client_stride(GLcontext *ctx) +{ + struct nouveau_render_state *render = to_render_state(ctx); + int i, s = 0; + + for (i = 0; i < render->attr_count; i++) { + int attr = render->map[i]; + struct nouveau_array_state *a = &render->attrs[attr]; + + if (attr >= 0 && !a->bo) + s = MAX2(a->stride, s); + } + + return s; +} + static void TAG(vbo_render_prims)(GLcontext *ctx, const struct gl_client_array **arrays, const struct _mesa_prim *prims, GLuint nr_prims, @@ -257,9 +274,18 @@ vbo_maybe_split(GLcontext *ctx, const struct gl_client_array **arrays, GLuint min_index, GLuint max_index) { struct nouveau_context *nctx = to_nouveau_context(ctx); + struct nouveau_render_state *render = to_render_state(ctx); unsigned pushbuf_avail = PUSHBUF_DWORDS - 2 * nctx->bo.count, vert_avail = get_max_vertices(ctx, NULL, pushbuf_avail), idx_avail = get_max_vertices(ctx, ib, pushbuf_avail); + int stride; + + /* Try to keep client buffers smaller than the scratch BOs. */ + if (!ib && render->mode == VBO && + (stride = get_max_client_stride(ctx))) + vert_avail = MIN2(vert_avail, + RENDER_SCRATCH_SIZE / stride); + if ((ib && ib->count > idx_avail) || (!ib && max_index - min_index > vert_avail)) { -- cgit v1.2.3 From 9c21c1e865ad3008eb6f4d6d4e4a48c2ed94472d Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 21:40:47 +0100 Subject: dri/nouveau: Fix rb->DataType for z24s8 renderbuffers. --- src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 846478650e..2ec3dc9242 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -72,7 +72,7 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) case GL_DEPTH24_STENCIL8_EXT: rb->_BaseFormat = GL_DEPTH_STENCIL; rb->Format = MESA_FORMAT_Z24_S8; - rb->DataType = GL_UNSIGNED_INT; + rb->DataType = GL_UNSIGNED_INT_24_8_EXT; s->cpp = 4; break; default: -- cgit v1.2.3 From 210bcf6d156aba5994f25f1bd9c50586ebc3bada Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Mon, 1 Mar 2010 23:58:17 +0000 Subject: dri/nouveau: Add GL_EXT_stencil_wrap for nv04. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 89c6753694..4314fc33cf 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -71,6 +71,10 @@ get_stencil_op(unsigned op) return 0x5; case GL_INVERT: return 0x6; + case GL_INCR_WRAP: + return 0x7; + case GL_DECR_WRAP: + return 0x8; default: assert(0); } -- cgit v1.2.3 From 44df3577a77818d6e87f1b728f0aa19698133981 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Mon, 1 Mar 2010 23:45:50 +0000 Subject: dri/nouveau: Enable GL_EXT_stencil_wrap. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 2629733273..ef26a19219 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -47,14 +47,15 @@ #include "main/remap_helper.h" static const struct dri_extension nouveau_extensions[] = { - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { "GL_ARB_multitexture", NULL }, - { "GL_EXT_texture_lod_bias", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_dot3", NULL }, { "GL_ARB_texture_env_add", NULL }, + { "GL_EXT_texture_lod_bias", NULL }, + { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; -- cgit v1.2.3 From 9c4937524e15dc685eb0c83cbdab8b637803fd78 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Thu, 4 Mar 2010 23:15:47 +0100 Subject: dri/nouveau: Trivially add GL_ARB_texture_mirrored_repeat. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index ef26a19219..52185a2fb9 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -53,6 +53,7 @@ static const struct dri_extension nouveau_extensions[] = { { "GL_ARB_texture_env_add", NULL }, { "GL_EXT_texture_lod_bias", NULL }, { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, { "GL_SGIS_generate_mipmap", NULL }, -- cgit v1.2.3 From a42fd95f43929c1e2c7acf2a6e49c473e1a2a178 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 23:19:49 +0100 Subject: dri/nouveau: Remove some CI remnants. --- src/mesa/drivers/dri/nouveau/nouveau_state.h | 1 - src/mesa/drivers/dri/nouveau/nv04_context.c | 1 - src/mesa/drivers/dri/nouveau/nv10_context.c | 1 - src/mesa/drivers/dri/nouveau/nv10_driver.h | 3 --- src/mesa/drivers/dri/nouveau/nv10_state_raster.c | 5 ----- src/mesa/drivers/dri/nouveau/nv20_context.c | 1 - 6 files changed, 12 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.h b/src/mesa/drivers/dri/nouveau/nouveau_state.h index d001fa259a..d01d962c9f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.h @@ -47,7 +47,6 @@ enum { NOUVEAU_STATE_FRAG, NOUVEAU_STATE_FRAMEBUFFER, NOUVEAU_STATE_FOG, - NOUVEAU_STATE_INDEX_MASK, NOUVEAU_STATE_LIGHT_ENABLE, NOUVEAU_STATE_LIGHT_MODEL, NOUVEAU_STATE_LIGHT_SOURCE0, diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c index 1acd41de54..a442425e44 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_context.c +++ b/src/mesa/drivers/dri/nouveau/nv04_context.c @@ -265,7 +265,6 @@ const struct nouveau_driver nv04_driver = { nouveau_emit_nothing, nouveau_emit_nothing, nouveau_emit_nothing, - nouveau_emit_nothing, nv04_emit_scissor, nv04_defer_blend, nv04_defer_control, diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index 8e70c419ed..860d0aeb8f 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -370,7 +370,6 @@ const struct nouveau_driver nv10_driver = { nv10_emit_frag, nv10_emit_framebuffer, nv10_emit_fog, - nv10_emit_index_mask, nv10_emit_light_enable, nv10_emit_light_model, nv10_emit_light_source, diff --git a/src/mesa/drivers/dri/nouveau/nv10_driver.h b/src/mesa/drivers/dri/nouveau/nv10_driver.h index b5ab19b3bc..d662712533 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_driver.h +++ b/src/mesa/drivers/dri/nouveau/nv10_driver.h @@ -99,9 +99,6 @@ nv10_emit_depth(GLcontext *ctx, int emit); void nv10_emit_dither(GLcontext *ctx, int emit); -void -nv10_emit_index_mask(GLcontext *ctx, int emit); - void nv10_emit_logic_opcode(GLcontext *ctx, int emit); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c index 68882ef05f..a62cd807a9 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c @@ -118,11 +118,6 @@ nv10_emit_dither(GLcontext *ctx, int emit) OUT_RING(chan, ctx->Color.DitherFlag ? 1 : 0); } -void -nv10_emit_index_mask(GLcontext *ctx, int emit) -{ -} - void nv10_emit_logic_opcode(GLcontext *ctx, int emit) { diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c index 635b5c0996..db39ef7075 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_context.c +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c @@ -459,7 +459,6 @@ const struct nouveau_driver nv20_driver = { nv20_emit_frag, nv20_emit_framebuffer, nv20_emit_fog, - nv10_emit_index_mask, nv10_emit_light_enable, nv20_emit_light_model, nv20_emit_light_source, -- cgit v1.2.3 From 8953bfce0eb7e56f13d4527ef86cdf4cf2db037f Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 6 Mar 2010 06:33:20 +0200 Subject: dri: drop MINIGLX_SOURCES --- src/mesa/drivers/dri/i810/Makefile | 3 --- src/mesa/drivers/dri/i915/Makefile | 2 -- src/mesa/drivers/dri/i965/Makefile | 1 - src/mesa/drivers/dri/mach64/Makefile | 3 --- src/mesa/drivers/dri/mga/Makefile | 2 -- src/mesa/drivers/dri/nouveau/Makefile | 2 -- src/mesa/drivers/dri/r128/Makefile | 2 -- src/mesa/drivers/dri/r200/Makefile | 2 -- src/mesa/drivers/dri/r300/Makefile | 2 -- src/mesa/drivers/dri/r600/Makefile | 2 -- src/mesa/drivers/dri/radeon/Makefile | 2 -- src/mesa/drivers/dri/savage/Makefile | 3 --- src/mesa/drivers/dri/sis/Makefile | 4 ---- src/mesa/drivers/dri/tdfx/Makefile | 3 --- src/mesa/drivers/dri/unichrome/Makefile | 2 -- 15 files changed, 35 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile index 3874faee51..54a837d5ea 100644 --- a/src/mesa/drivers/dri/i810/Makefile +++ b/src/mesa/drivers/dri/i810/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = i810_dri.so -# Not yet -# MINIGLX_SOURCES = server/i810_dri.c - DRIVER_SOURCES = \ i810context.c \ i810ioctl.c \ diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index dc15ae425c..5b49d0c77c 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -4,8 +4,6 @@ include $(TOP)/configs/current LIBNAME = i915_dri.so -MINIGLX_SOURCES = server/intel_dri.c - DRIVER_SOURCES = \ i830_context.c \ i830_state.c \ diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index f98a1a27db..a242580273 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -99,7 +99,6 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) ASM_SOURCES = diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile index a8f463e9fd..c20fdece29 100644 --- a/src/mesa/drivers/dri/mach64/Makefile +++ b/src/mesa/drivers/dri/mach64/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = mach64_dri.so -# Not yet -# MINIGLX_SOURCES = server/mach64_dri.c - DRIVER_SOURCES = \ mach64_context.c \ mach64_ioctl.c \ diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile index 0cc329fb22..92533bccc2 100644 --- a/src/mesa/drivers/dri/mga/Makefile +++ b/src/mesa/drivers/dri/mga/Makefile @@ -5,8 +5,6 @@ include $(TOP)/configs/current LIBNAME = mga_dri.so -MINIGLX_SOURCES = server/mga_dri.c - DRIVER_SOURCES = \ mgadd.c \ mgaioctl.c \ diff --git a/src/mesa/drivers/dri/nouveau/Makefile b/src/mesa/drivers/dri/nouveau/Makefile index 49e8933561..7be19b26fd 100644 --- a/src/mesa/drivers/dri/nouveau/Makefile +++ b/src/mesa/drivers/dri/nouveau/Makefile @@ -8,8 +8,6 @@ DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) LIBNAME = nouveau_vieux_dri.so -MINIGLX_SOURCES = - DRIVER_SOURCES = \ nouveau_screen.c \ nouveau_context.c \ diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile index 52c5a38a70..8144c9b43f 100644 --- a/src/mesa/drivers/dri/r128/Makefile +++ b/src/mesa/drivers/dri/r128/Makefile @@ -5,8 +5,6 @@ include $(TOP)/configs/current LIBNAME = r128_dri.so -MINIGLX_SOURCES = server/r128_dri.c - DRIVER_SOURCES = \ r128_context.c \ r128_lock.c \ diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 14eb96c1ba..2e86e8b941 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -7,8 +7,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = r200_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 04459c2ddf..08934fc996 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -7,8 +7,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = r300_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index 5d50941539..2478b12658 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -7,8 +7,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = r600_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index a54ea16ec6..fc6d1c8e89 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -8,8 +8,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = radeon_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/savage/Makefile b/src/mesa/drivers/dri/savage/Makefile index 2e5c40802c..53511552c6 100644 --- a/src/mesa/drivers/dri/savage/Makefile +++ b/src/mesa/drivers/dri/savage/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = savage_dri.so -# Doesn't exist yet. -#MINIGLX_SOURCES = server/savage_dri.c - DRIVER_SOURCES = \ savage_xmesa.c \ savagedd.c \ diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile index ad009fc239..6b4f938bab 100644 --- a/src/mesa/drivers/dri/sis/Makefile +++ b/src/mesa/drivers/dri/sis/Makefile @@ -5,10 +5,6 @@ include $(TOP)/configs/current LIBNAME = sis_dri.so - -# Not yet -# MINIGLX_SOURCES = server/sis_dri.c - DRIVER_SOURCES = \ sis6326_state.c \ sis6326_clear.c \ diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile index b9f25db4fe..96bd8f8202 100644 --- a/src/mesa/drivers/dri/tdfx/Makefile +++ b/src/mesa/drivers/dri/tdfx/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = tdfx_dri.so -# not yet -# MINIGLX_SOURCES = server/tdfx_dri.c - DRIVER_SOURCES = \ tdfx_context.c \ tdfx_dd.c \ diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile index 344d34fce3..14cf9f3038 100644 --- a/src/mesa/drivers/dri/unichrome/Makefile +++ b/src/mesa/drivers/dri/unichrome/Makefile @@ -5,8 +5,6 @@ include $(TOP)/configs/current LIBNAME = unichrome_dri.so -MINIGLX_SOURCES = server/via_dri.c - DRIVER_SOURCES = \ via_context.c \ via_fb.c \ -- cgit v1.2.3 From 5befb6f810fb88ed1e51ec26b79b647cd15b1433 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 7 Mar 2010 14:20:31 +0100 Subject: dri/nouveau: Check _ColorDrawBuffers[0] before emitting fb state. --- src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 2 +- src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 2 +- src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c index aad1e491d2..5e5e0c5874 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c @@ -63,7 +63,7 @@ nv04_emit_framebuffer(GLcontext *ctx, int emit) return; /* Render target */ - if (fb->_NumColorDrawBuffers) { + if (fb->_ColorDrawBuffers[0]) { s = &to_nouveau_renderbuffer( fb->_ColorDrawBuffers[0])->surface; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index 05c36b4f8f..6bd383ebcd 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -111,7 +111,7 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) } /* Render target */ - if (fb->_NumColorDrawBuffers) { + if (fb->_ColorDrawBuffers[0]) { s = &to_nouveau_renderbuffer( fb->_ColorDrawBuffers[0])->surface; diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c index 869acd6e31..d638541df9 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c @@ -67,7 +67,7 @@ nv20_emit_framebuffer(GLcontext *ctx, int emit) return; /* Render target */ - if (fb->_NumColorDrawBuffers) { + if (fb->_ColorDrawBuffers[0]) { s = &to_nouveau_renderbuffer( fb->_ColorDrawBuffers[0])->surface; -- cgit v1.2.3 From e64680bc1e36699096af5ade876b6cb0f5791ad0 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Tue, 2 Mar 2010 01:29:14 +0000 Subject: dri/nouveau: Trivially add GL_NV_blend_square Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 52185a2fb9..e26ed36529 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -56,6 +56,7 @@ static const struct dri_extension nouveau_extensions[] = { { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_NV_blend_square", NULL }, { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; -- cgit v1.2.3 From 6a15edfed326a06f08ac63020dc9472e45d8a9e1 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Sun, 7 Mar 2010 01:09:21 +0000 Subject: dri/nv04: GL_EXT_secondary_color Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 10 ++++++---- src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index e26ed36529..502e01255c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -43,19 +43,21 @@ #define need_GL_EXT_framebuffer_object #define need_GL_EXT_fog_coord +#define need_GL_EXT_secondary_color #include "main/remap_helper.h" static const struct dri_extension nouveau_extensions[] = { { "GL_ARB_multitexture", NULL }, + { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_dot3", NULL }, - { "GL_ARB_texture_env_add", NULL }, - { "GL_EXT_texture_lod_bias", NULL }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, + { "GL_EXT_stencil_wrap", NULL }, + { "GL_EXT_texture_lod_bias", NULL }, { "GL_NV_blend_square", NULL }, { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 4314fc33cf..c191571a5f 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -275,6 +275,10 @@ nv04_emit_blend(GLcontext *ctx, int emit) else blend |= NV04_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_FLAT; + /* Secondary color */ + if (NEED_SECONDARY_COLOR(ctx)) + blend |= NV04_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE; + /* Fog. */ if (ctx->Fog.Enabled) blend |= NV04_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE; @@ -309,6 +313,10 @@ nv04_emit_blend(GLcontext *ctx, int emit) else blend |= get_texenv_mode(GL_MODULATE); + /* Secondary color */ + if (NEED_SECONDARY_COLOR(ctx)) + blend |= NV04_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE; + /* Fog. */ if (ctx->Fog.Enabled) blend |= NV04_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE; -- cgit v1.2.3 From 75f52d1e5210944d7e92787c637285fd83533053 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 7 Mar 2010 18:40:21 +0100 Subject: dri/nouveau: Fix nv[12]x color sum. --- src/mesa/drivers/dri/nouveau/nouveau_state.c | 1 + src/mesa/drivers/dri/nouveau/nv10_state_tnl.c | 6 ++++-- src/mesa/drivers/dri/nouveau/nv20_state_tnl.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e1871db0eb..bc610451b4 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -150,6 +150,7 @@ nouveau_enable(GLcontext *ctx, GLenum cap, GLboolean state) break; case GL_COLOR_SUM_EXT: context_dirty(ctx, FRAG); + context_dirty(ctx, LIGHT_MODEL); break; case GL_CULL_FACE: context_dirty(ctx, CULL_FACE); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c index 6db14d83b8..406e24c455 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c @@ -201,8 +201,10 @@ nv10_emit_light_model(GLcontext *ctx, int emit) BEGIN_RING(chan, celsius, NV10TCL_LIGHT_MODEL, 1); OUT_RING(chan, ((m->LocalViewer ? NV10TCL_LIGHT_MODEL_LOCAL_VIEWER : 0) | - (m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? - NV10TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0))); + (NEED_SECONDARY_COLOR(ctx) ? + NV10TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0) | + (!ctx->Light.Enabled && ctx->Fog.ColorSumEnabled ? + NV10TCL_LIGHT_MODEL_VERTEX_SPECULAR : 0))); } static float diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c index 0d566064f6..43f8c72312 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c @@ -158,7 +158,7 @@ nv20_emit_light_model(GLcontext *ctx, int emit) OUT_RING(chan, ((m->LocalViewer ? NV20TCL_LIGHT_MODEL_VIEWER_LOCAL : NV20TCL_LIGHT_MODEL_VIEWER_NONLOCAL) | - (m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? + (NEED_SECONDARY_COLOR(ctx) ? NV20TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0))); -- cgit v1.2.3 From ea027bda8e4a7cdd8f131e01ab4ff80d6c6a3ab7 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 7 Mar 2010 19:12:27 +0100 Subject: dri/nouveau: Split big client buffers in the indexed case too. --- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 69a9b96f0c..a365b977f2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -281,14 +281,13 @@ vbo_maybe_split(GLcontext *ctx, const struct gl_client_array **arrays, int stride; /* Try to keep client buffers smaller than the scratch BOs. */ - if (!ib && render->mode == VBO && + if (render->mode == VBO && (stride = get_max_client_stride(ctx))) vert_avail = MIN2(vert_avail, RENDER_SCRATCH_SIZE / stride); - - if ((ib && ib->count > idx_avail) || - (!ib && max_index - min_index > vert_avail)) { + if (max_index - min_index > vert_avail || + (ib && ib->count > idx_avail)) { struct split_limits limits = { .max_verts = vert_avail, .max_indices = idx_avail, -- cgit v1.2.3