summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* gallium/util: Clarify comment in util_init_thread_pinningMichel Dänzer2018-09-281-1/+4
| | | | | | | | | | As discussed in the review of the patch which added the comment: Nothing happens when a thread is created, because pthread_atfork doesn't affect creating threads. However, spawning a child process will likely crash. Reviewed-by: Marek Olšák <[email protected]>
* freedreno/a6xx: Build up draw dword0 outside visibilty if statementKristian H. Kristensen2018-09-271-17/+18
| | | | | | | | Pulling this logic out means we can share the logic and avoid a couple of temporary variables that helped make things clearer before. Note that in either vismode case, we always program vismode 0. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Simplify draw_emit() branches a bitKristian H. Kristensen2018-09-271-16/+8
| | | | | | | | Now that we've copied the emit logic into each branch of the if (info->index_size) statement, we can simplify the logic a bit according to which case we're in. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Copy OUT_RING() part into each branch of the index ifKristian H. Kristensen2018-09-271-17/+29
| | | | Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Split fd6_draw_emit into direct and indirect pathsKristian H. Kristensen2018-09-271-36/+46
| | | | | | | This splits the two code paths into separate functions and moves the "if (info->indirect)" test into draw_impl(). Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Inline fd6_draw()Kristian H. Kristensen2018-09-271-31/+17
| | | | | | Simplify the code a bit by inlining this helper. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Move emit_marker and wfi to draw_impl()Kristian H. Kristensen2018-09-271-17/+12
| | | | | | | This way the markers clearly bracket the draw call and isn't duplicated for both direct and indirect draw code. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Move inline functions out of fd6_draw.hKristian H. Kristensen2018-09-273-108/+110
| | | | | | Only used in fd6_draw.c so put them there. Signed-off-by: Kristian H. Kristensen <[email protected]>
* freedreno: fix a typo in launch_gridHyunjun Ko2018-09-271-1/+1
|
* freedreno/ir3: fix the param order of cmpxchgHyunjun Ko2018-09-271-2/+2
| | | | | | | | | | | According to the following definition, int AtomicCompSwap(inout int mem, uint compare, uint data); the preceding one in atomic_comp_swap of NIR is compare and data is followed, while src0 for cmpxchg needs vec2(data, compare) So for ssbo/image deref comp_swap, that should be reversed. Fixes: dEQP-GLES31.functional.image_load_store.*.atomic.comp_swap*
* freedreno/a6xx: fix shaders w/ >= 24 regsRob Clark2018-09-271-1/+1
| | | | | | | | Possibly these bits mean something else now. Blob always seems to use FOUR_QUADS, and changing to TWO_QUADS seems to cause different threads to overlap registers. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: fix gl_FragCoord.wRob Clark2018-09-271-2/+6
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno: handle invalidated buffers harderRob Clark2018-09-278-7/+39
| | | | | | Do a better job of skipping mem2gmem/gmem2mem.. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: fix constlenRob Clark2018-09-271-7/+6
| | | | | | | | | Fix a few bits of confusion, as with previous gen's constlen is aligned to 4, and value in bitfield is left-shifted by 2 (ie. divided by 4). But this is done by the CONSTLEN() accessor/builder fxn, so don't do it twice. Also HLSQ_FS_CNTL.CONSTLEN is not special. Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix inorder rendering caseRob Clark2018-09-271-6/+7
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: backface stencil stateRob Clark2018-09-272-2/+4
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: fix gpu crash with separate-stencilRob Clark2018-09-271-1/+1
| | | | | | | Fixes a crash in (of all things) dEQP-GLES2.info.vendor with --deqp-surface-type=fbo.. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: fix MRT configRob Clark2018-09-271-7/+7
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix potential hang when destroying batchRob Clark2018-09-271-1/+1
| | | | | | | batch_flush_reset_dependencies() expects to be called unlocked, and can call fd_batch_reference() which can try to aquire the screen lock again. Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix corrupted fb stateRob Clark2018-09-272-2/+5
| | | | | | | | | | | In c3d9f29b we allowed ctx->batch to be null, and started tracking the current framebuffer state in fd_context. But the existing logic in fd_blitter_pipe_begin() would, if !ctx->batch, set null fb state to be restored after blit. Which broke the world of deqp (and probably other things) Fixes: c3d9f29b781 freedreno: allocate ctx's batch on demand Signed-off-by: Rob Clark <[email protected]>
* freedreno: simplify pctx->clear()Rob Clark2018-09-276-74/+11
| | | | | | | | | | | | This is defined to always clear the entire surface(s) specified, regardless of scissor state.. mesa/st will turn scissored clears into a draw. So rip about a bunch of unnecessary machinery. Also remove a comment that was obsolete since using u_blitter to turn clear into draw (for the cases where there isn't a hw blitter fast-path). Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix FD_MESA_DEBUG=flushRob Clark2018-09-272-2/+8
| | | | | | | The logic to force a flush every draw was short-circuited with newer kernels. Also it should apply to clears as well. Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix scissor state emitRob Clark2018-09-274-4/+8
| | | | | | | The effective scissor changes based on rasterizer->scissor flag, so we need to re-emit scissor state when rasterizer state changes. Signed-off-by: Rob Clark <[email protected]>
* freedreno: update generated headersRob Clark2018-09-278-340/+1089
| | | | Signed-off-by: Rob Clark <[email protected]>
* radeonsi: NaN should pass kill_ifAxel Davy2018-09-251-1/+2
| | | | | | | | | | | | | | | Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=105333 Fixes: https://github.com/iXit/Mesa-3D/issues/314 For this application, NaN is passed to KILL_IF and is expected to pass. v2: Explain in the code why UGE is used. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Marek Olšák <[email protected]> CC: <[email protected]>
* st/nine: Do not mark both ff vs and ps updatedAxel Davy2018-09-251-2/+4
| | | | | | | | | | | | | | | | Previously if only ff vs or only ff ps was used, the constants for both were marked as updated, while only the constants of the used ff shader were updated. Now that NINE_STATE_FF_VS and NINE_STATE_FF_PS do not intersect anymore, we can correctly mark the correct set of constant as updated. Fixes: https://github.com/iXit/Mesa-3D/issues/319 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Split NINE_STATE_FF_OTHERAxel Davy2018-09-255-23/+23
| | | | | | | | | | | NINE_STATE_FF_OTHER was mostly ff vs states. Rename it to NINE_STATE_FF_VS_OTHER and move common states with ps to NINE_STATE_FF_PS_CONSTS (renamed from NINE_STATE_FF_PSSTAGES). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add dummy ff shader stateAxel Davy2018-09-252-8/+12
| | | | | | | | | | | | | | | | | | Some states only affect the ff shader, not its constants. Currently we don't check anything and always recompute the ff shader key. However we do check for NINE_STATE_FF_OTHER and if set we reupload some constants. Thus for those states which had NINE_STATE_FF_OTHER set but didn't need it, replace by a dummy ff shader state (which is easier to understand for an external reader than just setting 0 and more future proof). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Mark pointsize states as ff statesAxel Davy2018-09-251-3/+3
| | | | | | | | | | The pointsize states were missing the ff NINE_STATE_FF_OTHER flag, and thus might miss state updates when using ff. Fixes some wine tests. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Minor refactor of a few NINE_STATE_* flagsAxel Davy2018-09-253-17/+14
| | | | | | | | | | | | Rename NINE_STATE_FOG_SHADER, NINE_STATE_POINTSIZE_SHADER and NINE_STATE_PS1X_SHADER into NINE_STATE_VS_PARAMS_MISC and NINE_STATE_PS_PARAMS_MISC. The behaviour is unchanged, except one minor change: D3DRS_FOGTABLEMODE doesn't need to affect VS. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Increase maximum number of temp registersAxel Davy2018-09-251-1/+1
| | | | | | | | | With some test app I hit the limit. As we allocate on demand (up to the maximum), it is free to increase the limit. Signed-off-by: Axel Davy <[email protected]> CC: <[email protected]>
* st/nine: Lock the entire buffer in some cases.Axel Davy2018-09-251-0/+8
| | | | | | | | | | | | | | | | | Previously we had already found that for MANAGED buffers the buffer started dirty (which meant all writes out of bound before the first draw call using the buffer have to be taken into account). Possibly it is the same for the other types of buffers. For now always lock the entire buffer (starting from the offset) for these (except for DYNAMIC buffers, which might hurt performance too much). Fixes: https://github.com/iXit/Mesa-3D/issues/301 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Don't call SetCursor until a cursor is setAxel Davy2018-09-251-1/+8
| | | | | | | | | | | | | | | | | | | The previous code was ignoring the input until a cursor is set inside d3d (with SetCursorProperties), as expected by wine tests. However it did still make a call to ID3DPresent_SetCursor, which would result into a SetCursor(NULL) call, thus hidding any cursor set outside d3d, which we shouldn't do. Add comment about not avoiding redundant ID3DPresent_SetCursor calls once a cursor has been set in d3d, as it has been tested to cause regressions. Fixes: https://github.com/iXit/Mesa-3D/issues/197 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid redundant SetCursorPos callsAxel Davy2018-09-251-0/+4
| | | | | | | | | | | | | | | | | | | | For some applications SetCursorPosition is called when a cursor event is received. Our SetCursorPosition was always calling wine SetCursorPos which would trigger a cursor event. The infinite loop is avoided by not calling SetCursorPos when the position hasn't changed. Found thanks to wine tests. Fixes irresponsive GUI for some applications. Fixes: https://github.com/iXit/Mesa-3D/issues/173 Signed-off-by: Axel Davy <[email protected]> CC: <[email protected]>
* st/nine: Init cursor position at device creationAxel Davy2018-09-251-2/+5
| | | | | | | This is only useful for software cursor, but at least now we won't start it at (0, 0). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Initialize manually cursor structureAxel Davy2018-09-251-0/+4
| | | | | | | Initialize manually the cursor structure fields for more clarity on its content. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Check if format is DS before retrieving flagsAxel Davy2018-09-251-0/+2
| | | | | | | | | | | | | | d3d9_get_pipe_depth_format_bindings assumes the input format is a depth stencil format. Previously the user could hit this function with an invalid format. Protect the last non protected call with a depth_stencil_format check. Another solution is to have d3d9_get_pipe_depth_format_bindings support non depth stencil format, but we don't want the user to create depth buffers with d3d formats that can't be one, it's better to check if the format can be depth buffer with d3d. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove clamping when mul_zero_winsAxel Davy2018-09-251-8/+47
| | | | | | | Tests show the clamping can be removed when mul_zero_wins is supported. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement predicated instructionsAxel Davy2018-09-251-7/+55
| | | | | | | | Most of the work was already there, just not implemented. Fixes: https://github.com/iXit/Mesa-3D/issues/318 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix aliased read in ffAxel Davy2018-09-251-3/+3
| | | | | | | | | Fix aliasing of colorarg_b4 with colorarg_b5. Fixes: https://github.com/iXit/Mesa-3D/issues/302 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix ff assignment with aliasingAxel Davy2018-09-251-9/+9
| | | | | | | "tex_stage[s][D3DTSS_COLORARG0] >> 4" could be a two bit number, thus colorarg_b4 was incorrectly set. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Clarify some ff assignmentsAxel Davy2018-09-251-6/+6
| | | | | | | | | | | | colorarg0, etc are 3 bits wide. Make the code more readable by adding an & 0x7 to further indicate we only remember the first 3 bits only. The 4th bit is always 0, and colorarg_b4, colorarg_b5, etc are used to store the 5th and 6th bits. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Print transform matrices in debugAxel Davy2018-09-251-0/+14
| | | | | | | This is useful to see the matrices content in the log to debug. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add ff key hash to help debugAxel Davy2018-09-251-0/+2
| | | | | | | This is very useful to find in the log the ff shader shource of a given call. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid RefToBind calls in ffAxel Davy2018-09-253-4/+10
| | | | | | | | | | | | | | | | When using csmt, ff shader creation happens on the csmt thread. Creating the shaders, then calling RefToBind causes the device ref to be increased then decreased. However the device dtor assumes than no work pending on the csmt thread could increase the device ref, leading to hang. The issue is avoided by creating the shaders with a bind count directly. Fixes: https://github.com/iXit/Mesa-3D/issues/295 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add new helper for object creation with bindAxel Davy2018-09-251-0/+26
| | | | | | | Add a new helper to create objects starting with a bind count instead of a ref count. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add parameter to start with bindAxel Davy2018-09-253-3/+18
| | | | | | | Add a parameter to start new object with a bind instead of a refcount. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use perspective correction for ps depth fogAxel Davy2018-09-251-7/+9
| | | | | | | | | | | | | | | | | | | | | Emulate perspective interpolation of depth for programmable ps fog ff ps fog uses position z, or 1/w depending on the ff projection matrix set. This is according to public documents found describing the algorithm and tests we made. In the case of programmable ps, we used position's z, which was sufficient to pass wine tests (which test shaders don't set w). Issue https://github.com/iXit/Mesa-3D/issues/315 showed that this calculation was wrong. Using perspective interpolation on z, that is using z * 1/w seems to satisfy both this application and wine tests. Fixes: https://github.com/iXit/Mesa-3D/issues/315 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Clamp RCP when 0*inf!=0Axel Davy2018-09-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Tests done on several devices of all 3 vendors and of different generations showed that there are several ways of handling infs and NaN for d3d9. Tests showed Intel on windows does always clamp RCP, RSQ and LOG (thus preventing inf/nan generation), for all shader versions (some vendor behaviours vary with shader versions). Doing this in nine avoids 0*inf issues for drivers that can't generate 0*inf=0 (which is controled by TGSI's MUL_ZERO_WINS). For now clamp for all drivers. An ulterior optimization would be to avoid clamping for drivers with MUL_ZERO_WINS for the specific shader versions where NV or AMD don't clamp. LOG and RSQ being already clamped, this patch only clamps RCP. Fixes: https://github.com/iXit/Mesa-3D/issues/316 Signed-off-by: Axel Davy <[email protected]> CC: <[email protected]>
* gallivm: ensure string is null-terminated instead of assert()ingEric Engestrom2018-09-251-3/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>