Commit Graph

85 Commits

Author SHA1 Message Date
Keith Whitwell
08d44512e9 st: call _glapi_check_multithread from st_make_current
This function is called from many OS-dependent versions of MakeCurrent.

Move the check for multithreading to this central location to avoid
having to make this check from all the callers.
2009-03-18 19:14:45 +00:00
Brian Paul
2c37851595 mesa: move glViewport and glDepthRange functions into new viewport.c file
A bit of refactoring with an eye toward ES2 and GL 3.1
2009-03-07 12:33:11 -07:00
Michel Dänzer
45bde75bd6 gallium: Remove some superfluous instances of #include "p_inlines.h". 2009-03-04 11:58:52 +01:00
Michel Dänzer
5e27cd46c0 gallium: Unify reference counting.
The core reference counting code is centralized in p_refcnt.h.

This has some consequences related to struct pipe_buffer:

* The screen member of struct pipe_buffer must be initialized, or
  pipe_buffer_reference() will crash trying to destroy a buffer with reference
  count 0. u_simple_screen takes care of this, but I may have missed some of
  the drivers not using it.
* Except for rare exceptions deep in winsys code, buffers must always be
  allocated via pipe_buffer_create() or via screen->*buffer_create() rather
  than via winsys->*buffer_create().
2009-03-04 11:58:48 +01:00
Brian Paul
f24ec99190 gallium: include st_cb_viewport.h to silence warning 2009-02-23 15:07:31 -07:00
Alan Hourihane
6b72227270 gallium: add winsys interface for viewport changes to support DRI2 2009-02-23 20:28:55 +00:00
Brian Paul
f1a59a6dd7 mesa: use new ST_CALLOC_STRUCT() macro in gallium state tracker 2009-02-12 10:14:36 -07:00
Brian Paul
1a2f4dd876 mesa: consistantly use mesa memory-functions in gallium state tracker
Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc.
Still using CALLOC_STRUCT() at this point.
2009-02-12 10:11:55 -07:00
Alan Hourihane
834c93687f st: build fix 2009-01-09 11:23:47 +00:00
Brian Paul
1a820f52f6 gallium: clean-up/fix msaa override in state tracker 2008-09-17 14:32:33 -06:00
Brian Paul
753635f733 gallium: move _vbo_DestroyContext() call
Call it before freeing core Mesa state to avoid references to freed buffer objects.
2008-09-16 08:51:56 -06:00
José Fonseca
f637a96e85 gallium: Have pipe_buffer_* receive a pipe_screen instead of a pipe_context.
We want to use the pipe_buffer_* inlines everywhere, but a pipe context
is not always available nor is it needed.
2008-09-03 11:53:39 +09:00
Brian Paul
e90c0c976d gallium: do a proper implementation of GL_OES_read_format
Examine the currently bound color buffer's format to see if there's a good
format/type match.
2008-08-19 14:35:31 -06:00
José Fonseca
7f2d349b2d mesa: Call pipe->destroy on context destruction for all platforms. 2008-08-19 02:24:13 +01:00
Brian Paul
8f6d9e12be gallium: use a default texture in update_textures(), update_samplers() when needed
The default texture is used when the current fragment shader has texture
sample instructions but the user has not provided/bound a texture.
2008-08-14 15:44:28 -06:00
Brian Paul
4424c66875 gallium: more context clean-up 2008-08-12 18:02:44 -06:00
Jonathan White
467e6526a8 gallium: Temporary workaround for mismatched pipe create and pipe destroy 2008-07-21 15:34:38 -06:00
Brian Paul
bae90edfda gallium: check for FEATURE_feedback and FEATURE_drawpix when creating/using the aux draw module 2008-07-10 14:23:27 -06:00
Brian Paul
722db809e6 gallium: always need st_init-blit() 2008-06-20 11:30:43 -06:00
Brian Paul
d7a4d498e4 gallium: assorted FEATURE tests 2008-06-20 08:09:59 -06:00
Brian Paul
414b535134 gallium: more FEATURE_x tests 2008-06-18 09:22:01 -06:00
Brian Paul
5ebd8495b3 gallium: added st_get_proc_address() 2008-06-18 09:22:00 -06:00
Brian Paul
04996bcef6 gallium: added FEATURE_x tests 2008-06-18 09:22:00 -06:00
Brian Paul
8cad3189d3 gallium: include scissor.h 2008-06-09 14:56:29 -06:00
Brian Paul
69fd676240 gallium: move vertex/fragment program unbinding 2008-05-20 14:38:22 -06:00
Brian Paul
90ce8467a8 gallium: clean-up glDraw/CopyPixels shaders when destroying context 2008-05-20 13:49:18 -06:00
Brian Paul
87afc9bcad gallium: release textures during context tear-down (fix mem leak) 2008-05-16 16:04:30 -06:00
Brian
103ae5d16f gallium: implement full reference counting for vertex/fragment programs
Use _mesa_reference_vert/fragprog() wherever we assign program pointers.
Fixes a memory corruption bug found with glean/api2 test.
Another memory bug involving shaders yet to be fixed...
2008-05-06 22:13:06 -06:00
Brian Paul
99fba5466b gallium: use new buffer wrapper functions in p_inlines.h
This allows us to remove most of the direct references to winsys in the state tracker.
2008-04-30 10:43:59 -06:00
Brian Paul
a770d40c3d gallium: use cso_destroy_vertex/fragment_shader() functions
Also, rearrange the st_destroy_context() code a bit to prevent some
invalid/NULL ptr derefs during tear-down.
2008-04-24 12:15:05 -06:00
Brian Paul
f2b3f6cbdf gallium: reorder some of the destroy context code 2008-04-17 11:13:49 -06:00
Brian Paul
a52faa9325 gallium: remove unneeded st->haveFramebufferSurfaces field. 2008-04-09 16:09:46 -06:00
Brian Paul
ce5c867cbb gallium: streamline viewport/raster/shader state for clearing with quads
Move init of these items to new st_init_clear().
2008-04-03 12:54:32 -06:00
Brian
c62b197b52 gallium: implement a glBitmap cache
The bitmap cache attempts to accumulate a series of glBitmap calls in a
buffer to effectively render a whole bunch of bitmaps at once.

The cache can be disabled, if needed, by setting UseBitmapCache=GL_FALSE.
2008-03-28 14:53:47 -06:00
Brian Paul
7f56c8ea5f gallium: disable the selection/feedback draw module's options for wide lines, points, etc.
Disable paths that would convert points/lines to tris as that upsets selection,
feedback, rastpos.
2008-03-25 14:12:55 -06:00
Brian Paul
22a3d02254 gallium: free bitmap fragment shaders, misc clean-up 2008-03-24 11:56:05 -06:00
Brian
f6cd3778c5 gallium: glBitmap code now separe from glDraw/CopyPixels code
Also, glBitmap now re-uses the vertex buffer to avoid frequent allocations/
deallocations.  And, use u_simple_shaders utility code.
2008-03-20 15:04:08 -06:00
Brian
85e4ec6d11 gallium: use the utility pasthrough shaders
This avoids the Mesa->TGSI translation step.
2008-03-20 09:13:51 -06:00
Brian
0df877a0ee gallium: plug in and init GL_EXT_framebuffer_blit function/extension 2008-03-18 17:18:11 -06:00
Brian
339e7ec680 gallium: rework CSO-related code in state tracker
Use the code in cso_context.c rather than st_cache.c.
Basically, binding of state objects now goes through the CSO module.
But Vertex/fragment shaders go through pipe->bind_fs/vs_state() since they're
not cached by the CSO module at this time.

Also, update softpipe driver to handle NULL state objects in various places.
This happens during context destruction.  May need to update other drivers...
2008-03-11 18:55:58 -06:00
José Fonseca
6acd63a498 Code reorganization: update build.
Update the Makefiles and includes for the new paths.

Note that there hasn't been no separation of the Makefiles yet, and make is
jumping all over the place. That will be taken care shortly. But for now, make
should work. It was tested with linux and linux-dri. Linux-cell and linux-llvm
might require some minor tweaks.
2008-02-15 17:50:12 +09:00
Brian
62abcb9aac gallium: initial implemenation of auto mipmap generation in state tracker
Use hardware rendering to compute/render mipmap levels.
The fallback path (which will be used for non-renderable texture formats)
isn't working yet.
2008-02-08 15:13:49 -07:00
Keith Whitwell
1e0d30a515 gallium: rename pipe_buffer_handle to pipe_buffer, rework pipebuffer/ code
Provide an actual definition of the pipe_buffer struct,  containing
the parameters used to create the buffer, and its refcount.

Shift refcounting buffers out of the winsys interface, similar to
surfaces & textures.

Rework pipebuffer/ to reflect the fact these changes, and also Michel's
reworking of the buffer interface.
2008-01-25 20:53:31 +00:00
Brian
6128c93865 unref const buffers during context destroy 2008-01-01 10:21:21 -07:00
Brian
c664302c3e Fix problem with initial viewport/scissor size.
If an app never called glViewport, the viewport size was always 0 by 0 pixels.
Now pass initial size to st_create_framebuffer() and initialize the viewport
and scissor bounds in st_make_current().
This could also be fixed by ensuring the gl_framebuffers passed to
_mesa_make_current() were initialized to the right size.  But that involves
allocating the renderbuffers/pipe_surfaces earlier and that runs into some
other issues ATM.
Also remove obsolete createRenderbuffers param to st_create_framebuffer().
2007-12-19 13:45:00 -07:00
Brian
2d2bb35f96 Move _mesa_init_glsl_driver_functions() into shader_api.c
This allows making a bunch of functions static, and removes a state
tracker dependency on driverfuncs.c
2007-12-07 17:11:30 -07:00
Michel Dänzer
b859cdf6f1 Eliminate struct pipe_region.
Directly use struct pipe_buffer_handle for storage and struct pipe_surface for
(un)mapping.
2007-12-07 12:30:35 +01:00
Brian
601a9ea9a7 init glsl functions in st_init_driver_functions() 2007-11-07 08:20:00 -07:00
Brian
c6499a741c Determine GL extensions/limits by making pipe queries.
The state tracker calls pipe->get_param() to determine the GL limits and
which OpenGL extensions are supported.
This is an initial implementation that'll probably change...
2007-11-05 18:04:30 -07:00
Brian
91564eedcc Remove some temporary state tracker context/framebuffer_create functions. 2007-11-05 16:15:43 -07:00