Maciej Cencora [Wed, 13 May 2009 21:58:21 +0000 (23:58 +0200)]
r300: move some code to common path
Maciej Cencora [Wed, 13 May 2009 21:49:04 +0000 (23:49 +0200)]
r300: rename functions
Be consistent with function naming: use Setup/Emit names for functions that modify hardware state
Maciej Cencora [Wed, 13 May 2009 21:09:39 +0000 (23:09 +0200)]
r300: move forward declarations to where they belong
Maciej Cencora [Thu, 14 May 2009 00:07:49 +0000 (02:07 +0200)]
r300: software fallbacking handling rewrite
Until now falling back to software rasterizer worked only for TCL enabled cards.
For non TCL cards we used to plug our rendering functions in r300InitSwtcl, and we had never restored original functions for software rasterizer.
Maciej Cencora [Wed, 13 May 2009 20:33:27 +0000 (22:33 +0200)]
r300: r300EmitArrays should never fail
Maciej Cencora [Wed, 13 May 2009 20:28:39 +0000 (22:28 +0200)]
r300: remove unnecessary switch cases
Maciej Cencora [Wed, 13 May 2009 20:24:57 +0000 (22:24 +0200)]
r300: further cleanup
- move extensions init into seperate function
- move options handling into seperate function
- create new structure to hold options values
- use context->options.hw_tcl_enabled field instead of global hw_tcl_on and future_hw_tcl_on variables
Jerome Glisse [Thu, 14 May 2009 15:24:19 +0000 (17:24 +0200)]
r300: don't send now forbidden register to kernel when with memory manager
Alex Deucher [Wed, 13 May 2009 23:43:04 +0000 (19:43 -0400)]
R1xx/r2xx: Don't use an alpha texture format for GLX_TEXTURE_FORMAT_RGB_EXT
In r*00SetTexBuffer2(), if the passed in text glx_texture_format
is GLX_TEXTURE_FORMAT_RGB_EXT, then we should use an RGB-only
texture format, even if the DRI buffer has four channels.
https://bugs.freedesktop.org/show_bug.cgi?id=21609
Owen W. Taylor [Sat, 9 May 2009 19:23:34 +0000 (15:23 -0400)]
radeon: Don't crash generating mipmaps when pixels=NULL
When a NULL value of pixels is passed to TexImage2D and
SGIS_generate_mipmap is enabled, don't try to generate the
mipmap tree: we don't have data yet for the texture and will
crash.
https://bugs.freedesktop.org/show_bug.cgi?id=21648
Owen W. Taylor [Thu, 7 May 2009 02:42:50 +0000 (22:42 -0400)]
Don't use an alpha texture format for GLX_TEXTURE_FORMAT_RGB_EXT
In r300SetTexBuffer2(), if the passed in text glx_texture_format
is GLX_TEXTURE_FORMAT_RGB_EXT, then we should use an RGB-only
texture format, even if the DRI buffer has four channels.
https://bugs.freedesktop.org/show_bug.cgi?id=21609
Owen W. Taylor [Thu, 7 May 2009 02:45:33 +0000 (22:45 -0400)]
Call _mesa_update_stencil() before accessing ctx->Stencil._Enabled
ctx->Stencil._Enabled is derived state and not immediately updated
when the stencil parameters are changed; we need to make sure that
it is up-to-date before accessing it.
https://bugs.freedesktop.org/show_bug.cgi?id=21608
Owen W. Taylor [Fri, 8 May 2009 22:58:41 +0000 (18:58 -0400)]
Remove subpixel offset from viewport
Remove an eigth-pixel offset of the viewport inherited from
R100 code. This seems not to be necessary and causes blurring
when sampling textures 1:1.
https://bugs.freedesktop.org/show_bug.cgi?id=20340
Jerome Glisse [Tue, 12 May 2009 11:05:57 +0000 (13:05 +0200)]
radeon: glReadBuffer set _NEW_BUFFERS, not _NEW_PIXEL
This was broken with last merge see
62043b27575c378c027251316421e4699f461108
for explanations
Jerome Glisse [Tue, 12 May 2009 11:04:32 +0000 (13:04 +0200)]
r300/r500: make sure we detect constant buffer changes
This was broken with last merge see
f48473e42511f8d37a239a07f791bc0a87209e5b
for explanations.
Tormod Volden [Tue, 12 May 2009 07:32:11 +0000 (09:32 +0200)]
radeon: avoid segfault in radeon_update_renderbuffers() if using DRI1
Basically the same as
43d9020ff1e975e7f4f9480d9ef24f0b9fb2141f for intel. Bug 21688.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Joel Bosveld [Sun, 10 May 2009 16:26:40 +0000 (18:26 +0200)]
radeon: add support for new dri2 interfaces & fix single buffer rendering
Jerome Glisse [Sun, 10 May 2009 14:57:22 +0000 (16:57 +0200)]
Merge commit 'origin/master' into radeon-rewrite
Conflicts:
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_fragprog.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_texmem.c
src/mesa/drivers/dri/r300/r300_texstate.c
src/mesa/drivers/dri/r300/r500_fragprog.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/radeon/radeon_state.c
Jerome Glisse [Sat, 9 May 2009 10:56:27 +0000 (12:56 +0200)]
radeon: don't include cs uncondionaly
Corbin Simpson [Sat, 9 May 2009 07:43:05 +0000 (00:43 -0700)]
radeon-gallium: Clean up some of the BO counting logic.
Corbin Simpson [Sat, 9 May 2009 07:38:07 +0000 (00:38 -0700)]
r300-gallium: vs: Make imms work, cleanup some of the switches.
Corbin Simpson [Sat, 9 May 2009 07:28:49 +0000 (00:28 -0700)]
r300-gallium: Start VS dumper.
Corbin Simpson [Sat, 9 May 2009 05:54:52 +0000 (22:54 -0700)]
r300-gallium: vs: Add SLT, clean up MAX.
This should be all the opcodes for basic TCL.
Corbin Simpson [Sat, 9 May 2009 05:52:32 +0000 (22:52 -0700)]
r300-gallium: vs: Add MAX.
Corbin Simpson [Sat, 9 May 2009 05:46:12 +0000 (22:46 -0700)]
r300-gallium: vs: Add scalar setup, RSQ.
Icky icky icky icky. Icky icky, icky icky. Icky.
Corbin Simpson [Sat, 9 May 2009 05:45:56 +0000 (22:45 -0700)]
r300-gallium: vs: Add writemasks.
Corbin Simpson [Sat, 9 May 2009 05:05:18 +0000 (22:05 -0700)]
r300-gallium: Fix bad cast. Space accounting completely works now.
Boy, is my face red. :C
Corbin Simpson [Sat, 9 May 2009 02:40:38 +0000 (19:40 -0700)]
r300-gallium, radeon: BO handling fixes, some useful asserts.
Corbin Simpson [Sat, 9 May 2009 00:09:32 +0000 (17:09 -0700)]
radeon-gallium: Shut up Valgrind.
Corbin Simpson [Fri, 8 May 2009 23:50:42 +0000 (16:50 -0700)]
r300-gallium, radeon: A couple cleanups.
Trying to track down goddamn bugs. :C
Corbin Simpson [Fri, 8 May 2009 22:28:09 +0000 (15:28 -0700)]
r300-gallium: Finish space accounting.
Still broken...
Robert Ellison [Fri, 8 May 2009 20:51:11 +0000 (14:51 -0600)]
i965: improve debug logging
Looking for memory leaks that were causing crashes in my environment
in a situation where valgrind would not work, I ended up improving
the i965 debug traces so I could better see where the memory was
being allocated and where it was going, in the regions and miptrees
code, and in the state caches. These traces were specific enough
that external scripts could determine what elements were not being
released, and where the memory leaks were.
I also ended up creating my own backtrace code in intel_regions.c,
to determine exactly where regions were being allocated and for what,
since valgrind wasn't working. Because it was useful, I left it in,
but disabled and compiled out. It can be activated by changing a flag
at the top of the file.
Robert Ellison [Fri, 8 May 2009 20:42:47 +0000 (14:42 -0600)]
i965: fix memory leak in context/renderbuffer region management
A temporary change to the intelMakeCurrent() function to make
it work with frame buffer objects causes the static regions
associated with the context (the front_region, back_region,
and depth_region) to take on an additional reference, with
no corresponding release. This causes a memory leak if a
program repeatedly creates and destroys contexts.
The fix is the corresponding hack, to unreference these
regions when the context is deleted, but only if the
framebuffer objects are still present and the same
regions are still referenced within.
Both sets of code have comment blocks referring to each
other.
Robert Ellison [Fri, 8 May 2009 20:40:38 +0000 (14:40 -0600)]
i965: fix segfault on low memory conditions
When out of memory (in at least one case, triggered by a longrunning
memory leak), this code will segfault and crash. By checking for the
out-of-memory condition, the system can continue, and will report
the out-of-memory error later, a much preferable outcome.
Robert Ellison [Fri, 8 May 2009 17:13:57 +0000 (11:13 -0600)]
mesa: Fixed a texture memory leak
The current texture for any particular texture unit is given an additional
reference in update_texture_state(); but if the context is closed before
that texture can be released (which is quite frequent in normal use, unless
a program unbinds and deletes the texture and renders without it to force
a call to update_texture_state(), the memory is lost.
This affects general Mesa; but the i965 is particularly affected because
it allocates a considerable amount of additional memory for each allocated
texture.
Eric Anholt [Fri, 8 May 2009 05:50:19 +0000 (22:50 -0700)]
intel: Add a metaops version of glGenerateMipmapEXT/SGIS_generate_mipmaps.
In addition to being HW accelerated, it avoids the incorrect
(black) rendering of the mipmaps that SW was doing in fbo-generatemipmap.
Improves the performance of the mipmap generation and drawing in
fbo-generatemipmap by 30%.
Eric Anholt [Fri, 8 May 2009 19:46:18 +0000 (12:46 -0700)]
intel: Put the constant texcoords used in metaops into a vbo.
Make this be its own function for setup/teardown of the binding of these
texcoords. No performance difference in the engine demo (I just felt dirty
not using a VBO for this), and I think it should be more resilient to
interference from current GL state.
Brian Paul [Fri, 8 May 2009 19:48:41 +0000 (13:48 -0600)]
i965: const qualifiers
Brian Paul [Fri, 8 May 2009 20:34:43 +0000 (14:34 -0600)]
mesa: raise MAX_VARYING (number of shader varying vars) to 16
16 is the limit for now because of various 32-bit bitfields.
Brian Paul [Fri, 8 May 2009 20:34:15 +0000 (14:34 -0600)]
mesa: assertions to check for too many vertex outputs or fragment inputs
Brian Paul [Fri, 8 May 2009 20:32:19 +0000 (14:32 -0600)]
glsl: check number of varying variables against the limit
Link fails if too many varying vars.
Brian Paul [Fri, 8 May 2009 18:44:38 +0000 (12:44 -0600)]
mesa: issue warning for out of bounds array indexes
Brian Paul [Fri, 8 May 2009 18:43:58 +0000 (12:43 -0600)]
i965: don't use GRF regs 126,127 for WM programs
They seem to be used for something else and using them for shader temps
seems to lead to GPU lock-ups.
Call _mesa_warning() when we run out of temps.
Also, clean up some debug code.
Brian Paul [Fri, 8 May 2009 18:18:44 +0000 (12:18 -0600)]
glsl: set vertex/fragment program Ids to aid with debugging
Brian Paul [Fri, 8 May 2009 18:17:11 +0000 (12:17 -0600)]
mesa: more shader debug code (disabled)
Jerome Glisse [Fri, 8 May 2009 14:40:21 +0000 (16:40 +0200)]
radeon: IRQ always enabled in DRI2 path no need to query kernel for it
Keith Whitwell [Thu, 7 May 2009 18:48:06 +0000 (19:48 +0100)]
mesa/st: keep surface_copy arguments positive
The src/dest x,y, and w,h arguments of the pipe->surface_copy
function are unsigned and the drivers aren't expecting negative
(or extremly-large unsigned) values as inputs. Trim the requests
at the state-tracker level before passing down.
Keith Whitwell [Thu, 7 May 2009 18:27:30 +0000 (19:27 +0100)]
mesa/st: remove redundant call to st_finish in CopyTexSubImage
Rendering should already have been flushed, any synchronization will
be done by the driver or memory manager.
José Fonseca [Thu, 7 May 2009 17:21:56 +0000 (18:21 +0100)]
wgl: Export pixelformats with accumulation bits.
Keith Whitwell [Thu, 7 May 2009 10:46:08 +0000 (11:46 +0100)]
mesa/st: cope with non-ibo index data in st_draw_feedback.c
Previously only non-indexed or indicies-in-a-vbo cases were handled in
this code. This change adds the missing regular indices-in-memory
case.
Keith Whitwell [Thu, 7 May 2009 08:24:37 +0000 (09:24 +0100)]
util/upload: catch failures to map_range and return error
Caller may be able to do something about this - eg flush and retry.
Keith Whitwell [Thu, 7 May 2009 07:00:42 +0000 (08:00 +0100)]
scons: mingw is broken with -O1 and higher
Keith Whitwell [Wed, 6 May 2009 19:41:17 +0000 (20:41 +0100)]
stw: fix potential uninitialized use of curctx
José Fonseca [Wed, 6 May 2009 18:58:08 +0000 (19:58 +0100)]
wgl: Enforce a minimum 1x1 framebuffer size.
José Fonseca [Fri, 1 May 2009 17:53:51 +0000 (18:53 +0100)]
wgl: Add assertion for missing function.
José Fonseca [Fri, 1 May 2009 17:53:17 +0000 (18:53 +0100)]
wgl: Remove unused variable.
José Fonseca [Fri, 1 May 2009 17:52:54 +0000 (18:52 +0100)]
mesa: Make _mesa_share_state thread safe.
José Fonseca [Fri, 1 May 2009 17:49:22 +0000 (18:49 +0100)]
wgl: Implement ShareLists.
Maciej Cencora [Tue, 5 May 2009 12:45:51 +0000 (14:45 +0200)]
r300: add missing texture format
Fixes piglit/texdepth
Maciej Cencora [Sat, 2 May 2009 17:34:57 +0000 (19:34 +0200)]
r300: moar cleanup
- remove unused r300UpdateClipPlanes function
- move reg definition to r300_reg.h
- remove incorrect forward definition of tnl_UpdateFixedFunctionProgram and add proper #include
- remove unreachable code
Maciej Cencora [Sat, 2 May 2009 15:37:20 +0000 (17:37 +0200)]
r300: fix compiler warnings
Ben Skeggs [Thu, 7 May 2009 23:22:16 +0000 (09:22 +1000)]
nouveau: respect GALLIUM_STATE_TRACKERS_DIRS
Ben Skeggs [Thu, 7 May 2009 23:11:17 +0000 (09:11 +1000)]
nouveau: remove dri1 code now we're using the dri state tracker
Ben Skeggs [Thu, 7 May 2009 23:04:10 +0000 (09:04 +1000)]
nouveau: use dri state tracker for dri1
Brian Paul [Thu, 7 May 2009 20:33:18 +0000 (14:33 -0600)]
mesa: make the array object save/remove functions static
Brian Paul [Thu, 7 May 2009 20:26:17 +0000 (14:26 -0600)]
mesa: clean-up vertex array object VBO unbinding and delete/refcounting
Don't really delete vertex array objects until the refcount hits zero.
At that time, unbind any pointers to VBOs.
Brian Paul [Thu, 7 May 2009 20:15:24 +0000 (14:15 -0600)]
demos: delete vertex array objects upon exit
Brian Paul [Thu, 7 May 2009 19:52:26 +0000 (13:52 -0600)]
mesa: reference counting for gl_array_object
Every kind of object that can be shared by multiple contexts should be
refcounted.
Brian Paul [Thu, 7 May 2009 19:36:20 +0000 (13:36 -0600)]
mesa: array object comments
Brian Paul [Thu, 7 May 2009 19:30:39 +0000 (13:30 -0600)]
mesa: move the NullBufferObj from GLcontext to gl_shared_state
Since shared array objects may point to the null/default buffer object,
the null/default buffer object should be part of the shared state.
Brian Paul [Thu, 7 May 2009 19:10:48 +0000 (13:10 -0600)]
mesa: fix comments, s/texture/buffer/
Brian Paul [Thu, 7 May 2009 17:01:02 +0000 (11:01 -0600)]
vbo: in glDraw[Range]Element() code, check for out of bounds indexes
No-op the bad drawing command rather than go out of bounds and render
garbage. Print a warning to alert the developer to the bad drawing call.
Brian Paul [Wed, 6 May 2009 21:39:51 +0000 (15:39 -0600)]
mesa: remove unused gl_buffer_object::OnCard field
Brian Paul [Wed, 6 May 2009 21:23:09 +0000 (15:23 -0600)]
mesa: added gl_buffer_object::Written flag (for debug purposes)
The flag is set when we data has been written into the buffer object.
Brian Paul [Wed, 6 May 2009 21:17:25 +0000 (15:17 -0600)]
mesa: Compute gl_client_array->_MaxElement during array validation
Used to be done in the glVertex/Normal/Color/etc/Pointer() calls but
if the VBO was reallocated the size could change.
New _NEW_BUFFER_OBJECT state flag.
Brian Paul [Wed, 6 May 2009 21:12:01 +0000 (15:12 -0600)]
mesa: GLvector4f:: flags is a GLbitfield, update comments too.
Brian Paul [Wed, 6 May 2009 21:09:18 +0000 (15:09 -0600)]
mesa: add storage_count field to GLvector4f. Useful for debugging.
Brian Paul [Wed, 6 May 2009 19:02:38 +0000 (13:02 -0600)]
mesa: use array->BufferObj instead of ctx->Array.ArrayBufferObj
No difference, but a little more understandable.
Brian Paul [Wed, 6 May 2009 19:00:35 +0000 (13:00 -0600)]
mesa: added _ElementSize field to gl_client_array
Will be handy for bounds checking later...
Brian Paul [Wed, 6 May 2009 18:56:15 +0000 (12:56 -0600)]
mesa: use local var to make code a bit more concise
Brian Paul [Wed, 6 May 2009 18:48:21 +0000 (12:48 -0600)]
mesa: fix/add comments
Brian Paul [Wed, 6 May 2009 16:54:34 +0000 (10:54 -0600)]
mesa: use _mesa_sizeof_type() in vbo split code
Brian Paul [Wed, 6 May 2009 16:36:33 +0000 (10:36 -0600)]
mesa: vbo code reformatting, clean-up, comments
Brian Paul [Wed, 6 May 2009 15:56:26 +0000 (09:56 -0600)]
mesa: add GL_DOUBLE case in _mesa_sizeof_type()
Brian Paul [Wed, 6 May 2009 15:51:56 +0000 (09:51 -0600)]
mesa: in vbo split code, map buffers read-only, not write-only
And use GL_ELEMENT_ARRAY_BUFFER where appropriate.
Brian Paul [Wed, 6 May 2009 15:01:47 +0000 (09:01 -0600)]
mesa: limit number of error raised by invalid GL_TEXTURE_MAX_ANISOTROPY_EXT
Brian Paul [Wed, 6 May 2009 15:45:24 +0000 (09:45 -0600)]
tnl: added some clip debug/print code (disabled)
Brian Paul [Tue, 5 May 2009 17:11:25 +0000 (11:11 -0600)]
mesa: reformatting, updated comments, const-correctness
Brian Paul [Tue, 5 May 2009 00:22:19 +0000 (18:22 -0600)]
tnl: replace 0x3f with CILP_FRUSTUM_BITS
Brian Paul [Wed, 6 May 2009 14:16:42 +0000 (08:16 -0600)]
i965: relAddr local var (to make debug/test a little easier)
Brian Paul [Thu, 7 May 2009 15:46:53 +0000 (09:46 -0600)]
Merge branch 'mesa_7_5_branch'
Brian Paul [Thu, 7 May 2009 15:43:15 +0000 (09:43 -0600)]
swrast: fix span clipping bug
If a horizontal span of pixels was located at x < 0 we could sometimes
read/write outside of renderbuffer bounds.
Brian Paul [Thu, 7 May 2009 15:36:21 +0000 (09:36 -0600)]
mesa: unmap buffer objects during context tear-down
Eric Anholt [Thu, 7 May 2009 04:44:13 +0000 (21:44 -0700)]
i965: Remove bad constant buffer constant-reg-already-loaded optimization.
Thanks to branching, the state of c->current_const[i].index at the point
of emitting constant loads for this instruction may not match the actual
constant currently loaded in the reg at runtime. Fixes a regression in my
GLSL program for idr's class since
b58b3a786aa38dcc9d72144c2cc691151e46e3d5.
Eric Anholt [Wed, 6 May 2009 20:58:57 +0000 (13:58 -0700)]
intel: Unmap buffers if needed at DeleteBuffer time.
This fixes a crash in glean's pbo test, which tripped over the assert when a
context was destroyed while a buffer was still mapped (Mesa doesn't call
UnmapBuffer in that case). Regression in
c6bde8873fbda6d8467600b7491d8543c75b0509
Owen W. Taylor [Wed, 6 May 2009 18:44:16 +0000 (14:44 -0400)]
When clearing the stencil buffer, don't use a two-sided stencil
In radeon_clear_tris(), when clearing the stencil buffer,
pass GL_FRONT_AND_BACK to _mesa_StencilFuncSeparate(), to avoid
triggering a software fallback on r300 and below.
https://bugs.freedesktop.org/show_bug.cgi?id=21601
Brian Paul [Wed, 6 May 2009 18:38:11 +0000 (12:38 -0600)]
mesa: remove unnecessary buffer size check
Brian Paul [Wed, 6 May 2009 18:37:10 +0000 (12:37 -0600)]
mesa: code consolidation in glDraw[Range]Elements() validation
Brian Paul [Wed, 6 May 2009 18:27:38 +0000 (12:27 -0600)]
mesa: new comments, minor reformatting
Brian Paul [Wed, 6 May 2009 18:23:28 +0000 (12:23 -0600)]
mesa: use elementBuf local var instead of ctx->Array.ElementArrayBufferObj
Makes no real difference, but more consistant.