aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Propagate invariant/precise after lowering const arrays.Kenneth Graunke2016-06-231-0/+1
| | | | | | | | | | The new uniform may need precise as well. Fixes copy propagation of constant array uniforms in Tomb Raider shaders. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: Split arrays even in the presence of whole-array copies.Kenneth Graunke2016-06-231-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: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: Make constant propagation's folder not propagate into an LHS.Kenneth Graunke2016-06-231-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: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965/blorp: Disable vertex element swizzlingTopi Pohjolainen2016-06-232-4/+18
| | | | | | | | Without vertex elements originating directly from vertex fetcher are not passed to wm-state correctly. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/blorp: Let program data tell if push constants are neededTopi Pohjolainen2016-06-233-15/+35
| | | | | Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/blorp: Use prog data counters to guide wm/ps setupTopi Pohjolainen2016-06-233-3/+8
| | | | | | | just as core upload logic does. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/blorp: Use prog data counters to guide sf/sbe setupTopi Pohjolainen2016-06-235-9/+37
| | | | | | | just as core upload logic does. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Avoid division by zero.Ardinartsev Nikita2016-06-231-11/+15
| | | | | | | | | Fixes regression introduced by af5ca43f2676bff7499f93277f908b681cb821d0 Cc: "12.0 11.2" <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95419
* swr: [rasterizer core] fix dependency bugTim Rowley2016-06-234-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 <[email protected]>
* swr: [rasterizer core] use wrap-around safe compares for dependency checkingTim Rowley2016-06-236-36/+45
| | | | | | Move drawIDs from 64-bit to 32-bit to increase perf. Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer jitter] add support for component packing for 'odd' formatsTim Rowley2016-06-231-4/+23
| | | | | | Add early-out if no components are enabled. Add asserts. Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer core] track whether GS outputs viewport array indexTim Rowley2016-06-231-0/+3
| | | | | | So we can skip the index gather in PA. Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer core] GS viewport array index attributeTim Rowley2016-06-232-1/+2
| | | | | | Only adds the attribute mapping to the jitter; no implementation yet. Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer core] conservative rasterization frontend supportTim Rowley2016-06-2310-63/+325
| | | | Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer core] stop single threaded crash exit crashTim Rowley2016-06-231-2/+3
| | | | | | | Function static destructors were getting called by exit handlers before context teardown. Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer jitter] small fetch jit cleanupTim Rowley2016-06-231-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 <[email protected]>
* swr: [rasterizer core] remove old commentTim Rowley2016-06-231-1/+0
| | | | Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer jitter] cleanup supporting different llvm versionsTim Rowley2016-06-238-34/+73
| | | | Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer jitter] unitialized component fix in fetch jitTim Rowley2016-06-231-1/+1
| | | | | | | Was trying to store an extra uninitialized component. Only affects component packing, which isn't enabled (yet). Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer] add support for building avx512 versionTim Rowley2016-06-235-15/+20
| | | | | | | Currently, most code paths between AVX2 and AVX512 are identical (see changes to knobs.h). Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer common] fix include for Intel compilerTim Rowley2016-06-231-1/+1
| | | | Reviewed-by: Bruce Cherniak <[email protected]>
* swr: [rasterizer common] workaround clang for windows __cpuid() bugTim Rowley2016-06-231-5/+9
| | | | Reviewed-by: Bruce Cherniak <[email protected]>
* swr: push/pop DEBUG macro around llvm includesTim Rowley2016-06-232-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" <[email protected]> Reviewed-by: Bruce Cherniak <[email protected]>
* svga: rename svga_surface_copy() to svga_resource_copy_region()Brian Paul2016-06-231-9/+9
| | | | | | To be consistent with the pipe_context function name. Reviewed-by: Charmaine Lee <[email protected]>
* svga: don't copy blit_info into local varBrian Paul2016-06-231-11/+10
| | | | | | There's no reason for doing so. Reviewed-by: Charmaine Lee <[email protected]>
* gallium/util: fix some 4-space indentation in blitter codeBrian Paul2016-06-231-21/+21
| | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix texture array update regressionCharmaine Lee2016-06-231-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 <[email protected]>
* svga: fix index/vertex buffer surface reference at drawCharmaine Lee2016-06-231-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 <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
* svga: fix vertex buffer references in the hw stateCharmaine Lee2016-06-234-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 <[email protected]>
* svga: fix index buffer reference in the hw stateCharmaine Lee2016-06-233-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 <[email protected]>
* glsl/mesa: stop duplicating geom and tcs layout valuesTimothy Arceri2016-06-237-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 <[email protected]>
* glsl/mesa: stop duplicating tes layout valuesTimothy Arceri2016-06-234-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 <[email protected]> Reviewed-by: Iago Toral <[email protected]>
* st/mesa: expose EXT_vertex_array_bgra when supported by backendChristian Gmeiner2016-06-221-1/+2
| | | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* anv: Use different BOs for different scratch sizes and stagesJason Ekstrand2016-06-227-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 <[email protected]> Cc: "12.0" <[email protected]>
* genxml: Make ScratchSpaceBasePointer an address instead of an offsetJason Ekstrand2016-06-228-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 <[email protected]> Cc: "12.0" <[email protected]>
* anv: Add an allocator for scratch buffersJason Ekstrand2016-06-222-0/+89
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* genxml: Put append counter fields before MCS in RENDER_SURFACE_STATE on gen7Jason Ekstrand2016-06-222-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 <[email protected]> Cc: "12.0" <[email protected]>
* anv,isl: Lower storage image formats in anvJason Ekstrand2016-06-222-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 <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Allow for full 31-bit buffer texture sizesJason Ekstrand2016-06-221-1/+1
| | | | | | | | Ivy Bridge and above can handle up to 2^31 elements for RAW buffer surfaces. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Don't use designated initializers for buffer surface stateJason Ekstrand2016-06-221-23/+23
| | | | | Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Add assertions for buffer surface restrictionsJason Ekstrand2016-06-221-0/+11
| | | | | Acked-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Don't set SurfacePitch for gen9 1-D texturesJason Ekstrand2016-06-221-0/+3
| | | | | | | | This field is ignored by the hardware in this case and, on very large 1-D textures, it can end up being larger than the maximum allowed value. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Use TILEWALK_XMAJOR for linear surfaces on gen7Jason Ekstrand2016-06-221-2/+2
| | | | | | | | | This matches better what happens on gen8 where the "Tiled Surface" and "Tile Walke" bits are combined into a single two-bit value. This is also more consistent with what the GL driver does. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Emit no-op mip tail setup on SKLJason Ekstrand2016-06-221-0/+8
| | | | | | | | This hasn't ever been a problem in the past but it is recommended by the hardware docs. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Only set cube face enables if usage includes CUBE_BITJason Ekstrand2016-06-221-7/+9
| | | | | | | | It seems safe to set it all the time, but this reduces the diff between the way i965 does it and what ISL does. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Use the layout for computing qpitch rather than dimensionsJason Ekstrand2016-06-221-19/+15
| | | | | | | | | | For depth/stencil 1-D textures on SKL, we want them layed out in the old format that has been used since gen4. In order for the surface state fill-out code to handle, this it needs to distinguish based on layout rather than just dimensionality. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Set the IntegerSurfaceFormat bit on HaswellJason Ekstrand2016-06-221-0/+4
| | | | | | | This fixes 688 Vulkan CTS tests on Haswell. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/format: Mark R9G9B9E5 as containing 9-bit unsigned float channelsJason Ekstrand2016-06-221-1/+1
| | | | | Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Don't set RenderTargetViewExtent for texture surfacesJason Ekstrand2016-06-221-4/+18
| | | | | | | | | | The docs specify that this only matters for render targets and surfaces used with typed dataport messages. On some platforms (gen4-6) the Depth field has more bits than RenderTargetViewExtent so we can have textures with more levels than we can render to. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>
* isl/state: Set SurfaceArray based on the surface dimensionJason Ekstrand2016-06-221-1/+1
| | | | | | | | | | According to the PRM, you can't set SurfaceArray for 3D or buffer textures. There doesn't seem to be a good reason not to set it when we can. On the other hand, if we don't set it we can end up getting strange results for 1-layer array textures such as textureSize() returning the wrong results. Reviewed-by: Chad Versace <[email protected]> Cc: "12.0" <[email protected]>