summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
Commit message (Collapse)AuthorAgeFilesLines
* gallium/util: move memory debug declarations into u_debug_galliumDylan Baker2018-10-301-0/+1
| | | | | Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: rework PIPE_HANDLE_USAGE_* flagsMarek Olšák2018-10-308-23/+18
| | | | Only radeonsi uses them, so adjust them to match its needs.
* st/dri: remove leftover local variableEric Engestrom2018-10-301-1/+0
| | | | | | | | Left over from the cleanup in 6ccc435e7ad92bb0ba77d "pipe-loader: move dup(fd) within pipe_loader_drm_probe_fd" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* clover: add missing meson build dependencyEric Engestrom2018-10-291-1/+1
| | | | | | Fixes: 42ea0631f108d82554339 "meson: build clover" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* st/nine: Handle window resize when a presentation buffer is usedAxel Davy2018-10-261-1/+30
| | | | | | | | | | | | | | | | | | Usually when a window is resized, the app calls d3d to resize the back buffer to the window size. In some cases, it is not done, and it expects the output resizes to the window size, even if the back buffer size is unchanged. This patch introduces the behaviour when a presentation buffer is used. ID3DPresent_GetWindowInfo is a function available with D3DPresent v1.0, and thus we don't need to check if the function is available. The function had been introduced to implement this very feature. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Reduce MaxSimultaneousTextures to 8Axel Davy2018-10-262-9/+8
| | | | | | | | | | | | Windows drivers don't set this flag (which affects ff) to more than 8. Do the same in case some games check for 8. v2: Remove any dependence on MaxSimultaneousTextures. For non-ff the number of textures is 16 when the device is able of vs/ps3. Add this requirement of 16 textures to the driver requirements. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Enable shadow mapping for ps 1.XAxel Davy2018-10-263-10/+14
| | | | | | | | | | We didn't implement shadow textures for ps 1.X, assuming the case couldn't happen... Well it does. Fixes: https://github.com/iXit/Mesa-3D/issues/261 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Do not set unused states for stateblocksAxel Davy2018-10-261-21/+3
| | | | | | | | A lot of these states are used only for the context, and are unused for stateblocks (which just uses the changed.* fields instead for a lot of them). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix aliasing states for stateblocksAxel Davy2018-10-261-2/+1
| | | | | | | | | | | | | | | | | | | | | If NINE_STATE_FF_MATERIAL is set, the stateblock will upload its recorded materials matrix. If NINE_STATE_FF_LIGHTING is set, the lighting set is uploaded. These flags could be set by a NineDevice9_SetTransform call or by setting some states related to ff, but that shouldn't trigger these stateblock behaviours. We don't need to follow the context states dirtied by render states. NINE_STATE_FF_VSTRANSF is exactly the state controlling stateblock updates of transformation matrices, NINE_STATE_FF is too broad. These two changes avoid setting the two mentionned states when we shouldn't. Fixes: https://github.com/iXit/Mesa-3D/issues/320 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Never update device changed.* fieldsAxel Davy2018-10-264-48/+59
| | | | | | | | | The device state changed.* field are never used. These fields are used only for stateblocks. Avoid setting them at all for clarity. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Capture also default matrices for D3DSBT_ALLAxel Davy2018-10-263-24/+41
| | | | | | | | | | We avoid allocating space for never unused matrices. However we must do as if we had captured them. Thus when a D3DSBT_ALL stateblock apply has fewer matrices than device state, allocate the default matrices for the stateblock before applying. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Mark transform matrices dirty for D3DSBT_ALLAxel Davy2018-10-261-1/+12
| | | | | | | | D3DSBT_ALL stateblocks capture the transform matrices. Fixes some d3d test programs not displaying properly. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Don't update unused world matricesAxel Davy2018-10-261-0/+6
| | | | | | | | | | | | | | While to the application we have to track accurately all 256 world matrices (including in stateblocks), hw vertex processing enables to set a limit to the number of world matrices the hardware can access to in the advertised caps, which is 8 for nine. Thus don't bother in the stateblock code to send the updated values for the unreachable matrices. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove two unused states.Axel Davy2018-10-262-3/+1
| | | | | | | NINE_STATE_MATERIAL was used incorrectly at one location. Replace it with the correct state. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove commented nine_context_apply_stateblockAxel Davy2018-10-261-230/+0
| | | | | | | | | | | | At some point the project was to adapt the commented version to csmt. The csmt rework enabled to fix some state aliasing issues between stateblocks and internal state updates. The commented version needs a lot of work to work with that. Just drop it. Signed-off-by: Axel Davy <[email protected]>
* st/va: get mjpeg slice headerBoyuan Zhang2018-10-233-2/+164
| | | | | | | | Move the previous get_mjpeg_slice_heaeder function and eoi from "radeon/vcn" to "st/va". Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Leo Liu <[email protected]>
* android: Build kms_swrast for the Android platformRob Herring2018-10-221-0/+1
| | | | | | Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* scons: Remove gles option.Jose Fonseca2018-10-192-6/+2
| | | | | | | | It's broken, and WGL state tracker is always built with GLES support noawadays. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/xlib: Use more appropriate include guardMichał Janiszewski2018-10-181-2/+2
| | | | | Signed-off-by: Michał Janiszewski <[email protected]> Reviewed-by: Emil Velikov <[email protected]
* st/va: use provided sizes and coords for vlVaGetImageBoyuan Zhang2018-10-111-3/+28
| | | | | | | | | | | | | | | | vlVaGetImage should respect the width, height, and coordinates x and y that passed in. Therefore, pipe_box should be created with the passed in values instead of surface width/height. v2: add input size check, return error when size out of bounds v3: fix the size check for vaimage v4: add size adjustment for x and y coordinates Signed-off-by: Boyuan Zhang <[email protected]> Cc: "18.2" <[email protected]> Reviewed-by: Leo Liu <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Acked-by: Christian König <[email protected]>
* st/dri: Handle BGRA5551 formatMichel Dänzer2018-10-091-0/+13
| | | | Reviewed-by: Marek Olšák <[email protected]>
* pipe-loader: move dup(fd) within pipe_loader_drm_probe_fdEmil Velikov2018-10-033-26/+6
| | | | | | | | | | | | | | | | | | | | | | Currently pipe_loader_drm_probe_fd takes ownership of the fd given. To match that, pipe_loader_release closes it. Yet we have many instances which do not want the change of ownership, and thus duplicate the fd before passing it to the pipe-loader. Move the dup() within pipe-loader, explicitly document that and document all the cases through the codebase. A trivial git grep -2 pipe_loader_release makes things as obvious as it gets ;-) Cc: Leo Liu <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: Axel Davy <[email protected]> Cc: Patrick Rudolph <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Axel Davy <[email protected]> (for nine)
* st/dri: make swrast_no_present member of dri_screenEmil Velikov2018-10-032-4/+5
| | | | | | | Just like the dri2 options, this is better suited in the dri_screen struct. Signed-off-by: Emil Velikov <[email protected]>
* st/dri: inline dri2_buffer.h within dri2.cEmil Velikov2018-10-034-26/+16
| | | | | | | | The header was used only by dri2.c, containing a two-member struct and cast wrapper. Just inline it where it's used/needed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/xa: remove unused xa_screen::d[s]_depth_bits_lastEmil Velikov2018-10-031-2/+0
| | | | | | | Unused since the initial import. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[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]>
* st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does ↵Michal Srb2018-09-191-2/+4
| | | | | | | | | | | | | not implement it This is equivalent to commit a65db0ad1c3, but for dri_kms_init_screen. Without this gbm_dri_is_format_supported always returns false. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104926 Fixes: e14fe41e0bf ("st/dri: implement createImageFromRenderbuffer(2)") Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Tested-by: Adam Williamson <[email protected]>