summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* st/nine: Partial software vertex processing supportAxel Davy2016-10-108-60/+322
| | | | | | | | | | | | | | | | | | | | | | | | Software Vertex Processing allows: . Less limitations for shaders (more loops, etc) . Less limitations for ff (more enabled lights, 255 matrices for VertexBlend) In particular shaders can get more constants. This patch implements support for this (not using software rendering, but hardware rendering, as llvmpipe and dx10+ hw have the same limits...) This is considered a second class path. Even apps asking for "Mixed Vertex processing" (ie the ability to switch to swvp on demand) do not use the feature much. Some just initialize more constants than the normal limit at the start of the application, but never use more than the normal limit. When the apps do not need the software vertex processing features, they do not seem to turn it on. This means it is ok if that path is slow. Thus no care has been made to make the path optimized. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Rework vs int and bool constants bufferAxel Davy2016-10-104-24/+37
| | | | | | This will help to support swvp constants. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Change dirty tracking for vs int and bool constantsAxel Davy2016-10-104-22/+56
| | | | | | | This change makes easier to introduce tracking for swvp constants. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Drop unused constant upload pathAxel Davy2016-10-103-210/+4
| | | | | | | | | This path has been disabled for some time because of some bugs with it. It hasn't been updated to the new features, and is not faster. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Add support for swvp constants in shadersAxel Davy2016-10-103-37/+125
| | | | | | | swvp has relaxed limits (more nested loops, etc). In particular it enables more constants. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Initial mixed vertex processing supportAxel Davy2016-10-102-5/+16
| | | | | | | | | | In mixed vertex processing, the user can enable or disable software vertex processing. It is on hardware by default. This feature is not a state, and thus the setting doesn't need to be recorded by stateblocks. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement SetNPatchModeAxel Davy2016-10-101-1/+1
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement D3DUSAGE_SOFTWAREPROCESSINGAxel Davy2016-10-101-2/+3
| | | | | | | | Buffers with this flag must be usable with both software and hardware vertex processing. Use Staging for fast cpu access. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]>
* st/nine: Allocate more space for ATI1Patrick Rudolph2016-10-102-6/+17
| | | | | | | | | | | | | | ATIx are "unknown" formats that do not follow block format conventions. Tests showed that pitch*height bytes are allocated. apitrace used to depend on this behaviour. It used to copy more bytes than it has to for the ATI1 block format, but it didn't crash on Windows. Increase buffersize for ATI1 to fix this crash. The same issue was present in WINE but a patch has been sent by me. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Add missing breakPatrick Rudolph2016-10-101-0/+1
| | | | | | | Add missing break instruction. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Implement relative addressing for ps inputsAxel Davy2016-10-101-3/+27
| | | | | | | | | To implement the feature we copy the ps inputs to a temp array. This is not optimal for performance, but it is the simplest solution. This is a feature that is very very rarely used. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Wait for pending tasks to execute in swapchainAxel Davy2016-10-101-0/+4
| | | | | | Fixes crash after Reset() when using thread_submit=true Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use fixed size arrays for swapchain buffersAxel Davy2016-10-102-40/+11
| | | | Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix buffer count check for Ex devicesPatrick Rudolph2016-10-101-5/+4
| | | | | Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* st/nine: Disable seamless cubemap for d3dAxel Davy2016-10-102-2/+2
| | | | | | d3d9 doesn't have seamless cubemap. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix some check flagsAxel Davy2016-10-101-11/+12
| | | | | | | Uses the new defines introduced in previous commit. See comment in the commit for more explanation. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Unify some check flagsAxel Davy2016-10-102-4/+12
| | | | | | The new defines will be reused in a later patch. Signed-off-by: Axel Davy <[email protected]>
* gallium/util: Really allow aliasing of dst for u_box_union_*Axel Davy2016-10-101-11/+20
| | | | | | | | | | | | | | | | Gallium nine relies on aliasing to work with this function. Without this patch, dirty region tracking was incorrect, which could lead to incorrect textures or vertex buffers. Fixes several game bugs with nine. Fixes https://github.com/iXit/Mesa-3D/issues/234 Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Patrick Rudolph <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Cc: "12.0" <[email protected]>
* softpipe: Cap to 2 GB on 32 bitsAxel Davy2016-10-101-0/+6
| | | | | | | | | | | | | | On 32 bits system, application memory is quite limited. softpipe uses application memory. To help prevent memory exhaustion, limit reported memory availability to 2GB. Some gallium nine apps do check reported memory by allocating resources until memory is full. Gallium nine refuses allocations when 80% of the reported memory limit is used. This change helps some apps to start. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* llvmpipe: Cap to 2 GB on 32 bitsAxel Davy2016-10-101-0/+6
| | | | | | | | | | | | | | On 32 bits system, application memory is quite limited. llvmpipe uses application memory. To help prevent memory exhaustion, limit reported memory availability to 2GB. Some gallium nine apps do check reported memory by allocating resources until memory is full. Gallium nine refuses allocations when 80% of the reported memory limit is used. This change helps some apps to start. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/os: Fix overflow on 32 bitsAxel Davy2016-10-101-4/+10
| | | | | | | | | | | | | On systems with more than 4GB of ram, os_get_total_physical_memory was triggering an integer overflow for the linux and haiku path, when on 32 bits. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94561 Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/nine: Memset pipe_resource templatesAxel Davy2016-10-102-0/+8
| | | | | | | | | | | | Fixes regression introduced by ecd6fce2611e88ff8468a354cff8eda39f260a31 and is more future proof than just clearing the next field. Other nine usages did already zero out the templates. Signed-off-by: Axel Davy <[email protected]> Acked-by: Edward O'Callaghan <[email protected]>
* nvc0: fix valid range for shader buffersSamuel Pitoiset2016-10-103-0/+3
| | | | | | | | When offset != 0, the valid range was wrong because the second argument of util_range_add() is end, not size. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nvc0/ir: fix overwriting of value backing non-constant gather offsetIlia Mirkin2016-10-101-2/+2
| | | | | | | | | | | | | Normally the value is an immediate, which is moved to some temporary, so there's no problem. In the case of a non-constant offset (as allowed by ARB_gpu_shader5), we have to take care to copy it first before using it to build up the bits. This fixes a compilation error observed in F1 2015. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Cc: [email protected]
* nv50/ir: only stick one preret per functionIlia Mirkin2016-10-101-4/+7
| | | | | | | | | | | A function with multiple returns would have had multiple preret settings at the top of the function. While this is unlikely to have caused issues since we don't use functions in earnest, it could have in some cases overflowed the call stack, in case a function had a lot of early returns. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radeonsi: make more use of si_have_tgsi_computeNicolai Hähnle2016-10-101-3/+1
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/radeon: assign a name to LLVM output variables in debug buildsNicolai Hähnle2016-10-101-1/+6
| | | | | | | This can be helpful with R600_DEBUG=preoptir. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/radeon: avoid redundant work with overlapping in/out arraysNicolai Hähnle2016-10-101-1/+4
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: support ARB_compute_variable_group_sizeNicolai Hähnle2016-10-105-17/+53
| | | | | | | | Not sure if it's possible to avoid programming the block size twice (once for the userdata and once for the dispatch). Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add missing zero-init for resource templatesRob Clark2016-10-0710-0/+17
| | | | | | | Mostly test code, plus one spot I noticed in r600. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* freedreno: don't try to shadow layered texturesRob Clark2016-10-071-0/+3
| | | | | | | | We will only hit this with multi-planar YUV external images, so we would probably never hit this code path in the first place. But if we did, it wouldn't do the right thing so just bail. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx+a4xx: fix clip-plane lowering stateRob Clark2016-10-072-0/+6
| | | | | | | If enabled clip-planes have changed, we need to mark program state dirty. Signed-off-by: Rob Clark <[email protected]>
* vc4: Don't worry about partial Z/S clear if the other is already cleared.Eric Anholt2016-10-061-3/+7
| | | | | | | | | We have to be careful to not smash the value they're clearing to, but other than that we're fine. Avoids quad clears in Processing, which likes to do glClear(Z|S); glClear(Z). Improves performance of Processing's QuadRendering demo at 5000 quads by 5.46507% +/- 1.35576% (n=15 before, 32 after)
* vc4: Try to fix the HW-2116 workaround.Eric Anholt2016-10-061-9/+10
| | | | | | | | | | | | | | | We were incrementing the count at the end of vc4_start_draw(), except that that function returns immediately if we've already started drawing on this batch. It also failed to count the statechanges from the GFXH-515 workaround. This incidentally allows repeated glClear() to be coalesced, because the fast clears aren't counted in draw_calls_queued any more. Fixes most of the extra flushes in Processing, which emits glClear(Z|S); glClear(Z); glClear(C) during its frame setup. Improves performance of Processing's QuadRendering demo at 5000 quads by 3.33538% +/- 2.05846% (n=21 before, 15 after)
* vc4: Drop dead argument from vc4_start_draw().Eric Anholt2016-10-061-3/+3
|
* vc4: Fix fallback to quad clears of depth in GLX.Eric Anholt2016-10-064-25/+64
| | | | | The fix in the vc4-jobs series ended up triggering the fallback path on GLX apps that use depth but not stencil.
* vc4: Add the format name in miptree_debug.Eric Anholt2016-10-061-2/+4
| | | | | I was curious if my Z/S buffer was actually ZS or ZX, and the vc4 format of "0" didn't tell me much.
* vc4: Fix perf debug formatting on partial Z/S clear.Eric Anholt2016-10-061-1/+1
|
* vc4: Drop destination register when it's unused.Eric Anholt2016-10-061-1/+22
| | | | | | | This slightly reduces instructions on shader-db, but I think it's just perturbing register allocation -- the allocator should have always trivially colored these nodes, before. This commit is just to make QIR code failing more intelligible when register allocation fails.
* vc4: Fix live intervals analysis for screening defs in if statements.Eric Anholt2016-10-063-5/+20
| | | | | | | | | If a conditional assignment is only conditioned on the exec mask, that's still screening off the value in the executed channels (and, since we're not storing to the unexcuted channels, we don't care what's in there). Fixes a bunch of extra register pressure on Processing's Ribbons demo, which is failing to allocate.
* vc4: Fix simulator when more than one vc4_screen is opened.Eric Anholt2016-10-063-3/+39
| | | | | | We would assertion fail in setting up the simulator the second time around. This at least postpones the assertion failure until we've closed all of the first set of screens and started opening a new set.
* vc4: Fix assertion fails from trying to cast non-ALU instrs to ALU.Eric Anholt2016-10-061-0/+2
| | | | | Fixes 100 piglit tests since the assertions were added to nir.h. What's amazing is that these tests used to pass, even when casting garbage.
* nv50/ir: fix wrong check when optimizing MAD to SHLADDSamuel Pitoiset2016-10-071-1/+1
| | | | | | | | | Checking if MAD is supported is definitely wrong, and it's more likely a typo I introduced few days ago which breaks NV50 because SHLADD is not supported there. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nvc0: dump program binary only when NV50_PROG_DEBUG is setSamuel Pitoiset2016-10-071-1/+1
| | | | | | | | When the chipset is forced with NV50_PROG_CHIPSET, we actually only want to output the binary if NV50_PROG_DEBUG is also enabled. Otherwise, this pollutes the shader-db output. Signed-off-by: Samuel Pitoiset <[email protected]>
* nvc0: expose ARB_compute_variable_group_sizeSamuel Pitoiset2016-10-071-2/+6
| | | | | | | | | Only expose 512 threads/block on Fermi to not be limited by 32 GPRs/thread. v4: - use 512 threads on Fermi, 1024 on Kepler+ Signed-off-by: Samuel Pitoiset <[email protected]>
* nv50/ir: set number of threads/block for variable local sizeSamuel Pitoiset2016-10-071-0/+2
| | | | | | | | | | | | When a variable local size is defined as specified by ARB_compute_variable_group_size, the fixed local size is set to 0 and a SIGFPE occurs when we compute the maximum number of regs. This allows to use 64 GPRs/thread. v4: - use 512 threads on Fermi, 1024 on Kepler+ Signed-off-by: Samuel Pitoiset <[email protected]>
* gallium: add PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCKSamuel Pitoiset2016-10-077-1/+15
| | | | | | | | | v3: - use a new case statement in r600_pipe_common.c - fix compilation of softpipe... Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* nv50/ir: optimize sub(a, 0) to aKarol Herbst2016-10-061-0/+3
| | | | | | | | | | | | | | | | | helped some ue4 demos and divinity OS shaders total instructions in shared programs : 2818674 -> 2818606 (-0.00%) total gprs used in shared programs : 379273 -> 379273 (0.00%) total local used in shared programs : 9505 -> 9505 (0.00%) total bytes used in shared programs : 25837792 -> 25837192 (-0.00%) local gpr inst bytes helped 0 0 33 33 hurt 0 0 0 0 Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
* nir: Make nir_foo_first/last_cf_node return a block insteadJason Ekstrand2016-10-062-11/+6
| | | | | | | | | | One of NIR's invariants is that control flow lists always start and end with blocks. There's no good reason why we should return a cf_node from these functions since we know that it's always a block. Making it a block lets us remove a bunch of code. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* gallium/hud: Remove superfluous debugSteven Toth2016-10-064-52/+0
| | | | | | | No longer required. Signed-off-by: Steven Toth <[email protected]> Reviewed-by: Emil Velikov <[email protected]>