Commit Graph

25 Commits

Author SHA1 Message Date
Brian Paul
0c75cb5afe st: reformatting, comments, var renaming 2009-05-19 20:05:28 -06:00
Brian Paul
7843243dee st: also check _NEW_PROGRAM flag for vertex shader constant buffers
This is a follow-on to commit c1a3b85280.
Note that (at this time) wherever _NEW_PROGRAM_CONSTANTS is set we're still
setting _NEW_PROGRAM so this won't really make any difference (for now).
2009-04-22 07:58:25 -06:00
Brian Paul
c1a3b85280 st: play it safe for now and check _NEW_PROGRAM for shader const buffer atom
When a new program is bound but no constants are updated we still need
to update the Gallium const buffer.
2009-04-21 17:00:54 -06:00
Brian Paul
f4f39902fd st: do away with dynamic state atom for const buffers
Just use the new _NEW_PROGRAM_CONSTANTS flag instead.
2009-04-21 16:47:30 -06:00
Thomas Hellstrom
e50dd26ca6 gallium: Create OGL state tracker wrappers for various CPU access operations.
There are two usage types of buffer CPU accesses:
One where we try to use the buffer contents for multiple draw commands in
a batch. (batch := sequence of commands that are flushed together),
like incrementally adding bitmaps to a bitmap texture that is reallocated
on flush.
And one where we assume we can safely overwrite the old buffer contexts, like
glTexSubImage. In this case we need to make sure all old drawing commands
referencing the buffer are flushed before we map the buffer.
This is easily forgotten.

Add wrappers for the most common of these operations. The first type is
prefixed with "st_no_flush" and the second type is prefixed with
"st_cond_flush", where "cond" indicates that we attmpt to only flush
if there is indeed unflushed draw commands referencing the buffer.

Prefixed functions are
screen::get_tex_transfer
pipe_buffer_write
pipe_buffer_read
pipe_buffer_map

Please use the wrappers whenever possible.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-04-17 13:18:05 +02: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
José Fonseca
693fac8ae2 gallium: Add pipe_buffer_write/read inlines.
Saves code, and will simplify future interface changes.
2009-02-24 11:30:25 +00:00
Zack Rusin
4f5308bdcb gallium: remove redundant size from the constant buffer
reuse the size of the actual buffer
2009-01-27 12:20:26 -05: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
José Fonseca
c67f353c0f mesa: Don't use alignments < 4. 2008-08-14 11:01:42 +01:00
Alan Hourihane
5e49037caa revert mode change back to 644 2008-05-02 10:34:58 +00:00
Alan Hourihane
54507125e7 Some changed for non-C99 compilers 2008-05-02 10:30:34 +00: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
Michel Dänzer
c07d3f6a9e gallium: Always allocate new const buffers instead of modifying existing ones. 2008-04-04 09:06:13 +01:00
Brian
fb1f4e207d gallium: fix const buffer update bug
If only glUniform is called between two renderings, the const buffers weren't
getting updated.  Need to set the _NEW_PROGRAM flag in st_upload_constants()
as that's the dirty flag set by glUniform.
Fixes glean tapi2 test.
2008-03-21 15:54:27 -06: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
Michel Dänzer
756d52ec12 gallium: Simplify winsys buffer interface.
The properties of a buffer represented by struct pipe_buffer_handle are now
basically constant over its lifetime. The state tracker gets to deal with any
more complex buffer semantics it may need to provide.
2008-01-25 17:01:01 +01:00
keithw
cd1eefee84 add fence interfaces and buffer create flags to pipe_winsys 2007-12-09 14:03:33 +00:00
José Fonseca
fa1a66d7fc Supply buffer usage hints to winsys.
Winsys driver needs some hints in order to allocate the appropriate kind of
memory for the buffer.
2007-11-06 14:49:38 +00:00
Brian
b8042fb7fb make st_upload_constants() public 2007-10-30 11:32:53 -06:00
Brian
bbcbd362a9 remove old debug code, fix warning 2007-09-28 16:20:10 -06:00
Brian
715e5edff6 better debugging 2007-09-26 15:34:31 -06:00
Brian
38504011c8 better debug output 2007-09-25 15:20:58 -06:00
Brian
f48e055c10 silence warning 2007-09-17 10:05:34 -06:00
keithw
b0455958cc add missing files 2007-08-25 22:05:16 +01:00