summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965 new VS: Fix bugs in pre-GEN6 psiz/flags computationPaul Berry2011-09-281-5/+5
| | | | | | | | | | | | | | | | | | This patch corrects two errors in the computation of the psiz/flags VUE slot on pre-GEN5 when using the new VS backend: - The clip flags (which should be stored in the w component of the first VUE slot) were being accidentally duplicated in all other components of that VUE slot, causing partially clipped triangles to sometimes disappear completely. - The OR instruction wasn't being stored in "inst", causing the BRW_PREDICATE_NORMAL flag to be applied to the wrong instruction. This patch fixes regressions in clipping behavior when using shaders on GEN4-5. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 new VS: Fix src_reg(uint32_t) constructor.Paul Berry2011-09-281-1/+1
| | | | | | | | | This constructor was storing its argument in the wrong field of the "imm" enum, resulting in it being converted to a float when it should have remained an unsigned integer. This was preventing clipping from working properly on pre-GEN6. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 new VS: don't share clip plane constants in pre-GEN6Paul Berry2011-09-286-43/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | In pre-GEN6, when using clip planes, both the vertex shader and the clipper need access to the client-supplied clip planes, since the vertex shader needs them to set the clip flags, and the clipper needs them to determine where to insert new vertices. With the old VS backend, we used a clever optimization to avoid placing duplicate copies of these planes in the CURBE: we used the same block of memory for both the clipper and vertex shader constants, with the clip planes at the front of it, and then we instructed the clipper to read just the initial part of this block containing the clip planes. This optimization was tricky, of dubious value, and not completely working in the new VS backend, so I've removed it. Now, when using the new VS backend, separate parts of the CURBE are used for the clipper and the vertex shader. Note that this doesn't affect the number of push constants available to the vertex shader, it simply causes the CURBE to occupy a few more bytes of URB memory. The old VS backend is unaffected. GEN6+, which does clipping entirely in hardware, is also unaffected. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix a hardcoded user clip plane count.Paul Berry2011-09-281-1/+1
| | | | | | | | | Now that i965 supports 8 clip planes instead of 6, the size of the brw_vs_compile::userplane array needs to be increased to 8. Changed the array size to MAX_CLIP_PLANES so that if the number changes again in the future, this array size won't be missed. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: allow for nonconsecutive elements of gl_ClipDistance to be enabled.Paul Berry2011-09-283-4/+38
| | | | | | | | | | | | | | | | | | | | | | When using user-defined clipping planes, the i965 driver compacts the array of clipping planes so that disabled clipping planes do not appear in it--this saves precious push constant space and makes it easier to generate the pre-GEN6 clip program. As a result, when enabling clipping planes in GEN6+ hardware, we always enable clipping planes 0 through n-1 (where n is the number of clipping planes enabled), regardless of which clipping planes the user actually requested. However, we can't do this when using gl_ClipDistance, because it would be prohibitively complex to compact the gl_ClipDistance array inside the user-supplied vertex shader. So, when enabling clipping planes in GEN6+ hardware, if gl_ClipDistance is in use, we need to pass the user-supplied enable flags directly through to the hardware rather than just enabling the first n planes. Fixes Piglit test vs-clip-distance-enables. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use 4 bits to store nr_userclip in brw_clip.h.Paul Berry2011-09-281-2/+1
| | | | | | | | | | | | | | | Since the i965 driver supports 8 clipping planes now, we need 4 bits to store the number of user clipping planes, not 3. In theory this isn't strictly necessary, since brw_clip.h is only used on pre-GEN6, and pre-GEN6 only advertises support for 6 clipping planes, but it seems wise to err on the safe side. In the process I removed the pad0 element of struct brw_clip_prog_key--it doesn't seem necessary because the compiler automatically inserts padding if needed. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Remove unused function get_glsl_version()Chad Versace2011-09-281-16/+0
| | | | | | | | It was replaced by _mesa_override_glsl_version(). Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Allow overriding GLSL version with environment variableChad Versace2011-09-286-1/+31
| | | | | | | | | | | | | | Override the context's GLSL version if the environment variable MESA_GLSL_VERSION_OVERRIDE is set. Valid values for MESA_GLSL_VERSION_OVERRIDE are integers, such as "130". MESA_GLSL_VERSION_OVERRIDE has the same behavior as INTEL_GLSL_VERSION, except that it applies to all drivers, not just Intel's. Since the former supercedes the latter, this patch disables the latter. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* st/mesa: substitute argument to guess_base_level_size() callBrian Paul2011-09-281-1/+1
| | | | | stObj->base.BaseLevel and firstImage->base.Level have the same value but the later looks more consistent in the function call.
* mesa: fix signed/unsigned warning in sscanf()Brian Paul2011-09-281-1/+1
|
* scons: insert 'git-' into MESA_GIT_SHA1 stringBrian Paul2011-09-281-1/+1
| | | | To match makefile build.
* scons: fix write_git_sha1_h_file() issue on WindowsBrian Paul2011-09-281-0/+2
| | | | | Unlike on Unix, os.rename(src, dst) will fail on Windows if the dst file already exists. Remove it first.
* scons: generate git_sha1.h file as with Makefile buildBrian Paul2011-09-281-6/+35
| | | | | | So that GL_VERSION includes the git head hash id when building with scons. Reviewed-by: José Fonseca <[email protected]>
* i965: Allow SIMD16 color writes on Ivybridge.Kenneth Graunke2011-09-281-1/+1
| | | | | | | Again, the check was needlessly specific: this works fine on Gen7. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Allow SIMD16 with control flow on Ivybridge.Kenneth Graunke2011-09-281-1/+1
| | | | | | | | The check was designed to forbid it on old generations (Gen5/Ironlake), not on new ones. It just works on Gen7/Ivybridge. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Fix compiler warnings from the depth stall flush commit.Eric Anholt2011-09-271-0/+1
|
* radeon: Drop mapping we were doing around glGetTexImage().Eric Anholt2011-09-277-86/+0
| | | | It's handled by MapTextureImage() now.
* nouveau: Drop mapping we were doing around glGetTexImage().Eric Anholt2011-09-271-14/+0
| | | | It's handled by MapTextureImage() now.
* intel: Drop our custom glGetTexImage() code.Eric Anholt2011-09-272-63/+7
| | | | | | | | | The mesa core code uses MapTextureImage() like we need now. v2: Drop mapping around _mesa_generate_mipmap for compressed, since the whole path ends up going through MapTextureImage(), and the meta decompression code ended up causing us to lose track of the region that was originally mapped and assertion fail.
* mesa: Finally, convert RGBA glGetTexImage() to using MapTextureImage().Brian Paul2011-09-272-44/+38
| | | | | | | v2: Changes by Brian to MapTexImage in the decompression path. v3: Changes by anholt to fix srcRowStride for decompression of NPOT. Tested-by: Brian Paul <[email protected]> (v2)
* mesa: Convert depth glGetTexImage() to using MapTextureImage().Brian Paul2011-09-272-8/+14
| | | | Tested-by: Brian Paul <[email protected]>
* mesa: Convert depth/stencil glGetTexImage() to using MapTextureImage().Brian Paul2011-09-272-8/+21
| | | | | | | Note that the implementation before and after appears to be broken in its handling of Z24_S8 vs S8_Z24. Tested-by: Brian Paul <[email protected]>
* mesa: Switch ycbcr glGetTexImage() to using MapTextureImage().Brian Paul2011-09-271-5/+12
| | | | Tested-by: Brian Paul <[email protected]>
* mesa: Switch memcpy fast-path of glGetTexImage() to using MapTextureImage().Brian Paul2011-09-271-9/+15
| | | | Tested-by: Brian Paul <[email protected]>
* mesa: Update comments/assertions about buffer mapping for glGetTexImage().Brian Paul2011-09-271-4/+3
| | | | | | This code is about to stop needing ->Data and using MapTextureImage(). Tested-by: Brian Paul <[email protected]>
* mesa: Convert GetCompressedTexImage to using MapTextureImage().Brian Paul2011-09-276-129/+37
| | | | | | | This changes drivers to not map the texture on their own before calling _mesa_get_compressed_teximage(). Tested-by: Brian Paul <[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]>
* mesa: Allow override of GL version with environment variableChad Versace2011-09-271-0/+25
| | | | | | | | | | | | | It is necessary to manually set the GL version to 3.0 in order to run Piglit tests that use glGetUniform*(). This patch allows one to override the version of the OpenGL context by setting the environment variable MESA_GL_VERSION_OVERRIDE. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Make enable.c and get.c properly range check clip flags.Paul Berry2011-09-272-14/+56
| | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to commit 2d686fe911a89fa477ee3848da41ebfb100500bf, which added decoding of GL_CLIP_DISTANCE[67] to the _mesa_set_enable() function. This patch makes the following additional fixes: - Uses GL_CLIP_DISTANCEi enums consistently within enable.c rather than the deprecated GL_CLIP_PLANEi enums. - Generates an error if the user tries to access a clip flag that is unsupported by the hardware. - Applies the same change to _mesa_IsEnabled(), so that querying clip flags using glIsEnabled() works properly. - Applies corresponding changes to get.c, so that querying clip flags using glGet*() works properly. Fixes piglit test clip-flag-behavior. Reviewed-by: Brian Paul <[email protected]>
* mesa: fix indentation in mipmap.c (3 spaces)Brian Paul2011-09-261-2/+2
|
* i965/vs: Fix access beyond array bounds for non-GRF operands.Eric Anholt2011-09-261-3/+3
| | | | | Caught by valgrind. I never saw a segfault from it (probably because it's hard to have much more of any other file than GRF).
* intel: Rename region->buffer to region->bo, and remove accessor function.Eric Anholt2011-09-2619-96/+73
| | | | | | | 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: Drop stale comment about CopyTexSubImage.Eric Anholt2011-09-261-4/+0
| | | | | | | We get called for TexImage higher up, and in a relatively normal way (pixels == NULL is common for FBO setup). Acked-by: Kenneth Graunke <[email protected]>
* intel: Rely on AllocTextureImageBuffer for our teximage fallbacks.Eric Anholt2011-09-261-19/+5
| | | | | | | It will do a more reliable job at getting the image size for _mesa_texstore right than us. Acked-by: Kenneth Graunke <[email protected]>
* intel: Rely on mesa core for compressed texture image uploading.Eric Anholt2011-09-261-58/+20
| | | | | | | | | There's nothing in our normal texture path we need for this. We don't PBO upload blit it. We don't need to worry about flushing because MapTextureImage handles it. hiz scattergather doesn't apply, but MTI handles it too. Acked-by: Kenneth Graunke <[email protected]>
* intel: Allow src == NULL and *dst != NULL in intel_miptree_reference().Eric Anholt2011-09-263-10/+11
| | | | | | | This makes this API consistent with intel_region_reference, and the consumers wanted it this way. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Drop the "intel" argument to intel_miptree_release().Eric Anholt2011-09-266-16/+10
| | | | | | | We don't have it in the other refcounting functions, and it was totally unused. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Drop the immediate validation of the texture object in TFP.Eric Anholt2011-09-261-10/+0
| | | | | | | | | It's totally gratuitous -- the image's miptree will be checked for binding to the object later, anyway, with zero-copy or blitting as appropriate. Tested-by: Kristian Høgsberg <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* intel: Fix improper freeing of texture data in TFP.Eric Anholt2011-09-261-4/+1
| | | | | | | | If there happened to be ->Data present, we assertion failed instead of handling it correctly. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35234 Acked-by: Kenneth Graunke <[email protected]>
* intel: Refactor texture_from_pixmap and EGL_image region binding.Eric Anholt2011-09-261-55/+49
| | | | | Tested-by: Kristian Høgsberg <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* intel: Drop some extra equality checks on reference/release functions.Eric Anholt2011-09-262-22/+8
| | | | | | | _mesa_reference_renderbuffer already short-circuits equality, and intel_miptree_release does nothing on NULL. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Set the pre/post-blend color clamp flags.Eric Anholt2011-09-261-0/+20
| | | | | | | No change in piglit results on gen6, but the spec demands it so let's do it. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Split generate_math into gen4/gen6 and 1/2 operand variants.Kenneth Graunke2011-09-262-54/+89
| | | | | | | | | | This mirrors the structure Eric used in the new VS backend, and seems simpler. In particular, the math1/math2 split will avoid having to figure out how many operands there are, as this is already known by the caller. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* swrast: always call _swrast_choose_texture_sample_func()Brian Paul2011-09-261-1/+1
| | | | | | _swrast_choose_texture_sample_func() handles null texture object pointers and will return the "null" sampler function which returns (0,0,0,1). This fixes a minor regression from ce82914f5ad4bb9148370826099925590e9798fd
* mesa: Remove EXT_abgr extension enable flagIan Romanick2011-09-262-3/+1
| | | | | | | | | | All drivers remaining in Mesa support this extension. This extension is required in desktop OpenGL. The existing support is already partially broken in Mesa (e.g., using format=GL_ABGR for glTexImage2D in OpenGL ES 2.x). This patch does not change the situation in any way. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove EXT_bgra and EXT_texture_format_BGRA8888 extension enable flagsIan Romanick2011-09-266-11/+9
| | | | | | | | | | | | | All drivers remaining in Mesa support this extension. This extension is either required or optional features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x. EXT_texture_format_BGRA8888 is mostly a subset of EXT_bgra. The only difference seems to be that EXT_texture_format_BGRA8888 allows GL_BGRA as an internal format to glTexImage2D and friends. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove OES_read_format extension enable flagIan Romanick2011-09-263-11/+3
| | | | | | | | | | | | This extension is always enabled, and drivers do not have to option to disable it. I kept this one separate from the others because I was a little uncertain about the changes to get.c. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: Remove all mention of EXT_vertex_array_setIan Romanick2011-09-262-2/+0
| | | | | | | | Mesa has never any portion of this extension, and neither has any other vendor. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix extension year for EXT_texture_env_combineIan Romanick2011-09-261-1/+1
| | | | | | | | | | The year 2006 apparently came from the "Last Modified Date" in the spec header. however, the revision history at the bottom say "2/22/00 mjk - added NVIDIA Implementation Details." From that we can safely infer that the spec is from at least 2000, and it may even be older. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove many extension enable flagsIan Romanick2011-09-267-94/+23
| | | | | | | | | | | | | | | | | | | | | | | | | The following extensions are always enabled, and drivers do not have to option to disable them: GL_ARB_multisample GL_ARB_texture_compression GL_ARB_vertex_buffer_object / GL_OES_mapbuffer GL_EXT_copy_texture GL_EXT_multi_draw_arrays / GL_SUN_multi_draw_arrays GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_texture_edge_clamp / GL_SGIS_texture_edge_clamp GL_EXT_vertex_array GL_SGIS_generate_mipmap This set was picked because the are all either required or optional features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x. The existing support for some is already partially broken in Mesa (e.g., proxy texture targets in OpenGL ES). This patch does not change the situation in any way. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>