aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* intel: Remove redundant GL_ARB_window_pos enableIan Romanick2011-09-261-1/+0
| | | | | | | | This extension is enabled by default in _mesa_init_extensions, so drivers don't need to enable it again. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri: Remove redundant GL_SGIS_texture_edge_clamp enablesIan Romanick2011-09-265-5/+0
| | | | | | | | This extension is enabled by default in _mesa_init_extensions, so drivers don't need to enable it again. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Emit depth stalls and flushes before changing depth state on Gen6+.Kenneth Graunke2011-09-263-1/+44
| | | | | | | | | | | | Fixes OpenArena on Gen7. Technically, adding only the first depth stall fixes it, but the documentation says to do all three, and the Windows driver seems to do it. Not observed to fix anything on Gen6 yet. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Introduce a new intel_context::gt field to go along with gen.Kenneth Graunke2011-09-263-3/+11
| | | | | | | | | | It seems that GT1/GT2 sorts of variations are here to stay, and more special cases will likely be required in the future. Checking by PCI ID via the IS_xxx_GTx macros is cumbersome; introducing a new 'gt' field analogous to intel->gen will make this easier. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Remove intel_context::has_xrgb_textures/has_luminance_srgb.Kenneth Graunke2011-09-262-28/+13
| | | | | | | | | | | | | Seeing as they were only used once (in the same function they were defined), having them as context members seemed rather pointless. Remove them entirely (rather than using local variables) since the chipset generation checks are actually just as straightforward. While we're at it, clean up the remainder of the if-tree that set them. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix incorrect maximum PS thread count shift on Ivybridge.Kenneth Graunke2011-09-261-1/+1
| | | | | | | | | | | | | | At one point, the documentation said that max thread count in 3DSTATE_PS was at bit offset 23, but it's actually 24 on Ivybridge. Not only did this halve our thread count, it caused us to write 1 into a bit 23, which is marked as MBZ (must be zero). Furthermore, it made us write an even number into this field, which is apparently not allowed. Apparently we were just lucky it worked. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: fix potential segfault error at intel_(un)map_texture_imageYuanhan Liu2011-09-261-2/+3
| | | | | | | | | intel_image->mt might be NULL, say with border width set. It then would trigger a segfault at intel_map/unmap_texture_image function. This would fix the oglc misctest(basic.textureBorderIgnore) fail. Signed-off-by: Yuanhan Liu <[email protected]>
* mesa: Also set the remaining draw buffers to GL_NONE when updating just the ↵Henri Verbeet2011-09-251-15/+14
| | | | | | | | | | | | | | | | | first buffer in _mesa_drawbuffers(). Without this we'd miss the last update in a sequence like {COLOR0, COLOR1}, {COLOR0}, {COLOR0, COLOR1}. I originally had a patch for this that called updated_drawbuffers() when the buffer count changed, but later realized that was wrong. The ARB_draw_buffers spec explicitly says "The draw buffer for output colors beyond <n> is set to NONE.", and this is queryable state. This fixes piglit arb_draw_buffers-state_change. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* intel: Remove pointless boolean return value from *_miptree_layout.Kenneth Graunke2011-09-234-24/+11
| | | | | | | | | | i915_miptree_layout, i945_miptree_layout, and brw_miptree_layout always just return GL_TRUE, so there's really no point to it. Change them to void functions and remove the (dead) error checking code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Increase MaxClipPlanes to 8 for gen6+.Paul Berry2011-09-231-0/+3
| | | | | | This is necessary for GLSL 1.30 compliance. Reviewed-by: Eric Anholt <[email protected]>
* i965: Allow clip distances to be read back in fragment shaders.Paul Berry2011-09-232-6/+2
| | | | | | | | | | | | | | | | | | | | | | Previously, we conditionally set up the SF pipline stage with a urb_entry_read_offset of 2 when clipping was in use, and 1 otherwise, causing the clip distance VUE slots to be skipped if present. This was an extremely minor savings (it saved the SF unit from reading 2 vec4s out of the URB, but it didn't affect any computation, since we only instruct the SF unit to perform interpolation on VUE slots that are actually used by the fragment shader). GLSL 1.30 requires an interpolated version of gl_ClipDistance to be available for reading in the fragment shader, so we need the SF's urb_entry_read_offset to be 1 when the fragment shader reads from gl_ClipDistance. This patch just unconditionally sets the urb_entry_read_offset to 1 in all cases; this is sufficient to make gl_ClipDistance available to the fragment shader when it is needed, and the performance loss should be negligible when it isn't. Reviewed-by: Eric Anholt <[email protected]>
* i965: Set up clip distance VUE slots appropriately for gl_ClipDistance.Paul Berry2011-09-234-27/+32
| | | | | | | | | | | | | | | When gl_ClipDistance is in use, the contents of the gl_ClipDistance array just need to be copied directly into the clip distance VUE slots, so we re-use the code that copies all other generic VUE slots (this has been extracted to its own method). When gl_ClipDistance is not in use, the vertex shader needs to calculate the clip distances based on user-specified clipping planes. This patch also removes the i965-specific enum values BRW_VERT_RESULT_CLIP[01], since we now have generic Mesa enums that serve the same purpose (VERT_RESULT_CLIP_DIST[01]). Reviewed-by: Eric Anholt <[email protected]>
* i965: Don't upload clip planes when gl_ClipDistance is in use.Paul Berry2011-09-234-7/+12
| | | | | | | | When the vertex shader writes to gl_ClipDistance, we do clipping based on clip distances rather than user clip planes, so don't waste push constant space storing user clip planes that won't be used. Reviewed-by: Eric Anholt <[email protected]>
* i965: Enable lower_clip_distance.Paul Berry2011-09-231-0/+1
| | | | | | | | i965 requires gl_ClipDistance to be formatted as an array of 2 vec4's (as opposed to an array of 8 floats), so enable the lowering pass that performs this conversion. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().Paul Berry2011-09-231-6/+8
| | | | | | | | | | | | | In order to support 8 clip distances, we need to properly decode when the user sets the GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7 enable flags. For clarity, this patch changes the names GL_CLIP_PLANE[0-5] in the switch statement to the equivalent names GL_CLIP_DISTANCE[0-5], since the GL_CLIP_PLANE names are deprecated. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.Paul Berry2011-09-231-6/+10
| | | | | | | | | | | | This patch assigns enumerated values for gl_ClipDistance in the gl_vert_result and gl_frag_attrib enums, so that driver back-ends can assign gl_ClipDistance to the appropriate hardware registers. It also adjusts the functions _mesa_vert_result_to_frag_attrib() and _mesa_frag_attrib_to_vert_result() (which translate between the two enums) to correctly translate the new enumerated values. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: Add a flag to indicate whether a program uses gl_ClipDistance.Paul Berry2011-09-232-0/+8
| | | | | | | | | | | | | | | | | | GLSL 1.30 requires us to use gl_ClipDistance for clipping if the vertex shader contains a static write to it, and otherwise use user-defined clipping planes. Since the driver needs to behave differently in these two cases, we need a flag to record whether the shader has written to gl_ClipDistance. The new flag is called UsesClipDistance. We initially store it in gl_shader_program (since that is the data structure that is available when we check to see whethe gl_ClipDistance was written to), and we later copy it to a flag with the same name in gl_vertex_program, since that is a more convenient place for the driver to access it (in i965, at least). Reviewed-by: Eric Anholt <[email protected]> Tested-by: Brian Paul <[email protected]>
* glsl: Implement a lowering pass for gl_ClipDistance.Paul Berry2011-09-231-0/+1
| | | | | | | | | | | | | | | | | | | In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance needs to be laid out as a pair of vec4's (the first containing clip distances 0-3, and the second containing clip distances 4-7). However, it is declared in GLSL as an array of 8 floats. This lowering pass acts at the GLSL level, modifying the declaration of gl_ClipDistance so that it is an array of vec4's rather than an array of floats, and renaming it to gl_ClipDistanceMESA. In addition, it modifies all accesses to the array so that they access the appropiate component of one of the vec4's. Since some hardware may not internally represent gl_ClipDistance as a pair of vec4's, this lowering pass is optional. To enable it, set the LowerClipDistance flag in gl_shader_compiler_options to true. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing includes to meta.hChad Versace2011-09-231-0/+2
| | | | | | Include mtypes.h. Signed-off-by: Chad Versace <[email protected]>
* intel: fix the wrong code to detect null texture.Yuanhan Liu2011-09-231-1/+1
| | | | | | | | | | | | There is already comments show how to detect a null texture. Fix the code to match the comments. This would fix the oglc divzero(basic.texQOrWEqualsZero) and divzero(basic.texTrivialPrim) test case fail. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: fix the constant interp bitmask for flat modeYuanhan Liu2011-09-232-12/+26
| | | | | | | | | | | | | | | Fix the constant interpolation enable bit mask for flat light mode. FRAG_BIT_COL0 attribute bit might be 0, in which case we need to shift one more bit right. This would fix the oglc specularColor test fail on both Sandybridge and Ivybridge. v2: move the constant interp bitmask setup code into for(; attr < FRAG_ATTRIB_MAX; attr++) loop suggested by Eric. Signed-off-by: Yuanhan Liu <[email protected]> Signed-off-by: Xiang, Haihao <[email protected]>
* st/mesa: remove unnecessary st_texture_match_image() parametersBrian Paul2011-09-223-11/+7
| | | | | We didn't use the face parameter and the level parameter can be found in the gl_texture_image.
* intel: Unindent the blit call in PBO blit uploads.Eric Anholt2011-09-221-17/+12
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Drop gratuitous flush in PBO blit upload.Eric Anholt2011-09-221-3/+0
| | | | | | | | Since the blit gets sequenced after other batchbuffer rendering like normal, there's no need to push things out early. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Clean up check_pbo_format to ignore internalFormat.Eric Anholt2011-09-221-25/+13
| | | | | | | | | | All that matters here is the format of the texture, not the internalformat (which might mean various different pixel formats). In one case, the pbo upload for MESA_FORMAT_YCBCR would have swapped the channels for MESA_FORMAT_YCBCR_REV. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Move more of the PBO blit upload logic into that function.Eric Anholt2011-09-221-26/+33
| | | | | | | | | This also improves the debugging output in the failure paths so you get more than just "failed", and don't get spammed with "failed" when you didn't even have a PBO to try. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove stale comment about non-intel gl_buffer_objects.Eric Anholt2011-09-221-8/+1
| | | | | | | | This hasn't been true since dd26899ca39111e0866afed9df94bfb1618dd363 in 2009. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove the pbo zero-copy code.Eric Anholt2011-09-225-247/+0
| | | | | | | | | | | There were notes about the possibility of slowdowns due to zcopy from a PBO due to thrashing around of the region. Slowdowns are even more likely now that textures are generally tiled, which a zcopy wouldn't get. Additionally, there were no checks on the buffer size to ensure that the hardware-required rounding was present, which could result in GPU hangs on large zcopy PBOs. Reviewed-by: Ian Romanick <[email protected]>
* intel: Remove extra FreeTextureImageBuffer() from glTexImage*.Eric Anholt2011-09-221-1/+0
| | | | | | | The core code does this before calling in to us. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Add support for GL_EXT_packed_float.Eric Anholt2011-09-223-0/+5
| | | | | | | | | | | This doesn't cover support for this format as a renderbuffer yet. The spec allows implementations to not support it, though it is something we do want to support. Only one failure in piglit on gen6, which is texwrap with bordercolor (as usual). Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add support for GL_EXT_texture_shared_exponent.Eric Anholt2011-09-223-0/+5
| | | | | | | Only one failure in piglit on gen6, which is texwrap with bordercolor (as usual). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove support for GL_APPLE_client_storage extensionBrian Paul2011-09-228-18/+2
| | | | | | | AFAIK, there are few users of this extension and I can see a couple reasons why this is probably broken in Mesa anyway. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move gl_texture_image::Width/Height/DepthScale fields to swrastBrian Paul2011-09-227-25/+30
| | | | | | | These fields were only used for swrast so move them into swrast_texture_image. Reviewed-by: Ian Romanick <[email protected]>
* mesa: move gl_texture_image::_IsPowerOfTwo into swrastBrian Paul2011-09-226-19/+32
| | | | | | It's only used by swrast. Reviewed-by: Ian Romanick <[email protected]>