aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/i915_texstate.c
Commit message (Collapse)AuthorAgeFilesLines
* i915: Add support for GL_EXT_texture_sRGB and GL_EXT_texture_sRGB_decode.Eric Anholt2013-04-291-0/+11
| | | | This brings the driver up to GL 2.1.
* intel: Make intel_region's pitch be bytes instead of pixels.Eric Anholt2013-01-181-3/+2
| | | | | | | | | | | | We almost never want a stride in pixels -- if you're doing anything with a stride, you're specifying an offset or incrementing a pointer, and in both cases you had to multiply by cpp to get the bytes value you wanted. But worse, on the way to creating a region from a new tiled BO, we divided by cpp to get pitch in pixels, and for an RGB32 buffer (an upcoming change) the pitch wouldn't divide exactly, and we'd end up with a wrong stride in our region. Reviewed-by: Kenneth Graunke <[email protected]>
* i915: Fix wrong sizeof argument in i915_update_tex_unit.Vinson Lee2012-11-211-1/+1
| | | | | | | | | The bug was found by Coverity. NOTE: This is a candidate for the stable branches. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Move DepthMode to texture objectPauli Nieminen2012-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on compatibility profile specifications. OpenGL specification 4.1 compatibility 20100725 3.9.2: "... The values accepted in the pname parameter are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_- FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_- LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and in the sampler state in table 6.26 is not part of the sampler state, and remains in the texture object." The list of states is in Table 6.24 "Textures (state per texture object)" instead of 6.25 mentioned in the specification text. Same can be found from 3.3 compatibility specification. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Add offset field to miptreeKristian Høgsberg2012-07-111-1/+1
| | | | | | | | This lets us specify an offset into the bo where the miptree starts, which will let us set up a texture for a single plane in a planar buffer. Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i915: fallback for NPOT cubemap textureYuanhan Liu2012-03-191-0/+22
| | | | | | | | | | | | | | | | | Although some hardware support NPOT cubemap, but it seems we don't know the right layout for NPOT cubemap. Thus seems we need do fallback for other platforms as well. See comments inline the code for more detailed info. v2: give a more detailed info about why we need fallback for other platfroms as well. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46666 NOTE: This is a candidate for stable release branches. Signed-off-by: Yuanhan Liu <[email protected]>
* intel: Convert from GLboolean to 'bool' from stdbool.h.Kenneth Graunke2011-10-181-12/+12
| | | | | | | | | | | | | | | | | I initially produced the patch using this bash command: for file in {intel,i915,i965}/*.{c,cpp,h}; do [ ! -h $file ] && sed -i 's/GLboolean/bool/g' $file && sed -i 's/GL_TRUE/true/g' $file && sed -i 's/GL_FALSE/false/g' $file; done Then I manually added #include <stdbool.h> to fix compilation errors, and converted a few functions back to GLboolean that were used in core Mesa's function pointer table to avoid "incompatible pointer" warnings. Finally, I cleaned up some whitespace issues introduced by the change. Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Chad Versace <[email protected]> Acked-by: Paul Berry <[email protected]>
* intel: Rename region->buffer to region->bo, and remove accessor function.Eric Anholt2011-09-261-2/+2
| | | | | | | We call all the other drm_intel_bo pointers in intel/*.h "bo", so this one was rather out of place. Acked-by: Kenneth Graunke <[email protected]>
* intel: add support for __DRI_IMAGE_FORMAT_ABGR8888Chia-I Wu2011-09-091-0/+2
| | | | | | | | | | | It maps to MESA_FORMAT_RGBA8888_REV. Surfaces of the format can only be sampled from but not render to. Only i915 is tested. Reviewed-by: Eric Anholt <[email protected]> [olv: add a check in intel_image_target_renderbuffer_storage]
* i915: Fix depth texturing since 86e62b2357447b7c97f434be4834f4b50aa0764dEric Anholt2011-07-121-0/+1
| | | | | | The 965 driver already had the X8_Z24 case, but 915 was missing it. Reviewed-by: Ian Romanick <[email protected]>
* i915: Use _mesa_get_format_name to describe translate_tex_format() fail.Eric Anholt2011-07-121-1/+2
| | | | | | | I don't want to go count up to what format number 29 is. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i915: Drop dead argument to translate_texture_format().Eric Anholt2011-06-141-3/+1
|
* intel: Add support for ARB_sampler_objects.Eric Anholt2011-04-231-19/+21
| | | | | | | | | | | | 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-19/+19
| | | | | | 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().
* intel: Clarify first_level/last_level vs baselevel/maxlevel by deletion.Eric Anholt2011-01-051-1/+1
| | | | | | | | | This has always been ugly about our texture code -- object base/max level vs intel object first/last level vs image level vs miptree first/last level. We now get rid of intelObj->first_level which is just tObj->BaseLevel, and make intelObj->_MaxLevel clearly based off of tObj->_MaxLevel instead of duplicating its code (incorrectly, as image->MaxLog2 only considers width/height and not depth!)
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-1/+1
|
* intel: Change dri_bo_* to drm_intel_bo* to consistently use new API.Eric Anholt2010-06-081-3/+3
| | | | | The slightly less mechanical change of converting the emit_reloc calls will follow.
* i915: Clamp minimum lod to maximum texture level too.Eric Anholt2010-06-041-1/+3
| | | | | | | Otherwise, we'd run into minlod > maxlod, and the sampler would give us the undefined we asked for. Bug #24846. Fixes OGLC texlod.c.
* intel: Replace mt->pitch with mt->region->pitch.Eric Anholt2010-03-171-1/+1
| | | | | | The pitch is not really an inherent part of the miptree, since it's not part of any of the layout calculations, and it's dictated by the libdrm-allocated region pitch now.
* intel: Remove support for the DRI1 TFP extension.Eric Anholt2010-03-051-28/+8
|
* mesa: make texture BorderColor a union of float/int/uintBrian Paul2010-01-041-4/+4
| | | | | | | | 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.
* Merge branch 'mesa_7_7_branch'Brian Paul2010-01-041-3/+4
|\ | | | | | | | | | | | | | | | | Conflicts: docs/relnotes.html src/gallium/drivers/llvmpipe/lp_tex_sample_c.c src/gallium/drivers/r300/r300_cs.h src/mesa/drivers/dri/i965/brw_wm_surface_state.c src/mesa/main/enums.c
| * i915: Use _MaxLevel on principle in texture setup.Eric Anholt2010-01-041-3/+4
| | | | | | | | | | | | It was OK before because we proceed to clamp the value to hardware limits, but given that other use of MaxLevel has been a trap, let's avoid it.
* | Merge branch 'mesa_7_7_branch'Brian Paul2009-12-211-11/+7
|\| | | | | | | | | | | Conflicts: src/mesa/main/version.h src/mesa/state_tracker/st_atom_shader.c
| * i915: Fix GL_TEXTURE_MAX_LEVEL support (piglit levelclamp test).Eric Anholt2009-12-181-1/+6
| |
| * i915: Clean up some unnecessary x/y miptree code.Eric Anholt2009-12-181-10/+1
| | | | | | | | | | | | The base of the texture is always the base of the miptree. If it wasn't, we'd have issues with this code due to miptrees not walking the same direction for all LODs.
* | Merge branch 'mesa_7_7_branch'Brian Paul2009-12-111-4/+1
|\| | | | | | | | | | | Conflicts: src/gallium/state_trackers/xorg/xorg_xv.c src/mesa/drivers/dri/intel/intel_span.c
| * intel: Remove ARGB internal_format == GL_RGB hacksIan Romanick2009-12-101-4/+1
| | | | | | | | | | Now that XRGB is supported, we don't need to hack around cases of an RGBA format buffer with an internal format of GL_RGB.
* | intel: Remove our special color packing macros and just use colormac.h.Eric Anholt2009-11-191-8/+9
|/
* intel: update intel_create_renderbuffer(format), add XRGB supportBrian Paul2009-10-291-0/+2
| | | | | | | | Pass a gl_format to intel_create_renderbuffer() instead of GLenum. Add cases for MESA_FORMAT_XRGB8888 textures and renderbuffers. However, we don't yet create any renderbuffers or textures with that format. It seems the default alpha value is zero instead of one. Need to investigate that first.
* i915: Fix 1D texture mapping in the t coordinate.Eric Anholt2009-10-291-0/+6
| | | | Fixes piglit tex1d-2dborder test.
* i915: Correct and make use of the defines for 32-bit depth texture modes.Eric Anholt2009-10-291-1/+6
| | | | | Previously, S8_Z24 depth textures would always be treated as intensity. Fixes piglit depth-tex-modes.
* i915: Implement min/max LOD clamping with the hardware.Eric Anholt2009-10-291-4/+8
| | | | | | | This gets us expected behavior for clamping between mipmap levels, and avoids relayout of textures for doing clamping. Fixes piglit lodclamp-between.
* Merge branch 'texformat-rework'Brian Paul2009-10-281-5/+4
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * i915: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24Brian Paul2009-10-211-2/+2
| | | | | | | | And change parameter type.
| * mesa: remove a bunch of gl_renderbuffer fieldsBrian Paul2009-10-081-1/+1
| | | | | | | | | | | | _ActualFormat is replaced by Format (MESA_FORMAT_x). ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are all replaced by MESA_FORMAT_x queries.
| * drivers: don't include texformat.hBrian Paul2009-10-051-1/+0
| | | | | | | | And remove other unneeded #includes while we're at it.
| * mesa: replace gl_texture_format with gl_formatBrian Paul2009-09-301-3/+3
| | | | | | | | | | | | 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.
* | i915: Fix driver for the miptree x/y offset changes.Eric Anholt2009-10-271-2/+10
| | | | | | | | Bug #24734.
* | intel: pass zslice to intel_miptree_image_offset()Brian Paul2009-10-121-3/+2
|/ | | | | This lets us get rid of intel_miptree_depth_offsets() and simplify all of the calling code.
* i915: Don't rely on fence regs when we don't have to.Eric Anholt2009-06-041-2/+7
| | | | | We're on the way to telling the kernel about when we need fence regs on our objects or not, and this will cut the number of places needing them.
* i915: fix fix for anisotropic filteringRoland Scheidegger2009-04-231-2/+7
| | | | forgot to commit the changes to actually support 4x aniso filtering...
* dri: use BorderColor instead of _BorderChanBrian Paul2009-04-011-8/+14
|
* Fix DRI2 accelerated EXT_texture_from_pixmap with GL_RGB format.Eric Anholt2009-03-201-3/+8
| | | | | | | | | | | | | | This requires upgrading the interface so that the argument to glXBindTexImageEXT isn't just dropped on the floor. Note that this only fixes the accelerated path on Intel, as Mesa's texture format support is missing x8r8g8b8 support (right now, GL_RGB textures get uploaded as a8r8gb8, but in this case we're not doing the upload so we can't really work around it that way). Fixes bugs with compositors trying to use shaders that use alpha channels, on windows without a valid alpha channel. Bug #19910 and likely others as well. Reviewed-by: Ian Romanick <[email protected]>
* i915: check WRAP_T instead of WRAP_R for cube map texture.Xiang, Haihao2008-12-181-1/+1
|
* i915: fallback for cube map texture.Xiang, Haihao2008-12-111-0/+7
| | | | | | | The i915 (and related graphics cores) only support TEXCOORDMODE_CLAMP and TEXCOORDMODE_CUBE when using cube map texture coordinates, so fall back to software rendering for other modes to avoid potential gpu hang issue. This fixes scorched3d issue on 945GM(see bug 14539).
* i915: Accelerate depth textures with border color.Eric Anholt2008-10-081-4/+15
| | | | | The fallback was introduced to fix bug #16697, but made the test it was fixing run excessively long.
* mesa: added "main/" prefix to includes, remove some -I paths from ↵Brian Paul2008-09-181-3/+3
| | | | Makefile.template
* intel: track bufmgr move to libdrm_intel and bufmgr_fake irq emit/wait change.Eric Anholt2008-09-101-1/+0
|
* intel: Fix depth_stencil texture.Xiang, Haihao2008-09-041-1/+1
|