Commit Graph

177 Commits

Author SHA1 Message Date
Brian Paul
146f536b33 mesa: add new DeleteTextureImage() driver hook
Matches the NewTextureImage() hook.  With new subclasses of
gl_texture_image coming we need a new hook to properly delete objects of
those subclasses.
2011-09-17 14:57:40 -06:00
Ian Romanick
eba527bf9f mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette
This was also discussed at XDS 2010.  However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx).  Now that those
drivers have been removed, this code can be removed as well.

v2: A lot of bits that were missed in the previous patch have been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:08:25 -07:00
Brian Paul
d6a0692f9d mesa: don't use K&R style function pointer calls 2011-08-04 15:33:39 -06:00
Brian Paul
db0f2b3637 mesa: use inline function wrapper for _mesa_reference_texobj() 2011-07-14 08:14:13 -06:00
Henri Verbeet
2e35d90fb9 mesa: Check the texture against all units in unbind_texobj_from_texunits().
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Eric Anholt
001e071443 mesa: Flag _NEW_BUFFERS when unbinding an attachment on glDeleteTextures.
The _ColorDrawBuffers[] wouldn't get updated despite us having updated
what it depends on (Attachments[]->Renderbuffer).  Other callers of
_mesa_remove_attachment are already flagging _NEW_BUFFERS for other
reasons.  The specific bug report that led to this fix (and
the fbo-finish-deleted testcase) was fixed by
23b6f9606d, though.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-18 15:26:26 -07:00
Marek Olšák
8a50637453 mesa: EXT_texture_sRGB_decode little fixup
It doesn't fix bug 37150 though.
2011-05-13 01:43:28 +02:00
Marek Olšák
a19c42ffc6 mesa: implement AMD_seamless_cubemap_per_texture 2011-05-06 20:06:30 +02:00
Brian Paul
ecfaab88b2 mesa: move sampler state into new gl_sampler_object type
gl_texture_object contains an instance of this type for the regular
texture object sampling state.  glGenSamplers() generates new instances
of gl_sampler_object which can override that state with glBindSampler().
2011-04-10 13:12:49 -06:00
Brian Paul
874a2c0b7d mesa: core support for GL_ARB_texture_buffer_object
No GLSL or driver support yet.
2011-04-05 19:02:09 -06:00
Brian Paul
cbadedb511 mesa: use _mesa_get_current_tex_unit() helper in BindTexture() 2011-03-16 21:13:31 -06:00
Brian Paul
552f54bf04 mesa: remove unneeded local var in BindTexture() 2011-03-16 21:13:31 -06:00
Brian Paul
dfda559b98 mesa: clean up the glBindTexture early out code a bit 2011-03-16 21:13:31 -06:00
Dave Airlie
edc2dd8e47 mesa/swrast: implement EXT_texture_sRGB_decode
This implements the extension by choosing a different set of texture
fetch functions when the texture parameter changes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-16 12:54:06 +10:00
Eric Anholt
9b7f57b18e mesa: Consider textures incomplete when maxlevel < baselevel.
See section 3.8.10 of the GL 2.1 specification.  There's no way to do
anything sane with that, and drivers would get all sorts of angry.
2011-01-05 15:51:37 -08:00
Brian Paul
6dca66b620 mesa: set gl_texture_object::_Complete=FALSE in incomplete() 2010-12-06 17:10:05 -07:00
Brian Paul
ecb7cc3319 mesa: test for cube map completeness in glGenerateMipmap()
The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.
2010-12-06 17:10:05 -07:00
Brian Paul
83e93b6008 mesa: pass gl_format to _mesa_init_teximage_fields()
This should prevent the field going unset in the future.  See bug
http://bugs.freedesktop.org/show_bug.cgi?id=31544 for background.

Also remove unneeded calls to clear_teximage_fields().

Finally, call _mesa_set_fetch_functions() from the
_mesa_init_teximage_fields() function so callers have one less
thing to worry about.
2010-11-18 16:15:38 -07:00
Brian Paul
76114d23d1 mesa: whitespace cleanups 2010-11-16 20:12:34 -07:00
Brian Paul
61f25216e3 mesa: silence new warnings in texobj.c
Silences warning such as:
main/texobj.c:442:40: warning: ISO C99 requires rest arguments to be used
main/texobj.c:498:58: warning: ISO C99 requires rest arguments to be used
2010-11-02 17:41:00 -06:00
Eric Anholt
1210aa7551 mesa: Don't compute an unused texture completeness debug string.
This showed up at about 1% on cairo-gl firefox-talos-gfx, where
glClear() is called while a texture is incomplete.
2010-11-02 14:24:42 -07:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Brian Paul
5522887842 mesa: don't call valid_texture_object() in non-debug builds
This reverts commit c32bac57ed
and silences the warning differently.

The _mesa_reference_texobj() function is called quite a bit and
we don't want to call valid_texture_object() all the time in non-
debug builds.
2010-09-20 08:21:00 -06:00
Vinson Lee
c32bac57ed mesa: Silence "'valid_texture_object' defined but not used" warning. 2010-09-17 23:43:38 -07:00
Brian Paul
ec2b92f98c mesa: rename src/mesa/shader/ to src/mesa/program/ 2010-06-10 23:23:13 -06:00
Vinson Lee
fc1be4a994 mesa: s/sprintf/_mesa_snprintf/ 2010-05-02 01:03:59 -07:00
Kristian Høgsberg
298be2b028 Replace the _mesa_*printf() wrappers with the plain libc versions 2010-02-19 12:32:24 -05:00
Kristian Høgsberg
32f2fd1c5d Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions 2010-02-19 12:03:01 -05:00
Brian Paul
6bf1ea897f mesa: replace _mesa_bzero() with memset() 2010-02-19 08:32:36 -07:00
Brian Paul
cd8614b028 Merge branch 'mesa_7_7_branch'
Conflicts:
	src/gallium/auxiliary/draw/draw_context.c
	src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
	src/gallium/auxiliary/pipebuffer/Makefile
	src/gallium/auxiliary/pipebuffer/SConscript
	src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
	src/gallium/auxiliary/tgsi/tgsi_scan.c
	src/gallium/drivers/i915/i915_surface.c
	src/gallium/drivers/i915/i915_texture.c
	src/gallium/drivers/llvmpipe/lp_setup.c
	src/gallium/drivers/llvmpipe/lp_tex_sample_c.c
	src/gallium/drivers/llvmpipe/lp_texture.c
	src/gallium/drivers/softpipe/sp_prim_vbuf.c
	src/gallium/state_trackers/xorg/xorg_dri2.c
	src/gallium/winsys/drm/intel/gem/intel_drm_api.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c
	src/mesa/state_tracker/st_cb_clear.c
2010-01-22 12:17:02 -07:00
Vinson Lee
c847e7d07b mesa: Remove unnecessary header from texobj.c. 2010-01-17 20:50:15 -08:00
Brian Paul
f6c2d1f94f mesa: make texture BorderColor a union of float/int/uint
When we have integer-valued texture formats, the texture border color
must also store integer and uint values.

With GL 3.0, the new glTexParameterIiv() and glTexParameterIuiv() functions
can set the border color to int or uint values.
2010-01-04 19:53:30 -07:00
Brian Paul
a087eb590d Merge branch 'mesa_7_7_branch'
Conflicts:
	src/gallium/state_trackers/xorg/xorg_xv.c
	src/mesa/drivers/dri/intel/intel_span.c
2009-12-11 10:04:07 -07:00
Brian Paul
b605f4ff11 Merge branch 'mesa_7_6_branch' into mesa_7_7_branch 2009-12-11 09:22:00 -07:00
Brian Paul
3de8fff45d mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test
This fixes invalid array indexing when baseLevel == MAX_TEXTURE_LEVELS.
See bug 25528.
2009-12-09 08:30:05 -07:00
Brian Paul
09325b9ff4 mesa: added comment for target_enum_to_index() 2009-12-01 12:28:25 -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
7ac233ec15 mesa: choose texture format in _mesa_get_fallback_texture() 2009-10-28 19:33:48 -06:00
Brian Paul
73fc0ca4c3 mesa: remove unused ctx->Driver.PrioritizeTextures() hook 2009-10-14 19:08:38 -06:00
Brian Paul
55770d09c1 Merge branch 'mesa_7_6_branch'
Conflicts:

	src/gallium/auxiliary/util/u_cpu_detect.c
2009-10-05 14:42:08 -06:00
Brian Paul
e1bddd159f mesa: fix incorrect default texture binding in unbind_texobj_from_texunits()
If we deleted a currently bound texture, we were always reverting the texture
binding to the default 1D texture rather than the proper default texture.
2009-10-02 09:57:00 -06:00
Brian Paul
f8d8f45278 mesa: better debug message 2009-10-01 08:38:38 -06:00
Chia-I Wu
cb4f24e51d mesa/main: Make FEATURE_colortable follow feature conventions.
As shown in mfeatures.h, this allows users of colortab.h to work
without knowing if the feature is available.
2009-09-24 21:48:22 -06:00
Brian Paul
c10002361c mesa: s/assert/ASSERT/ in _mesa_reference_texobj()
We want the no-op ASSERT for non-debug builds.
2009-08-13 12:50:57 -06:00
Brian Paul
3105fd760b mesa: fix comment 2009-08-07 09:50:37 -06:00
Chia-I Wu
42b6b067ac mesa/main: Add functions to clear and dirty texture objects.
This commit adds a function to clear a texture object such that there is
no image data associated with it, and a function to dirty it so that it
will be re-tested for completeness.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
2009-08-05 16:06:50 -06:00
Ian Romanick
7f8000db8b Fast path when rebinding the same texture in single context environment
If there is no shared context, there is no purpose in rebinding the same
texture.  In some artificial tests this improves performance 10% - 30%.
2009-06-03 17:50:37 +01:00
Brian Paul
43d8ace88d mesa: print more info when valid_texture_object() fails 2009-05-19 09:21:39 -06:00
Brian Paul
3f25219c7b mesa: create/use a fallback texture when bound texture is incomplete
When a GLSL sampler reads from an incomplete texture it should
return (0,0,0,1).  Instead of jumping through hoops in all the drivers
to make this happen, just create/install a fallback texture with those
texel values.

Fixes piglit/fp-incomplete-tex on i965 and more importantly, fixes some
GPU lockups when trying to sample from missing surfaces.  If a binding
table entry is NULL, it seems that sampling sometimes works, but not
always (lockup).

Todo: create a fallback texture for each type of texture target?
2009-05-01 09:30:32 -06:00
Vinson Lee
1eee1bac1f mesa: update/fix doxygen comments 2009-03-17 09:34:30 -06:00