aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* radeon/uvd: use bitstream coded number for symbols of Huffman tablesLeo Liu2018-09-241-4/+14
| | | | | | | Signed-off-by: Leo Liu <[email protected]> Fixes: 130d1f456(radeon/uvd: reconstruct MJPEG bitstream) Cc: "18.2" <[email protected]> Reviewed-by: Boyuan Zhang <[email protected]>
* nv50/ir: fix link-time build failureRhys Perry2018-09-231-1/+1
| | | | | | | Seems this fixes linking problems that occur in some situations. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nvc0: fix bindless multisampled images on Maxwell+Rhys Perry2018-09-223-5/+45
| | | | | | | | | | | | | | | | | NVC0_CB_AUX_BINDLESS_INFO isn't written to on Maxwell+ and it's too small anyway. With these changes, TXQ is used to determine the number of samples and the coordinate adjustment information looked up in a small array in the driver constant buffer. v2: rework to use TXQ and a small array instead of a larger array with an entry for each texture v3: get rid of the small array and calculate the adjustments in the shader Signed-off-by: Rhys Perry <[email protected]> Fixes: c2ae9b40527 ('nvc0: implement multisampled images on Maxwell+') Reviewed-by: Ilia Mirkin <[email protected]>
* nvc0: warn about changing NVC0_CB_AUX_MP_INFO and NVC0_CB_AUX_DRAW_INFORhys Perry2018-09-221-2/+6
| | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nvc0: Update counter reading shaders to new NVC0_CB_AUX_MP_INFORhys Perry2018-09-221-18/+18
| | | | | | Fixes: 66ca7e400b8 ('nvc0: add support for programmable sample locations') Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* vc4: Remove dead i == 0 code from the cos() implementation.Eric Anholt2018-09-211-6/+3
| | | | The loop starts at 1.
* vc4: Fix sin(0.0) and cos(0.0) accuracy to fix SDL rendering rotation.Eric Anholt2018-09-211-26/+40
| | | | | | | | | | | | | | | | | | SDL has some shaders that compute sin(angle) and cos(angle) for a rotation matrix in the VS, and angle is usually 0.0. Our previous implementation had quite a bit of error around 0.0, causing single-pixel rotations at typical window sizes. SDL2 has changed as of August 28th (commit 12156:e5a666405750) to not need sin/cos in the VS, but we should still fix this for existing implementations or similar patterns that other programs may have. glsl-cos goes from 32 instructions to 36, but 9 uniforms to 7. glsl-sin goes from 32 instructions to 34, but 8 uniforms to 7. This seems like a fine impact to have for the bugfix. Cc: 18.1 18.2 <[email protected]> Fixes: https://github.com/anholt/mesa/issues/110
* meson: Don't compile pipe loader with dri support when not using driDylan Baker2018-09-211-5/+5
| | | | | | | | | | | Corrects building glx as gallium-xlib without any dri targets. v2: - fix ugly formatting Fixes: 66c94b9313a697ce8f2b222f4ba353035e4b8726 ("meson: build gallium winsys for dri, null, and wrapper") Reviewed-by: Eric Engestrom <[email protected]>
* svga: fix uninitialized fields in DefineDepthStencilView/DefineStreamOutputCharmaine Lee2018-09-201-0/+9
| | | | | | | This patch fixes uninitialized fields in DefineDepthStencilView and DefineStreamOutput commands that are not relevant in SM4 device. Reviewed-by: Brian Paul <[email protected]>
* r300g: add PIPE_SHADER_CAP_SCALAR_ISA switch case to silence warningBrian Paul2018-09-201-0/+4
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* svga: Enable Opengl 3.3 compatibility profileNeha Bhende2018-09-201-1/+1
| | | | | | | | | | With this patch, svga driver will start advertising OpenGL 3.3 compatibility profile. Tested with some mesa demos, piglit and glretrace. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: Apply texcoord scale factors only if there is sampler viewNeha Bhende2018-09-201-1/+1
| | | | | | | | | | | | | We need to convert unnormalized texcoords to normalized texcoords when we are sampling from texture. We don't need this conversion if there is no sampler view. Tested with piglit, glretrace Fixes vmware bug 2101970 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: fix texture array layer index in transfer mapCharmaine Lee2018-09-202-66/+42
| | | | | | | | | | | | | | | | | | | | | In gallium, the layer index of a texture array to be mapped is specified in the z component, whereas in svga device, the index is specified in a separate argument. Currently in svga_texture_transfer_map(), we explicitly modify the z value in the base transfer map to 0 so the layer offset will not be applied twice, but this causes problem when state tracker later refers to the base transfer map and expects the slice index to be specified in z (commit 463b0ea1f6762b7e0536cfadc4e384840af3e8e0). To fix the problem, this patch makes a local copy of the box in svga_transfer and modifies the z value in this copy instead. Fixes spec@khr_texture_compression-astc piglit test crashes. Fixes regression in the dma path with commit 1fdd3dd94a. Tested with mtt glretrace, piglit on Windows VM and Linux VM. Reviewed-by: Brian Paul <[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]>
* mesa/st: add force_compat_profile option to driconfigTimothy Arceri2018-09-182-2/+9
| | | | Reviewed-by: Marek Olšák <[email protected]>
* Revert "radeonsi: avoid syncing the driver thread in si_fence_finish"Timothy Arceri2018-09-183-52/+40
| | | | | | | | | | This reverts commit bc65dcab3bc48673ff6180afb036561a4b8b1119. This was manually reverted. Reverting stops the menu hanging in some id tech games such as RAGE and Wolfenstein The New Order. Reviewed-by: Marek Olšák <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107891
* v3d: Switch from FLUSH_ALL_STATE to FLUSH for ending our bin CLs.Eric Anholt2018-09-171-6/+6
| | | | | | The HW for FLUSH_ALL_STATE isn't validated, since the closed driver only uses FLUSH. Now that we don't have any new state at the end of our bin CLs, follow their lead.
* v3d: Stop clearing the OQ state at the end of the job.Eric Anholt2018-09-173-18/+1
| | | | | | Ever since we added OQ support, we've been clearing OQ state at the start of the job anyway. We're intentionally breaking old-and-new-driver-mix systems, because we need to stop using the unvalidated FLUSH_ALL_STATE.
* v3d: Always emit a TF disable at the start of drawing on V3D 4.x.Eric Anholt2018-09-173-10/+8
| | | | | | | | | | The HW's FLUSH_ALL_STATE is not validated, so we probably shouldn't use it, meaning that we need to reset state at the start. By doing this, we also make ourselves more resilient to another client leaving the TF state enabled at the end of their batch (as we now do, ourselves). However, we still need to emit a single TF disable at the end of the frame, for SWVC5-718.
* build: Don't overlink gallium xlib targetDylan Baker2018-09-172-2/+1
| | | | | | | | | | | | | | | | | | | | | Currently gallium's xlib target will fail to link due to multiple definitions of all the symbols in libmesautil, this only shows up in autotools, and not in meson due to differences in the way that meson and autotools handle linking static archives into static archives. Autotools uses -Wl,--whole-archive implicitly, meson requires this behavior to be opted-into. The solution is just to remove libmesautils from the libgl-xlib target, since it will get all of those symbols form libmesagallium. I've dropped the link from meson as well, it doesn't seem to hurt anything and should make linking just a little faster. Fixes: 8396043f304bb2a752130230055605c5c966e89f ("Replace uses of _mesa_bitcount with util_bitcount") bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107923 Tested-by: Brian Paul <[email protected]> Tested-by: Vinson Lee <[email protected]> Cc: Sergii Romantsov<[email protected]>
* r600/sb: use safe math optimizations when TGSI contains precise operationsGert Wollny2018-09-153-1/+5
| | | | | | | | | | Fixes: dEQP-GLES3.functional.shaders.invariance.highp.common_subexpression_3 dEQP-GLES3.functional.shaders.invariance.mediump.common_subexpression_3 dEQP-GLES3.functional.shaders.invariance.lowp.common_subexpression_3 Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: don't let child processes inherit our thread affinityMarek Olšák2018-09-141-4/+32
| | | | v2: corrected the comment
* gallium/util: start with a random L3 cache index for AMD ZenMarek Olšák2018-09-141-4/+16
|
* virgl: adjust strides when mapping temp-resourcesErik Faye-Lund2018-09-141-0/+2
| | | | | | | | | | | | | | When we're mapping temp-resources, we clip the resource to the transfer-box, which means the stride might not be correct any more. So let's update the stride from the temp-resource, and recompute the layer-stride. This fixes crashes when running dEQP with --deqp-gl-config-name=rgba8888d24s8ms4 Signed-off-by: Erik Faye-Lund <[email protected]> Fixes: a8987b88ff1 "virgl: add driver for virtio-gpu 3D (v2)" Reviewed-by: Dave Airlie <[email protected]>
* nvir: Always split 64-bit IMAD/IMUL operationsPierre Moreau2018-09-131-1/+1
| | | | | | | | | | | Those operations do not map to actual hardware instructions, therefore those should always be lowered to 32-bit instructions. Fixes: 009c54aa7af "nv50/ir: Split 64-bit integer MAD/MUL operations" Signed-off-by: Pierre Moreau <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Signed-off-by: Karol Herbst <[email protected]>
* st/vdpau: Use output buffer as back buffer with 24-bit color onlyLeo Liu2018-09-131-1/+2
| | | | | | | | Using output buffer with 8 bits video RGB as back buffer certainly is not working for 30 bits color depth visual. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* vl/dri: add color depth to vl winsysLeo Liu2018-09-132-0/+2
| | | | | | | For VDPAU use later Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* vl/dri3: add support for 10 bits formatLeo Liu2018-09-131-4/+25
| | | | | Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* vl/dri: add 10 bits format supportsLeo Liu2018-09-132-10/+65
| | | | | | | v2: Tell B10G10R10X2 and R10G10B10X2 formats for different HW. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* winsys/virgl: avoid unintended behaviorErik Faye-Lund2018-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we end up never taking the loop that writes ret, we can end up with an uninitialized value, and if we're *really* unlucky, that value can be -1, causing us to go down an error-path instead of a success path. This was obviously not intended, so let's just initialize this to zero. Noticed by Valgrind: Conditional jump or move depends on uninitialised value(s) at 0xBA640A0: virgl_drm_winsys_resource_cache_create (virgl_drm_winsys.c:348) by 0xBA62FCF: virgl_buffer_create (virgl_buffer.c:170) by 0xBA605AC: virgl_resource_create (virgl_resource.c:60) by 0xBCF816F: bufferobj_data (st_cb_bufferobjects.c:344) by 0xBCF816F: st_bufferobj_data (st_cb_bufferobjects.c:390) by 0xBB7E836: vbo_use_buffer_objects (vbo_exec_api.c:1136) by 0xBCFCC6E: st_create_context_priv (st_context.c:414) by 0xBCFD3CD: st_create_context (st_context.c:590) by 0xBBB30CA: st_api_create_context (st_manager.c:896) by 0xB981E76: dri_create_context (dri_context.c:155) by 0xB97BDCE: driCreateContextAttribs (dri_util.c:473) by 0x5288331: dri3_create_context_attribs (dri3_glx.c:309) by 0x5264D64: glXCreateContextAttribsARB (create_context.c:78) Fixes: a8987b88ff1 ("virgl: add driver for virtio-gpu 3D (v2)") Signed-off-by: Erik Faye-Lund <[email protected]>
* nv50,nvc0: warn on not-explicitly-handled capsIlia Mirkin2018-09-112-14/+26
| | | | | | | | | | Not handling caps explicitly means that we're likely getting incorrect values -- these need to be reviewed and set appropriately. While we're at it, add in some missing caps, and set all the subpixel stuff to 8 as that seems to be what the blob reports. Signed-off-by: Ilia Mirkin <[email protected]>
* gallium: Correctly handle no config context creationElie Tournier2018-09-102-1/+5
| | | | | | | | | | | | This patch fixes the following Piglit test: spec@egl_mesa_configless_context@basic It also fixes few test in a virgl guest. v2: Evaluate the value of no_config (Ilia) Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Elie Tournier <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* radeonsi/nir: port some bindless and sampler code from TGSIMarek Olšák2018-09-101-30/+50
| | | | | | These might be all missing changes for bindless textures. Tested-by: Dieter Nützel <[email protected]>
* radeonsi: adjust and simplify max_alloc_size determinationMarek Olšák2018-09-101-3/+5
| | | | Tested-by: Dieter Nützel <[email protected]>