aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_sampler.c
Commit message (Collapse)AuthorAgeFilesLines
...
* st/mesa: add const qualifiers in sampler validation codeBrian Paul2013-12-131-3/+3
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: simplify integer texture checkBrian Paul2013-12-131-5/+2
| | | | | | | Just use the gl_texture_object::_IsInteger field instead of computing it from scratch. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: move max texture image unit constants to gl_program_constantsMarek Olšák2013-05-111-3/+3
| | | | | | | | | | Const.MaxTextureImageUnits -> Const.FragmentProgram.MaxTextureImageUnits Const.MaxVertexTextureImageUnits -> Const.VertexProgram.MaxTextureImageUnits etc. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: optionally apply texture swizzle to border color v2Christoph Bumiller2013-04-181-3/+24
| | | | | | | | | | | | This is the only sane solution for nv50 and nvc0 (really, trust me), but since on other hardware the border colour is tightly coupled with texture state they'd have to undo the swizzle, so I've added a cap. The dependency of update_sampler on the texture updates was introduced to avoid doing the apply_depthmode to the swizzle twice. v2: Moved swizzling helper to u_format.c, extended the CAP to provide more accurate information.
* st/mesa: fix integer texture border color for some formats (v2)Marek Olšák2012-10-151-3/+9
| | | | | | | | | | | | And the clear color too, though that may be an issue only with GL_RGB if it's actually RGBA in the driver. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]> v2: The types of st_translate_color parameters were changed to gl_color_union and pipe_color_union as per Brian's comment.
* st/mesa: add support for GS textures and samplersBrian Paul2012-08-161-8/+8
|
* st/mesa: combine vertex/fragment sampler state in arraysBrian Paul2012-08-161-6/+6
| | | | | | As with other recent changes, put the vertex and fragment sampler state into arrays indexed by the shader type. This will let us easily add support for other types of shaders in the future.
* st/mesa: merge fragment/vertex sampler update codeBrian Paul2012-08-061-56/+50
| | | | Reviewed-by: José Fonseca <[email protected]>
* st/mesa: massage update_vertex_samplers() codeBrian Paul2012-08-061-16/+20
| | | | | | | ...to look like update_fragment_samplers() code, as with the previous commit. The next step would be to merge the two functions. Reviewed-by: José Fonseca <[email protected]>
* st/mesa: rename some vertex/fragment state fields for better consistencyBrian Paul2012-08-061-4/+4
| | | | Reviewed-by: José Fonseca <[email protected]>
* gallium: consolidate CSO sampler and sampler_view functionsBrian Paul2012-08-031-6/+6
| | | | | | | | | | | | | Merge the vertex/fragment versions of the cso_set/save/restore_samplers() functions. Now we pass the shader stage (PIPE_SHADER_x) to the function to indicate vertex/fragment/geometry samplers. For example: cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler); This results in quite a bit of code reduction, fewer CSO functions and support for geometry shaders. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: remove st_get_default_texture()Brian Paul2012-02-151-1/+2
| | | | | | Just use _mesa_get_fallback_texture() instead. Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: exit the update fragment samplers/textures loops early.Dave Airlie2012-02-091-6/+10
| | | | | | | | | | If we have no more enabled samplers and we've reset all the previously used ones, no need to keep going around this loop. (just moved some stuff around to clean it up a bit). Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: avoid vertex texture and sampler updates for 0 caseDave Airlie2012-02-081-0/+2
| | | | | | | | | | | If we had no vertex textures or samplers previously and we have none now, don't bother doing the enables dance. I was profiling nexuiz on noop and noticed these two functions in the profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03% for texture and samplers. Signed-off-by: Dave Airlie <[email protected]>
* gallium: move border color to be a color unionDave Airlie2011-09-271-1/+1
| | | | | | | | | | EXT_texture_integer also specifies border color should be a color union, the values are used according to the texture sampler format. (update docs) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: fix indentation, whitespaceBrian Paul2011-06-141-69/+74
|
* st/mesa: replace st->ctx with ctxBrian Paul2011-06-141-8/+11
|
* st/mesa: only memset sampler when about to use it.Dave Airlie2011-05-181-3/+2
| | | | | | | | | | | This function was taking a lot more CPU than required due to it memsetting a bunch of memory that didn't require it from what I can see. We should only memset here when we are about to fill out the sampler, otherwise we end up doing a bunch of memsets for everytime this function is called, basically setting 0 memory to 0. Signed-off-by: Dave Airlie <[email protected]>
* st/mesa: overhaul vertex/fragment sampler and sampler views.Dave Airlie2011-05-161-76/+110
| | | | | | | | | | | | | | | | | | | This fixes piglits fragment-and-vertex-texturing test on llvmpipe for me. I've no idea if someone had another plan for this that is smarter than what I've done here, but what I've basically done is split fragment and vertex sampler and sampler_view setup function, factor out the common chunks of both. side-cleanups: drop st->state.sampler_list - unused don't update border color if we have no border color. should fix https://bugs.freedesktop.org/show_bug.cgi?id=35849 Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: implement seamless cubemap extensionsMarek Olšák2011-05-061-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* intel: Add support for ARB_sampler_objects.Eric Anholt2011-04-231-1/+3
| | | | | | | | | | | | This extension support consists of replacing "gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->". One instance of referencing the texture's base sampler remains in the initial miptree allocation, where I'm not sure we have a clear association with any texture unit. Tested with piglit ARB_sampler_objects/sampler-objects. Reviewed-by: Brian Paul <[email protected]>
* mesa: move sampler state into new gl_sampler_object typeBrian Paul2011-04-101-13/+18
| | | | | | 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().
* st/mesa: Clamp min_lod to the max miplevel as well.Henri Verbeet2011-04-081-1/+3
| | | | | | | | Otherwise min_lod can potentially be larger than the clamped max_lod. The code that follows will swap min_lod and max_lod in that case, resulting in a max_lod larger than MAX_LEVEL. Signed-off-by: Brian Paul <[email protected]>
* st/mesa: Set samplers views' first_level.Henri Verbeet2011-04-081-6/+3
| | | | | | | | Base level and min LOD aren't equivalent. In particular, min LOD has no effect on image array selection for magnification and non-mipmapped minification. Signed-off-by: Brian Paul <[email protected]>
* st/mesa: Apply LOD from texture objectFabian Bieler2011-04-051-1/+2
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: Apply LOD bias from correct texture unitFabian Bieler2011-04-051-1/+1
| | | | Signed-off-by: Brian Paul <[email protected]>
* st/mesa: need to translate clear color according to surface's base formatBrian Paul2011-02-211-44/+2
| | | | | | | | | | | When clearing a GL_LUMINANCE_ALPHA buffer, for example, we need to convert the clear color (R,G,B,A) to (R,R,R,A). We were doing this for texture border colors but not renderbuffers. Move the translation function to st_format.c and share it. This fixes the piglit fbo-clear-formats test. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* st/mesa: fix texture border color for RED and RG base formatsMarek Olšák2010-11-291-0/+12
| | | | | | | The spec says the border color should be consistent with the internal format. Signed-off-by: Brian Paul <[email protected]>
* st/mesa: fix sampler max_lod computationBrian Paul2010-07-071-1/+2
| | | | | This change makes gallium behave like other GL implementations and fixes a conformance failure.
* st/mesa: ignore gl_texture_object::BaseLevel when allocating gallium texturesBrian Paul2010-04-301-3/+6
| | | | | | | | | | | | | | | Previously, when we created a gallium texture for a corresponding Mesa texture we'd only allocate space for mipmap levels >= BaseLevel. This patch undoes that mechanism. This fixes a render-to-texture bug when rendering to level 0 when BaseLevel=1. Also, it makes sense to allocate the whole texture object memory when BaseLevel > 0 since a common use of GL_TEXTURE_BASE_LEVEL is to progressively load/render mipmaps. Eventually, the app almost always fills in the level=0 mipmap image. Finally, the texture image code is bit easier to understand now.
* gallium: make max_anisotropy a unsigned bitfield memberRoland Scheidegger2010-02-121-1/+1
| | | | | | | saves us a dword in sampler state, hw can't do non-integer aniso degree anyway. To allow aniso 1x (which seems of dubious value but some hardware (radeons) have such a mode, and even d3d allows specifiying it) redefine anisotropic filtering as disabled only if max_anistropy is 0.
* Merge branch 'mesa_7_7_branch'Brian Paul2010-01-221-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * st/mesa: Remove unnecessary header from st_atom_sampler.c.Vinson Lee2010-01-161-1/+0
| |
* | gallium: remove PIPE_TEX_FILTER_ANISOLuca Barbieri2010-01-061-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes PIPE_TEX_FILTER_ANISO. Anisotropic filtering is enabled if and only if max_anisotropy > 1.0. Values between 0.0 and 1.0, inclusive, of max_anisotropy are to be considered equivalent, and meaning to turn off anisotropic filtering. This approach has the small drawback of eliminating the possibility of enabling anisotropic filter on either minification or magnification separately, which Radeon hardware seems to support, is currently support by Gallium but not exposed to OpenGL. If this is actually useful it could be handled by splitting max_anisotropy in two values and adding an appropriate OpenGL extension. NOTE: some fiddling & reformatting by keithw to get this patch to apply. Hopefully nothing broken in the process.
* | mesa: make texture BorderColor a union of float/int/uintBrian Paul2010-01-041-1/+1
| | | | | | | | | | | | | | | | 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.
* | mesa: Update vertex texture code after gallium changes.Michal Krol2009-12-011-0/+9
|/
* mesa: use texture format functionsBrian Paul2009-09-271-1/+1
|
* st: as with swrast, interpret texture border color according to texture formatBrian Paul2009-04-061-4/+37
| | | | | Depending on the hardware driver this might not be needed, but it will cause no harm.
* st: rename a helper functionBrian Paul2009-04-061-4/+4
|
* gallium: check vertex shaders for samplers/texture usage as we do for ↵Brian2008-12-041-7/+13
| | | | fragment shaders
* gallium: use a default texture in update_textures(), update_samplers() when ↵Brian Paul2008-08-141-4/+8
| | | | | | | needed The default texture is used when the current fragment shader has texture sample instructions but the user has not provided/bound a texture.
* gallium: replace an assertion with "if (!texobj) continue"Brian Paul2008-07-021-1/+2
| | | | | | It's possible to call update_samplers() between the time a fragment shader is bound and when a texture image is defined (such as glClear). This fixes the case where we don't have a complete texture object yet.
* mesa: Replace abort by asserts.José Fonseca2008-06-241-1/+1
|
* gallium: check if sampler->max_lod < sampler->min_lodBrian Paul2008-06-171-0/+9
|
* gallium: sync up texture/sampler changes with masterBrian Paul2008-05-061-1/+1
|
* Merge commit 'origin/gallium-0.1' into gallium-tex-surfacesKeith Whitwell2008-05-061-1/+3
|\ | | | | | | | | | | | | Conflicts: src/mesa/state_tracker/st_atom_sampler.c src/mesa/state_tracker/st_cb_texture.c
| * gallium: fix warningsBrian Paul2008-05-031-1/+3
| |
| * gallium: fix sampler->max_lod computationBrian Paul2008-05-031-2/+3
| |
| * gallium: fix computation of sampler->min_lodBrian Paul2008-05-031-1/+1
| | | | | | | | | | The texture BaseLevel is accounted for in texture layout so it doesn't factor in here. May also need to adjust max_lod...
* | gallium: fix some BaseLevel, lastLevel bugsBrian Paul2008-05-031-2/+3
|/