summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* draw: implement distance cullingZack Rusin2013-06-108-31/+198
| | | | | | | | | | | Works similarly to clip distance. If the cull distance is negative for all vertices against a specific plane then the primitive is culled. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add a cull distance semanticZack Rusin2013-06-105-2/+20
| | | | | | | | | | | | | cull distance is analogous to clip distance. If a register is given this semantic, then the values in it are assumed to be a float32 distance to a plane. Primitives will be completely discarded if the plane distance for all of the vertices in the primitive are < 0. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: fix clipper invocation statisticsZack Rusin2013-06-105-6/+33
| | | | | | | | | | | | | We need to figure out the number of invocations of the clipper before the emit, because in the emit we are after clipping where the number of primitives will be equal to number of clipper invocations minus the clipped primitives. So our computations were always off by the number of clipped primitives. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: enable user plane clipping when clipdistance is usedZack Rusin2013-06-102-7/+20
| | | | | | | | | | | | | | | | | Draw depended on clip_plane_enable being set in the rasterizer to use clipdistance registers for clipping. That's really unfriendly because it requires that rasterizer state to have variants for every shader out there. Instead of depending on the rasterizer lets extract the info from the available state: if a shader writes clipdistance then we need to use it and we need to clip using a number of planes equal to the number of writen clipdistance components. This way clipdistances just work. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* draw: make sure clipdistances work with geometry shadersZack Rusin2013-06-106-2/+22
| | | | | | | | | | | we were always fetching the info from the vertex shader, but if geometry shader is present it should be used as the source of that info. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* Revert "i965: Disable unused pipeline stages once at startup on Gen7+."Kenneth Graunke2013-06-113-6/+13
| | | | | | | | | | This reverts commit 6c966ccf07bcaf64fba1a9b699440c30dc96e732. Apparently causes GPU hangs. Conflicts: src/mesa/drivers/dri/i965/brw_state.h src/mesa/drivers/dri/i965/brw_state_upload.c
* swrast: add texfetch code for some XBGR formatsBrian Paul2013-06-112-9/+46
| | | | | | | | | | Fixes piglit texture-packed-formats regression. We need to implement more XBGR formats here eventually, but many are UINT/SINT formats which swrast doesn't handle yet anyway (integer textures). Bugzilla https://bugs.freedesktop.org/show_bug.cgi?id=64935 Reviewed-by: Jose Fonseca <[email protected]>
* mesa: add missing texture strings in tex_target_name()Brian Paul2013-06-101-0/+5
| | | | And add a static assert for the future.
* winsys/radeon: add env var to disable VM on Cayman/TrinityAlex Deucher2013-06-101-0/+2
| | | | | | | | | | | Set env var RADEON_VA=0 to disable VM on Cayman/Trinity. Useful for debugging. Note: this is a candidate for the 9.1 branch. Signed-off-by: Alex Deucher <[email protected]> Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add a _mesa_problem to document a piglit failure on i965.Eric Anholt2013-06-101-0/+6
| | | | | | | | | Having figured out what was going on with piglit fbo-depth copypixels GL_DEPTH_COMPONENT32F (falling all the way back to swrast on CopyPixels to a float depth buffer), I'm not inclined to fix the problem currently but it seems worth saving someone else the debug time. Reviewed-by: Matt Turner <[email protected]>
* i965/vs: Avoid the MUL/MACH/MOV sequence for small integer multiplies.Eric Anholt2013-06-101-13/+37
| | | | | | | | | | | | | | | We do a lot of multiplies by 3 or 4 for skinning shaders, and we can avoid the sequence if we just move them into the right argument of the MUL. On pre-IVB, this means reliably putting a constant in a position where it can't be constant folded, but that's still better than MUL/MACH/MOV. Improves GLB 2.7 trex performance by 0.788648% +/- 0.23865% (n=29/30) v2: Fix test for pre-sandybridge. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> (v1)
* i965/vs: Allow copy propagation into MUL/MACH.Eric Anholt2013-06-101-2/+4
| | | | | | | | | | | This is a trivial port of 1d6ead38042cc0d1e667d8ff55937c1e32d108b1 from the FS. No significant performance difference on trex (misplaced the data, but it was about n=20). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/vs: Use the MAD instruction when possible.Eric Anholt2013-06-104-0/+43
| | | | | | | | | | | | | | This is different from how we do it in the FS - we are using MAD even when some of the args are constants, because with the relatively unrestrained ability to schedule a MOV to prepare a temporary with that data, we can get lower latency for the sequence of instructions. No significant performance difference on GLB2.7 trex (n=33/34), though it doesn't have that many MADs. I noticed MAD opportunities while reading the code for the DOTA2 bug. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* draw: Add A8R8G8B8 to draw_print_arraysRichard Sandiford2013-06-101-0/+7
| | | | | Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Richard Sandiford <[email protected]>
* draw: Fix type mismatch between draw_private.h and LLVMRichard Sandiford2013-06-101-1/+1
| | | | | | | | | | | | | | | draw_vertex_buffer declared the size field to be a size_t, but the LLVM code used an int32 instead. This caused problems on big-endian 64-bit targets, because the first 32-bit chunk of the 64-bit size_t was always 0. In one sense size_t seems like a good choice for a size, so one fix would have been to try to get the LLVM code to use the equivalent of size_t too. However, in practice, the size is taken from things like ~0 or width0, both of which are int-sized, so it seemed simpler to make the size field int-sized as well. Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Richard Sandiford <[email protected]>
* util: Use sizeof(void *) rather than 0 as the fallback cache line sizeRichard Sandiford2013-06-101-0/+5
| | | | | | | | Without this, llvmpipe ends up giving a zero size to all uncompressed textures on non-x86 systems, since align() cannot handle a 0 alignment. Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Richard Sandiford <[email protected]>
* llvmpipe: Use saturating add/sub for UNORM formatsRichard Sandiford2013-06-101-0/+8
| | | | | | | | | | | | | | | | | | lp_build_add and lp_build_sub have fallback code for cases that cannot be handled by known intrinsics. For UNORM formats, this code was using modulo rather than saturating arithmetic. This fixes some rendering issues for a gnome session on System z. It also fixes various piglit tests on z, such as spec/ARB_color_buffer_float/GL_RGBA8-render. The patch deliberately doesn't tackle the more complicated SNORM case. Tested against piglit on x86_64 and System z with no regressions. Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Richard Sandiford <[email protected]>
* intel: Reserve less batchbuffer space.Kenneth Graunke2013-06-101-4/+3
| | | | | | | | | | | | | | | Now that Gen6+ relies on hardware contexts, we don't need to record an occlusion query value at the end of each batch. That means we no longer need to reserve space for the absurd number of PIPE_CONTROLs required to do that on Sandybridge. See commit 4e087de51ad0e7ba4a7199d3664e1d096f8dc510, which bumped this up to 60 bytes. This is not quite a revert, as it uses 24 bytes instead of 16, and saves the comments. As far as I can tell, the old value of 16 bytes was just wrong, so we shouldn't go back to that. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Allocate push constant L3 space once at startup on Gen7+.Kenneth Graunke2013-06-104-12/+4
| | | | | | | | | | | We always allocate the maximum amount of space and never change it, so it makes sense to do it once. Programming it on startup also lets us skip re-programming it from BLORP. This removes a tiny amount of overhead from our drawing loop. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Disable unused pipeline stages once at startup on Gen7+.Kenneth Graunke2013-06-103-13/+9
| | | | | | | This removes a tiny bit of code from our drawing loop. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Don't emit PIPELINE_SELECT from BLORP.Kenneth Graunke2013-06-101-19/+0
| | | | | | | | | | | Now that we emit invariant state at startup (and never select the media pipeline), the 3D pipeline will always already be selected, even if BLORP is the first operation. So this is unnecessary. v2: Fix unused variable warning (intel_context is no longer used). Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Emit invariant state once at startup on Gen6+.Kenneth Graunke2013-06-103-4/+20
| | | | | | | | | | | Now that we have hardware contexts, we can safely initialize our GPU state once at startup, rather than needing a state atom with the BRW_NEW_CONTEXT flag set. This removes a tiny bit of code from our drawing loop. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Delete some dead state atom prototypes.Kenneth Graunke2013-06-101-9/+0
| | | | | | | These atoms don't actually exist. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Change return type of check_state() to bool.Kenneth Graunke2013-06-101-2/+2
| | | | | | | The existing code already returned a boolean; this just clarifies that. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Remove unused second parameter of brw_print_dirty_count().Kenneth Graunke2013-06-101-4/+4
| | | | | Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Allow the use of determinant() in GLSL 1.50.Kenneth Graunke2013-06-101-0/+4
| | | | | | | | | | We already implemented this for ES3, so we just need to turn it on. Fixes 6 Piglit tests: spec/glsl-1.50/compiler/built-in-functions/determinant-mat[234].{vert,frag} Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glcpp: Automatically #define GL_core_profile 1 on GLSL 1.50+.Kenneth Graunke2013-06-101-0/+3
| | | | | | | | | | Page 17 of the GLSL 1.50.11 specification states: "There is a built-in macro definition for each profile the implementation supports. All implementations provide the following macro: Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Parse "#version 150 core" directives.Kenneth Graunke2013-06-101-0/+13
| | | | | | | | | | Previously we only supported "#version 150". This patch recognizes "compatibility" to give the user a more descriptive error message. Fixes Piglit's version-150-core-profile test. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Bail on parsing if the #version directive is bogus.Kenneth Graunke2013-06-101-0/+6
| | | | | | | | | | | | | | | | | | | If we didn't successfully parse the #version line, there's no point in continuing with parsing and compiling: it's already failed. Furthermore, it can actually be harmful: right after handling #version, we call _mesa_glsl_initialize_types(), which checks state->es_shader and language_version. If it isn't valid, it hits an assertion failure. Fixes Piglit's "invalid-version-es." When processing "#version 110 es", our code set state->es_shader and state->language_version = 110. It then properly determined that this was invalid and flagged an error. Since we continued anyway, we hit the assertion mentioned above. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* dlist: fix save_SamplerParameteriChris Forbes2013-06-091-1/+1
| | | | | | | | | | This was building the temporary array to pass to save_SamplerParameteriv, and then not passing it. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Vinson Lee <[email protected]> Signed-off-by: Vinson Lee <[email protected]>
* mesa: Prevent possible out-of-bounds read by save_SamplerParameteriv.Vinson Lee2013-06-081-1/+4
| | | | | | | Fixes "Out-of-bounds access" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nvc0: fix up video buffer alignment requirementsMaarten Lankhorst2013-06-081-5/+3
| | | | Signed-off-by: Maarten Lankhorst <[email protected]>
* freedreno: better scissor fixRob Clark2013-06-085-28/+43
| | | | | | Actually respect rasterizer state. Signed-off-by: Rob Clark <[email protected]>
* freedreno: gmem bypassRob Clark2013-06-087-30/+168
| | | | | | | | | | | | | The GPU (at least a3xx, but I think also a2xx) can render directly to memory, bypassing tiling. Although it can't do this if blend, depth, and a few other features of the pipeline are enabled. This direct memory mode can be faster for some sorts of operations, such as simple blits. In particular, this significantly speeds up XA by avoiding to pull the entire dest pixmap into GMEM, render tiles, and write it all back out again. This should also speed up resource copy-region and blit. Signed-off-by: Rob Clark <[email protected]>
* freedreno: add a3xx supportRob Clark2013-06-0835-3/+8955
| | | | | | | | | | | | | | | | | | | | The adreno a3xx GPU is found in newer snapdragon devices, such as the nexus4. The a3xx is GLESv3 and OpenCL capable, although that is not enabled yet in gallium. Compared to a2xx, it introduces an entirely new unified shader ISA, and re-shuffles all or nearly all of the registers. The good news is that (for the most part) the registers are more orthogonal, not combining unrelated state in a single register. And that there is a lot more flexibility, so we don't need to patch and re-emit the shader like we did on a2xx. The shader compiler is currently quite dumb, there would be a lot of room for improvement with an optimizing pass. Despite that, with the a320 in my nexus4 it seems to be ~2-3x faster compared to the a220 in my HP touchpad. Signed-off-by: Rob Clark <[email protected]>
* freedreno: prepare for a3xxRob Clark2013-06-0849-2008/+2798
| | | | | | | | Split the parts that are specific to adreno a2xx series GPUs from the parts that will be in common with a3xx, so that a3xx support can be added more cleanly. Signed-off-by: Rob Clark <[email protected]>
* gallivm: work around slow code generated for interleaving 128bit vectorsRoland Scheidegger2013-06-081-0/+22
| | | | | | | | | | | | | | | We use 128bit vector interleave for untwiddling in the blend code (with 256bit vectors). llvm generates terrible code for this for some reason, so instead of generating a shuffle for 2 128bit vectors use a extract/insert shuffle instead (it only seems to matter we're not using 128bit wide vectors for the shuffle). This decreases instruction count of the blend code generated for a rgba8 render target without blending from 169 to 113 with llvm 3.1 and from 136 to 114 in llvm 3.2/3.3, and I got a ~8% (llvm 3.1) and ~5% (3.2/3.3) performance improvement in gears. (The generated code is still not terribly good as we could actually avoid the interleaving completely but llvm can't know this.) Reviewed-by: Jose Fonseca <[email protected]>
* st/xlib: Flush the front buffer before doing CopySubBufferStéphane Marchesin2013-06-071-0/+4
| | | | | | | | | We flush pending rendering before running CopySubBuffer, which ensures that the right bits get to the screen. NOTE: This is a candidate for stable release branches. Reviewed-by: Brian Paul <[email protected]>
* st/xlib: Fix upside down coordinates for CopySubBufferStéphane Marchesin2013-06-071-1/+1
| | | | | | | | The coordinates need to be inverted between glX and gallium. NOTE: This is a candidate for stable release branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: Report core FBO incompleteness cases through GL_ARB_debug_output.Eric Anholt2013-06-071-18/+25
| | | | | | | | | | | | | Just like we produce from inside the Intel driver, this can help provide information quickly about FBO incompatibility problems (particularly when using apitrace replay). Currently, in driver-marked incompleteness cases, you'll get both the driver message and the core message on Intel. Until the other drivers are fixed to produce output, I think this is better than not putting in a message for driver-marked incomplete. Reviewed-by: Brian Paul <[email protected]>
* intel: flush fake front buffer if server is about to destroy it.Paul Berry2013-06-071-0/+9
| | | | | | Fixes piglit test "spec/!OpenGL 1.0/gl-1.0-front-invalidate-back" Reviewed-by: Anuj Phogat <[email protected]>
* intel: flush fake front buffer more robustly.Paul Berry2013-06-071-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | When a fake front buffer is in use, if we request the front buffer (using screen->dri2.loader->getBuffersWithFormat()), the X server copies the real front buffer to the fake front buffer and returns the fake front buffer. We sometimes make redundant requests for the front buffer (due to using a single counter to track invalidates for both the front and back buffers), so there's a danger of pending front buffer rendering getting overwritten when the redundant front buffer request occurs. Previous to this patch, intel_update_renderbuffers() worked around that problem by sometimes doing intel_flush() and intel_flush_front() before calling intel_query_dri2_buffers(). But it only did the workaround when the front buffer was bound for drawing; it didn't do it when the front buffer was bound for reading. This patch moves the workaround code to intel_query_dri2_buffers(), so that it happens in exactly the circumstances where it is needed. This should fix some of the sporadic failures in Piglit tests fbo-sys-blit and fbo-sys-sub-blit. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* intel: make intel_flush_front safe to call during initial MakeCurrentPaul Berry2013-06-071-1/+1
| | | | | | | | | | | | | | The patch that follows will fix a bug that prevents intel_flush_front() from being called often enough. In doing so, it will create a situation where intel_flush_front() is called during the initial call to glXMakeCurrent(). In this circumstance, ctx->DrawBuffer hasn't been initialized yet and is NULL. Fortunately, intel->front_buffer_dirty is false, so intel_flush_front() doesn't actually need to do anything. To avoid a segfault, swap the order of terms in intel_flush_front()'s if statement. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Expose MAX_FRAGMENT_INPUT_COMPONENTS on ES3 and desktop 3.2.Eric Anholt2013-06-072-0/+10
| | | | | | | | | piglit OpenGL ES 3.0/minmax now passes. This was also one of the subcase failures in OpenGL 3.2/minmax (and still is, because our value is too low for 3.2, but at least we report what it is). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Expose texture array getters on GLES3.Eric Anholt2013-06-072-2/+10
| | | | | | | | | Part of fixing piglit OpenGL ES 3.0/minmax. v2: s/_gles3/_es3/ in extra name, for consistency (review by Matt). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* mesa: Fix the return value of TEXTURE_BINDING_2D_ARRAY.Eric Anholt2013-06-071-1/+1
| | | | | | | Noticed by inspection when reviewing the next commit. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Expose texel offset limits in GLES3.Eric Anholt2013-06-072-5/+6
| | | | | | | | | Part of fixing piglit OpenGL ES 3.0/minmax. v2: s/_gles3/_es3/ in extra name, for consistency (review by Matt). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* util: add comment about bogus transfer flagsRoland Scheidegger2013-06-071-0/+1
|
* util: fix util_clear_render_target and util_clear_depth_stencil layer handlingRoland Scheidegger2013-06-071-87/+103
| | | | | | | These functions must clear all bound layers, not just the first. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: move create_surface/destroy_surface functions to lp_surface.cRoland Scheidegger2013-06-072-59/+59
| | | | | | | Believe it or not but these two are actually the first two functions which really belong in this file nowadays. Reviewed-by: Brian Paul <[email protected]>