Commit Graph

188 Commits

Author SHA1 Message Date
Keith Whitwell
683e35f726 gallium: don't use arrays for texture width,height,depth 2009-11-19 14:39:34 -08:00
Brian Paul
4bced42341 Merge branch 'mesa_7_6_branch' 2009-11-03 09:54:09 -07:00
Brian Paul
e60ebebb39 st/mesa: don't use util_blit_pixels_writemask() for depth or depth/stencil
util_blit_pixels_writemask() only works for color formats at this time.
Also, it might never work for depth/stencil surfaces since we can't get
handle stencil values in a fragment shader.

Fixes glCopyTexSubImage(GL_DEPTH_COMPONENT).
2009-11-03 09:48:04 -07:00
Brian Paul
0197348641 st/mesa: fix tests for depth and depth/stencil texture formats 2009-11-03 09:48:04 -07:00
Brian Paul
1f196b786d Merge branch 'texformat-rework'
Conflicts:
	src/mesa/drivers/dri/radeon/radeon_fbo.c
	src/mesa/drivers/dri/s3v/s3v_tex.c
	src/mesa/drivers/dri/s3v/s3v_xmesa.c
	src/mesa/drivers/dri/trident/trident_context.c
	src/mesa/main/debug.c
	src/mesa/main/mipmap.c
	src/mesa/main/texformat.c
	src/mesa/main/texgetimage.c
2009-10-28 21:24:11 -06:00
Brian Paul
11caea687e mesa: choose texture format in core mesa, not drivers
Call the ctx->Driver.ChooseTextureFormat() function from core Mesa's
_mesa_[Copy]TexImage functions instead of in the driver functions.
One less thing for drivers to do.
2009-10-25 18:06:24 -06:00
Brian Paul
253e7fee5d mesa: remove _mesa_compressed_row_stride() calls 2009-10-25 17:21:11 -06:00
Brian Paul
4c00981b22 mesa: remove ctx->Driver.CompressedTextureSize() hook
It always just called _mesa_compressed_texture_size() anyway.
2009-10-24 16:34:25 -06:00
Brian Paul
35efc6a1b3 mesa: change compressed texture size calls
Replace calls to ctx->Driver.CompressedTextureSize with calls to
_mesa_format_image_size.  The former always called the later.
2009-10-24 16:28:27 -06:00
Corbin Simpson
bb567357bc gallium: Permit surface_copy and surface_fill to be NULL.
Uf. Lots of files touched. Would people with working vega, xorg, dri1, etc.
please make sure you are not broken, and fix yourself up if you are.

There were only two or three places where the code did not have painful
fallbacks, so I would advise st maintainers to find less painful workarounds,
or consider overhauling util_surface_copy and util_surface_fill.

Per ymanton, darktama, and Dr_Jakob's suggestions, clear has been left as-is.

I will not add PIPE_CAP_BLITTER unless it is deemed necessary.
2009-10-17 21:32:56 -07:00
Brian Paul
45e76d2665 mesa: remove a bunch of gl_renderbuffer fields
_ActualFormat is replaced by Format (MESA_FORMAT_x).
ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are
all replaced by MESA_FORMAT_x queries.
2009-10-08 20:27:27 -06:00
Keith Whitwell
b02ef740b9 mesa/st: add ST_DEBUG environment variable
At last it's possible to turn on tgsi dumps and other debugging in the
state tracker without modifying sources...
2009-10-05 15:51:55 +01:00
Brian Paul
32aa40eee4 mesa: removed gl_texture_image::CompressedSize field
Just call ctx->Driver.CompressedTextureSize() when we need to get
the compressed image size.
2009-10-01 21:13:34 -06:00
Brian Paul
4ca9ba2544 mesa: move mesa_set_fetch_functions() 2009-10-01 16:42:37 -06:00
Brian Paul
b6bdafdf2c mesa: remove gl_texture_image::IsCompressed field
Use _mesa_is_format_compressed() instead.
2009-10-01 16:29:44 -06:00
Brian Paul
495628bc5c st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
(cherry picked from master, commit ae2daacbac)
2009-10-01 13:34:49 -06:00
Cooper Yuan
ae2daacbac st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
2009-10-01 17:54:27 +08:00
Brian Paul
1f7c914ad0 mesa: replace gl_texture_format with gl_format
Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum.
ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x.
gl_texture_format will go away next.
2009-09-30 20:28:45 -06:00
Brian Paul
6480210b89 st/mesa: use _mesa_texstore() 2009-09-28 21:52:23 -06:00
Brian Paul
05bad193f5 st/mesa: check gl_texture_object::GenerateMipmap field when allocating texmem
In guess_and_alloc_texture() use the gl_texture_object::GenerateMipmap
field as another hint as to whether to allocate space for a whole mipmap.
2009-09-28 10:03:58 -06:00
Brian Paul
8fda97afb8 Merge branch 'mesa_7_6_branch' 2009-09-28 10:02:20 -06:00
Brian Paul
eeb7e04da6 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-28 09:59:59 -06:00
Brian Paul
e3a6f57ad6 st/mesa: fix/simplify st_texture_object::lastLevel calculation
Don't compute the st_texture_object::lastLevel field based on the texture
filters.  Use the _MaxLevel value that core Mesa computes for us.
When called from the GenerateMipmap path, we'll use the lastLevel field
as-is.
2009-09-28 09:35:08 -06:00
Brian Paul
ef089604a9 mesa: use texture format functions 2009-09-27 21:14:12 -06:00
Brian Paul
adce34e23b st/mesa: use _mesa_get_texstore_func() 2009-09-27 18:39:17 -06:00
Brian Paul
ebf2710b2f Merge branch 'mesa_7_6_branch'
Conflicts:
	src/mesa/drivers/dri/intel/intel_clear.c
2009-09-20 10:36:45 -06:00
Nicolai Hähnle
82c2f7756a Merge branch 'mesa_7_5_branch' into mesa_7_6_branch 2009-09-20 16:59:03 +02:00
Brian Paul
08d39251a7 st/mesa: fix some incorrect branching/clean-up code in TexImage functions
We need to be sure to call the _mesa_unmap_teximage_pbo() function if we
called _mesa_validate_pbo_teximage().
2009-09-16 13:07:15 -06:00
Brian Paul
cfa1a0a609 st/mesa: fix texture memory allocation bug
The following example caused an incorrect GL_OUT_OF_MEMORY error to be
raised in glTexSubImage2D:

   glTexImage2D(level=0, width=32, height=32, pixels=NULL);
   glTexImage2D(level=0, width=64, height=64, pixels=NULL);
   glTexSubImage2D(level=0, pixels!=NULL);

The second glTexImage2D() call needs to cause the first image to be
deallocated then reallocated at the new size.  This was not happening
because we were testing for pixels==NULL too early.
2009-09-16 12:57:26 -06:00
Brian Paul
2914f2b7fd mesa: move generate mipmap calls
Per the suggestion in the Intel driver, move the calls to
ctx->Driver.GenerateMipmap() into core Mesa so that drivers don't
have to worry about it.
2009-09-15 18:17:43 -06:00
Brian Paul
5a8e1ddf19 st/mesa: silence uninitialized var warnings 2009-09-03 16:07:46 -06:00
Keith Whitwell
8fc945cd84 st/mesa: Do GL_RGBA->GL_RGB texsubimage on hardware
State tracker currently backs GL_RGB textures with RGBA almost always.
This means we need to maintain A==1 in these textures to give correct GL_RGB
sampling results.

This change offloads the RGBA->RGB copy to hardware using the new writemask
version of u_blit_pixels.

More src/dstLogical/dstActual triples could be shifted to hardware by
this technique in future patches.
2009-09-03 16:07:45 -06:00
Brian Paul
67c286d20e st/mesa: silence uninitialized var warnings 2009-09-03 15:04:49 -06:00
Brian Paul
1b448c7a5c mesa: consolidate PBO map/unmap helpers
Instead of _mesa_map_readpix_pbo() use _mesa_map_pbo_source().

Instead of _mesa_map_drawpix_pbo() and _mesa_map_bitmap_pbo() use
_mesa_map_pbo_dest().
2009-09-03 11:45:17 -06:00
Keith Whitwell
e79054cc40 st/mesa: Do GL_RGBA->GL_RGB texsubimage on hardware
State tracker currently backs GL_RGB textures with RGBA almost always.
This means we need to maintain A==1 in these textures to give correct GL_RGB
sampling results.

This change offloads the RGBA->RGB copy to hardware using the new writemask
version of u_blit_pixels.

More src/dstLogical/dstActual triples could be shifted to hardware by
this technique in future patches.
2009-09-02 18:31:48 +01:00
Chia-I Wu
54a7115fc2 mesa/st: Add support for binding pipe surface to texture.
This commit adds functions to bind a pipe surface to a texture.  This
allows texturing directly from the surface.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-05 16:07:19 -06:00
Patrice Mandin
c1785c19ca mesa st: Move logbase2 function to util/u_math.h 2009-08-01 11:03:30 +02:00
Brian Paul
a7427b0f7b st/mesa: silence warning 2009-07-27 15:10:28 -06:00
José Fonseca
d4e6df9ab6 mesa: Fix logbase2.
It was providing 1 too many for non power two values.
2009-07-16 19:20:25 +01:00
José Fonseca
4ed1de8b84 mesa: Report the true face number when flushing. 2009-07-14 12:20:43 +01:00
Michel Dänzer
71633abafc gallium: Fixes for clobbering stencil values in combined depth/stencil textures.
Also fix one case where a 32 bit depth value was incorrectly converted to a
combined depth/stencil value.
2009-07-07 14:49:52 +02:00
José Fonseca
2a2236606f mesa: Assume depth textures have a single level unless told otherwise. 2009-07-02 17:24:50 +01:00
Jakob Bornecrantz
578230dbbf st/gl: Add stubs for CompressedTexSubImage[1D|3D] 2009-06-30 14:11:49 +02:00
Jakob Bornecrantz
a4fd94a54a st/gl: Add support for glCompressedTexSubImage 2009-06-30 14:11:45 +02:00
Keith Whitwell
503632557e mesa/st: restore flush to copy_texsubimage (was previously finish)
Need a flush here even though the original finish was overkill.
2009-06-01 20:34:44 -07:00
Jakob Bornecrantz
f989390af6 st/gl: Fix mip gen for compressed textures 2009-06-01 18:40:12 -07:00
Keith Whitwell
e90beb93a8 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.
2009-05-08 14:57:30 +01:00
Keith Whitwell
507f4e7a74 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.
2009-05-08 14:57:30 +01:00
Keith Whitwell
afd16512bc mesa/st: workaround for crashes in st_copy_texsubimage
Proper fix for this hasn't been identified, but avoid crashing.
2009-04-28 18:15:16 +01:00
Keith Whitwell
5ed7764fd6 mesa/st: fix incorrect face, level in compress_with_blit
We were incorrectly applying the destination texture face and level
when requesting a transfer to the temporary texture, which has only
one face and level.  This would obviously cause problems uploading to
compressed cube and mipmap textures.
2009-04-27 14:43:57 +01:00