summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-23Remove wrongly repeated words in commentsGiuseppe Bilotta46-54/+54
Clean up misrepetitions ('if if', 'the the' etc) found throughout the comments. This has been done manually, after grepping case-insensitively for duplicate if, is, the, then, do, for, an, plus a few other typos corrected in fly-by v2: * proper commit message and non-joke title; * replace two 'as is' followed by 'is' to 'as-is'. v3: * 'a integer' => 'an integer' and similar (originally spotted by Jason Ekstrand, I fixed a few other similar ones while at it) Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-06-23svga: update some comments in svga_buffer_handle()Brian Paul1-10/+3
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23svga: add a const qualifier in svga_buffer_upload_piecewise()Brian Paul1-1/+1
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23svga: minor code refactor for svga_buffer_upload_command()Brian Paul1-5/+21
Put the HBS code into a separate function. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23svga: minor code simplification in svga_context_finish()Brian Paul1-1/+1
Signed-off-by: Brian Paul <brianp@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23i965: Implement rasterizer discard via SOL unless required for queries.Kenneth Graunke2-0/+21
We currently use CL_INVOCATION_COUNT for the GL_PRIMITIVES_GENERATED query, which involves passing all primitives to the clipper. When rasterizer discard is enabled, we program the clipper in REJECT_ALL mode, rather than using the SOL stage's "Rendering Disable" feature. See commit f09b91f78247409f54c975f56cb10d5f350fe64e for an explanation of why we implement GL_PRIMITIVES_GENERATED this way. Apparently the SOL stage's "Rendering Disable" feature is a lot faster than having the clipper reject all primitives. It's safe to use when no GL_PRIMITIVES_GENERATED query is active, as we don't care about CL_INVOCATION_COUNT incrementing. This patch makes us use SO_RENDERING_DISABLE when no query is active, but continues falling back to the clipper in REJECT_ALL mode when the queries are enabled. It brings back the perf_debug for the clipper case (which I removed in commit 1f9445ff57b, thinking it wasn't useful). Improves performance in Gl32GSCloth by 84.8303% +/- 2.07132% (n = 10) on my Broadwell GT2 laptop. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-06-23i965: Combine 3DSTATE_STREAMOUT emitters and genX_sol_state atoms.Kenneth Graunke4-99/+37
They're basically the same. Let's avoid the code duplication. v2: Fix SO_BUFFER_ENABLE stuff to only happen on Gen < 8 (caught by Jason Ekstrand). Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-06-23glsl: Don't constant propagate arrays.Kenneth Graunke1-1/+1
Constant propagation on arrays doesn't make a lot of sense. If the array is only accessed with constant indexes, then opt_array_splitting would split it up. Otherwise, we have variable indexing. If there's multiple accesses, then constant propagation would end up replicating the data. The lower_const_arrays_to_uniforms pass creates uniforms for each ir_constant with array type that it encounters. This means that it creates redundant uniforms for each copy of the constant, which means uploading too much data. It can even mean exceeding the maximum number of uniform components, causing link failures. We could try and teach the pass to de-duplicate the data by hashing constants, but it makes more sense to avoid duplicating it in the first place. We should promote constant arrays to uniforms, then propagate the uniform access. Fixes the TressFX shaders from Tomb Raider, which exceeded the maximum number of uniform components by a huge margin and failed to link. On Broadwell: total instructions in shared programs: 9067702 -> 9068202 (0.01%) instructions in affected programs: 10335 -> 10835 (4.84%) helped: 10 (Hoard, Shadow of Mordor, Amnesia: The Dark Descent) HURT: 20 (Natural Selection 2) loops in affected programs: 4 -> 0 The hurt programs appear to no longer have a constarray uniform, as all constants were successfully propagated. Apparently before this patch, we successfully unrolled a loop containing array access, but only after promoting constant arrays to uniforms. With this patch, we unroll it first, so all array access is direct, and the array is split up, and individual constants are propagated. This seems better. Cc: mesa-stable@lists.freedesktop.org Reported-by: Karol Herbst <nouveau@karolherbst.de> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-06-23glsl: Make lower_const_arrays_to_uniforms work directly on constants.Kenneth Graunke1-8/+3
There's really no point in looking at ir_dereference_array of a constant. It also misses cases like: (assign () (var_ref tmp) (constant (array ...) ...)) No changes in shader-db, but keeps it working after the next commit. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-06-23i965: Copy propagate before doing variable index lowering.Kenneth Graunke1-0/+2
The scalar backend currently doesn't support variable indexing on temporary arrays, but it does support it on uniform arrays, and some stages support it for input arrays. Make sure these are propagated through before exploding indirects into piles of if-ladders unnecessarily. On Broadwell, no instruction count change in shader-db. total cycles in shared programs: 80675652 -> 80674928 (-0.00%) cycles in affected programs: 649972 -> 649248 (-0.11%) helped: 386 HURT: 165 This will help avoid code quality regressions in a future commit. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-06-23glsl: Propagate invariant/precise after lowering const arrays.Kenneth Graunke1-0/+1
The new uniform may need precise as well. Fixes copy propagation of constant array uniforms in Tomb Raider shaders. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-06-23glsl: Split arrays even in the presence of whole-array copies.Kenneth Graunke1-0/+55
Previously, we failed to split constant arrays. Code such as int[2] numbers = int[](1, 2); would generates a whole-array assignment: (assign () (var_ref numbers) (constant (array int 4) (constant int 1) (constant int 2))) opt_array_splitting generally tried to visit ir_dereference_array nodes, and avoid recursing into the inner ir_dereference_variable. So if it ever saw a ir_dereference_variable, it assumed this was a whole-array read and bailed. However, in the above case, there's no array deref, and we can totally handle it - we just have to "unroll" the assignment, creating assignments for each element. This was mitigated by the fact that we constant propagate whole arrays, so a dereference of a single component would usually get the desired single value anyway. However, I plan to stop doing that shortly; early experiments with disabling constant propagation of arrays revealed this shortcoming. This patch causes some arrays in Gl32GSCloth's geometry shaders to be split, which allows other optimizations to eliminate unused GS inputs. The VS then doesn't have to write them, which eliminates the entire VS (5 -> 2 instructions). It still renders correctly. No other change in shader-db. v2: Drop !AOA check and improve a comment (feedback from Tim Arceri). Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-06-23glsl: Make constant propagation's folder not propagate into an LHS.Kenneth Graunke1-1/+1
opt_constant_propagation.cpp contains constant folding code which can actually do constant propagation in some cases. It was happily propagating constants into the left-hand-side of assignments. For example, (assign () (var_ref temp) (constant ...)) would brilliantly be turned into: (assign () (constant ...) (constant ....)) This is a bigger hammer than necessary - it prevents propagation into the left-hand-side altogether. We could certainly do better someday. Notably, the constant propagation pass itself already takes this approach - it's just the constant propagation pass's built-in constant folding code (which actually propagates, too) that was broken. No change in shader-db, but prevents regressions after future commits. It seems plausible that this could be hit today, but I haven't seen it happen. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-06-23i965/blorp: Disable vertex element swizzlingTopi Pohjolainen2-4/+18
Without vertex elements originating directly from vertex fetcher are not passed to wm-state correctly. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-06-23i965/blorp: Let program data tell if push constants are neededTopi Pohjolainen3-15/+35
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-06-23i965/blorp: Use prog data counters to guide wm/ps setupTopi Pohjolainen3-3/+8
just as core upload logic does. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-06-23i965/blorp: Use prog data counters to guide sf/sbe setupTopi Pohjolainen5-9/+37
just as core upload logic does. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-06-23i965: Avoid division by zero.Ardinartsev Nikita1-11/+15
Fixes regression introduced by af5ca43f2676bff7499f93277f908b681cb821d0 Cc: "12.0 11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95419
2016-06-23swr: [rasterizer core] fix dependency bugTim Rowley4-10/+10
Never be dependent on "draw 0", instead have a bool that makes the draw dependent on the previous draw or not dependent at all. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer core] use wrap-around safe compares for dependency checkingTim Rowley6-36/+45
Move drawIDs from 64-bit to 32-bit to increase perf. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer jitter] add support for component packing for 'odd' formatsTim Rowley1-4/+23
Add early-out if no components are enabled. Add asserts. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer core] track whether GS outputs viewport array indexTim Rowley1-0/+3
So we can skip the index gather in PA. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer core] GS viewport array index attributeTim Rowley2-1/+2
Only adds the attribute mapping to the jitter; no implementation yet. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer core] conservative rasterization frontend supportTim Rowley10-63/+325
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer core] stop single threaded crash exit crashTim Rowley1-2/+3
Function static destructors were getting called by exit handlers before context teardown. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer jitter] small fetch jit cleanupTim Rowley1-134/+36
Handle SGV stores separate from the stream fetch code. Because of this change, there is a potential to jit an extra unused store. Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer core] remove old commentTim Rowley1-1/+0
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer jitter] cleanup supporting different llvm versionsTim Rowley8-34/+73
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer jitter] unitialized component fix in fetch jitTim Rowley1-1/+1
Was trying to store an extra uninitialized component. Only affects component packing, which isn't enabled (yet). Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer] add support for building avx512 versionTim Rowley5-15/+20
Currently, most code paths between AVX2 and AVX512 are identical (see changes to knobs.h). Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer common] fix include for Intel compilerTim Rowley1-1/+1
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: [rasterizer common] workaround clang for windows __cpuid() bugTim Rowley1-5/+9
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23swr: push/pop DEBUG macro around llvm includesTim Rowley2-4/+13
llvm redefines DEBUG; adding push/pop prevents a undefined reference to debug_refcnt_state in llvm-3.7+. v2: add undef DEBUG Cc: "12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
2016-06-23include: Require MSVC 2013 Update 4.Jose Fonseca1-2/+2
Earlier MSVC 2013 releases have troubles compiling some of our C99 code, so make sure we have Update 4 to avoid confusion. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Brian Paul <brianp@vmware.com>
2016-06-23svga: rename svga_surface_copy() to svga_resource_copy_region()Brian Paul1-9/+9
To be consistent with the pipe_context function name. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23svga: don't copy blit_info into local varBrian Paul1-11/+10
There's no reason for doing so. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23gallium/util: fix some 4-space indentation in blitter codeBrian Paul1-21/+21
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-06-23svga: fix texture array update regressionCharmaine Lee1-6/+27
With commit fb9fe35, we start using transfer_inline_write for memcpy TexSubImage path, but that triggers a regression with texture array in the svga driver. With this patch, the direct map code will update the texture array correctly. Fixes VMware bug 1679293. Tested with MTT piglit, glretrace, conform. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-06-23svga: fix index/vertex buffer surface reference at drawCharmaine Lee1-0/+20
Currently with the SetVertexBuffers optimization, we avoid emitting redundant DXSetVertexBuffers commands. However, these buffers surfaces will still need to be referenced, otherwise, in the case of linux, the subsequent surface discard map will map to the existing mob instead of a new one, causing rendering artifacts. With this patch, we'll call resource_rebind() to reference the resources even if we are avoiding the actual set command. This fixes the rendering artifacts in the window title area running with unity in Ubuntu 14.04 Tested with piglit, glretrace. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-06-23svga: fix vertex buffer references in the hw stateCharmaine Lee4-27/+64
This patch fixes three issues with vertex buffer references: (1) Instead of copy the vertex buffer resource handles to the hw state in the context structure, use pipe_resource_reference to properly reference the vertex buffer resources in the context. (2) Make sure to unbind those unused vertex buffer resources. (3) Force to rebind the vertex buffer resources at the first draw of each command buffer to make sure the vertex buffer resources are paged in. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-06-23svga: fix index buffer reference in the hw stateCharmaine Lee3-6/+16
Instead of copy the index buffer resource handle to the hw state in the context structure, use pipe_resource_reference to properly reference the index buffer resource in the context. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-06-23glsl/mesa: stop duplicating geom and tcs layout valuesTimothy Arceri7-53/+48
We already store these in gl_shader and gl_program here we remove it from gl_shader_program and just use the values from gl_shader. This will allow us to keep the shader cache restore code as simple as it can be while making it somewhat clearer where these values originate from. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-06-23glsl/mesa: stop duplicating tes layout valuesTimothy Arceri4-28/+28
We already store this in gl_shader and gl_program here we remove it from gl_shader_program and just use the values from gl_shader. This will allow us to keep the shader cache restore code as simple as it can be while making it somewhat clearer where these values originate from. V2: remove unnecessary NULL check Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Iago Toral <itoral@igalia.com>
2016-06-23.mailmap: Fixup my email addressEdward O'Callaghan1-0/+2
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-06-22st/mesa: expose EXT_vertex_array_bgra when supported by backendChristian Gmeiner1-1/+2
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-06-22anv: Use different BOs for different scratch sizes and stagesJason Ekstrand7-55/+32
This solves a race condition where we can end up having different stages stomp on each other because they're all trying to scratch in the same BO but they have different views of its layout. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-06-22genxml: Make ScratchSpaceBasePointer an address instead of an offsetJason Ekstrand8-38/+59
While we're here, we also fixup MEDIA_VFE_STATE and rename the field in 3DSTATE_VS on gen6-7.5 to be consistent with the others. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-06-22anv: Add an allocator for scratch buffersJason Ekstrand2-0/+89
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-06-22genxml: Put append counter fields before MCS in RENDER_SURFACE_STATE on gen7Jason Ekstrand2-4/+4
The pack header generation scripts can't handle the case where you have two addresses in the same dword; they just take whatever is the last one. This meant that the MCS address wasn't properly getting handled. Since we don't care about append counters, we can just re-arrange the XML for now. Reviewed-by: Chad Versace <chad.versace@intel.com> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-06-22anv,isl: Lower storage image formats in anvJason Ekstrand2-7/+4
ISL was being a bit too clever for its own good and lowering the format for us. This is all well and good *if* we always want to lower it. However, the GL driver selectively lowers the format depending on whether the surface is write-only or not. Reviewed-by: Chad Versace <chad.versace@intel.com> Cc: "12.0" <mesa-stable@lists.freedesktop.org>