summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
Commit message (Collapse)AuthorAgeFilesLines
* draw: fix clipvertex trouble if position comes from gsRoland Scheidegger2014-08-061-1/+5
| | | | | | | | | | | | | | | If the vertex shader has no position but the gs has, the clipvertex output was -1 (because it's the same as vs position in this case if there's no explicit clipvertex output). This caused crashes (or assertion failures) in clipping since in the end position (which came from gs) was different from cv (-1) and we then tried to use the bogus cv input. Rather than just test for -1 cv value in clipping, make it explicitly return the position output of the gs instead which seems cleaner (since we really don't want to use the clipvertex value from the vs (it could be a valid value in the (unsupported) case of vs writing clipvertex but still using a gs). This fixes piglit shader_runner clip-distance-out-values.shader_test. Reviewed-by: Zack Rusin <[email protected]>
* draw: don't run pipeline stages when gs has no position outputRoland Scheidegger2014-08-062-1/+5
| | | | | | | | | | | | | | | | The clip stage may crash if there's no position output, for this reason code was added to avoid running the pipeline stages in this case (c7c7186045ec617c53f7899280cbe12e59503e4d). However, this failed to actually work when there was a geometry shader, since unlike the vertex shader it did not initialize the position output to -1, hence the code trying to detect this didn't trigger. So simply initialize the position output to -1 just like the vs does. This fixes piglit glsl-1.50-transform-feedback-type-and-size (segfault->pass). clip-distance-out-values.shader_test goes from segfault to assertion failure, suggesting more fixes are needed, no other piglit changes. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Zack Rusin <[email protected]>
* gallivm: Fix build with latest LLVMJan Vesely2014-08-051-0/+8
| | | | | Signed-off-by: Jan Vesely <[email protected]> Reviewed-and-Tested-by: Michel Dänzer <[email protected]>
* gallivm: fix cube map array (and cube map shadow with bias) handlingRoland Scheidegger2014-08-052-29/+125
| | | | | | | | | | | In particular need to handle TEX2/TXB2/TXL2 opcodes. cube map shadow with bias already used TXB2 which didn't work before at all, despite that there's by default no piglit change (but using no_quad_lod and no_rho_opt indeed passes some more tex-miplevel-selection tests). The actual sampling code still won't handle cube map arrays. Reviewed-by: Brian Paul <[email protected]>
* gallium: Move sRGB <-> RGB handling to libmesautilJason Ekstrand2014-08-047-316/+3
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: Fix compiler warning.Jan Vesely2014-08-042-2/+2
| | | | | | | warning: type qualifiers ignored on function return type Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* target-helpers: Do not build kms_dri on libdrm-less platforms.Jon TURNEY2014-08-011-0/+2
| | | | | | | | Fix build since 3b176c441b7ddc5f7d2f891da3f76cf3c1814ce1 for dri_platform=none hosts. Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium: Add a uif() helper function to complement fui()Eric Anholt2014-07-301-0/+8
| | | | | | | | | I found myself often wanting this when I'm printing out a uint32_t mapping of some GPU data, and I want to put in an interpretation of that value as a float. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallivm: fix up out-of-bounds level when using conformant out-of-bound behaviorRoland Scheidegger2014-07-311-0/+1
| | | | | | | | | | | | | | | | | | | When using (d3d10) conformant out-of-bound behavior for texel fetching (currently always enabled) the level still needs to be set to a safe value even though the offset in the end won't get used because the level is used to look up the mip offset itself and the actual strides, which might otherwise crash. For simplicity, we'll use level 0 in this case (this ought to be safe, llvmpipe does not actually fill in level 0 information if first_level is larger, but some random strides / offsets shouldn't hurt as ultimately we always use offset 0 in this case). Fixes a crash in some in-house test where random huge levels appear in lp_build_fetch_texel() (the test actually uses level 0 always but if the fetching happens in a block with a execution mask random values may appear). CC: <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Add a dumb drm/kms winsys backed swrast providerGiovanni Campagna2014-07-301-0/+32
| | | | | | | | | | | | | | | | | | | | | | Add a new winsys and target that can be used with a dri2 state tracker and loader instead of drisw. This allows to use gbm as a dri2/image loader and avoid the extra copy from the backbuffer to the shadow frontbuffer. The new driver is called "kms_swrast", and is loaded by gbm as a fallback, because it is only useful with the gbm platform (as no buffer sharing is possible) To force select the driver set the environment variable GBM_ALWAYS_SOFTWARE [Emil Velikov] - Rebase on top of gallium megadriver. - s/text/test/ in configure.ac (Spotted by Andreas Pokorny). - Add scons support for winsys/sw/kms-dri and fix the build. - Provide separate DriverAPI, due to different InitScreen hook. Signed-off-by: Emil Velikov <[email protected]>
* os_process.c: Add cygwin as an expected platformYaakov Selkowitz2014-07-291-2/+2
| | | | | | | | | | | mesa/mesa/src/gallium/auxiliary/os/os_process.c:40:2: warning: #warning unexpected platform in os_process.c [-Wcpp] #warning unexpected platform in os_process.c mesa/mesa/src/gallium/auxiliary/os/os_process.c:77:2: warning: #warning unexpected platform in os_process.c [-Wcpp] #warning unexpected platform in os_process.c Signed-off-by: Yaakov Selkowitz <[email protected]> Reviewed-by: Jon TURNEY <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/util: add a helper for calculating primitive count from vertex countMarek Olšák2014-07-281-0/+15
| | | | | | This is needed by the following commit which is a candidate for stable too. Cc: [email protected]
* gallium: rename shader cap MAX_CONSTS to MAX_CONST_BUFFER_SIZEMarek Olšák2014-07-283-8/+8
| | | | | | | | | | This new name isn't so confusing. I also changed the gallivm limit, because it looked wrong. Reviewed-by: Brian Paul <[email protected]> v2: use sizeof(float[4])
* util: Fix typoTom Stellard2014-07-281-1/+1
| | | | Spotted by okias on IRC.
* util: Add util_memcpy_cpu_to_le32() v3Tom Stellard2014-07-281-0/+17
| | | | | | | | | | | v2: - Preserve word boundaries. v3: - Use const and restrict. - Fix indentation. Reviewed-by: Michel Dänzer <[email protected]>
* targets/dri: fix freedreno targetsRob Clark2014-07-231-2/+10
| | | | | | | The kernel driver name is either "kgsl" (downstream/android) or "msm" (upstream). Signed-off-by: Rob Clark <[email protected]>
* util/tgsi: Fix ureg_EMIT/ENDPRIM prototype.José Fonseca2014-07-151-2/+2
| | | | | | | | 0cbefc1bea703378381afff946e30c27a21f191d added a source argument to EMIT/ENDPRIM, but it did not update tgsi_ureg accordingly, causing all users of ureg_EMIT/ENDPRIM to fail at runtime with an assertion failure. Trivial.
* gallium: add INTERP_* opcodes to support interpolateAt*Ilia Mirkin2014-07-091-0/+4
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* targets/dri-swrast: Convert to static/shared pipe-driverEmil Velikov2014-07-101-0/+36
| | | | | | | | | | | | | Convert the final dri target to the single DRI (megadriver) library. Cleanup all the automake leftovers from the conversion stage and update the scons build. v2: Link in llvmpipe, when applicable. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: cleanup conversion leftoversEmil Velikov2014-07-101-8/+3
| | | | | | | | | | With all the users converted to __driGetExtensions_* we can have only a single inclusion of the required header + define. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: Add __driDriverGetExtensions_vmwgfxEmil Velikov2014-07-101-0/+12
| | | | | | | | | | | | Identical to previous commits - will bring us a step closer to megadrivers. Cc: Jose Fonseca <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: Add __driDriverGetExtensions_i965 symbolEmil Velikov2014-07-101-0/+12
| | | | | | | | | | | Identical to previous commits - will bring us a step closer to megadrivers. Cc: Chia-I Wu <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: Add __driDriverGetExtensions_i915 symbolEmil Velikov2014-07-101-0/+12
| | | | | | | | | | | Identical to previous commits - will bring us a step closer to megadrivers. Cc: Stephane Marchesin <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: Add __driDriverGetExtensions_freedreno symbolEmil Velikov2014-07-101-0/+12
| | | | | | | | | | | Identical to previous two commits - will bring us a step closer to megadrivers. Cc: Rob Clark <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: Add __driDriverGetExtensions_(r300|r600|radeonsi) symbolsEmil Velikov2014-07-101-0/+36
| | | | | | | | | | | | The symbol is introduced by the mesa megadrivers, and adding gallium support for it will allow us to merge st/dri/drm and st/dri/sw. Resulting in a single dri library across all of gallium. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* targets/dri: Add __driDriverGetExtensions_nouveau symbolEmil Velikov2014-07-101-0/+12
| | | | | | | | | | | | | The symbol is introduced by the mesa megadrivers, and adding gallium support for it will allow us to merge st/dri/drm and st/dri/sw. Resulting in a single dri library across gallium. v2: Rebase on top of gallium dri3. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Clark <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com> Acked-by: Tom Stellard <[email protected]>
* tgsi: add interpolation location modifier support to text parserIlia Mirkin2014-07-091-0/+17
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* gallium: switch dedicated centroid field to interpolation locationIlia Mirkin2014-07-098-15/+25
| | | | | | | | The new location field can be either center, centroid, or sample, which indicates the location that the shader should interpolate at. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/u_blitter: fix some shader memory leaksBrian Paul2014-07-091-0/+9
| | | | | | | The _msaa shaders weren't getting freed. Cc: "10.2" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* tgsi: properly parse indirect dimension references (e.g. for UBOs)Ilia Mirkin2014-07-091-0/+7
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: fix u_default_transfer_inline_write for texturesMarek Olšák2014-07-081-2/+2
| | | | | | | | | This doesn't fix any known issue. In fact, radeon drivers ignore all the discard flags for textures and implicitly do "discard range" for any write transfer. Cc: [email protected] Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: rename PIPE_CAP_TGSI_VS_LAYER to also have _VIEWPORTIlia Mirkin2014-07-031-1/+1
| | | | | | | | | Now that this cap is used to determine the availability of both, adjust its name to reflect the new reality. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: Add PIPE_SHADER_CAP_DOUBLESTom Stellard2014-07-022-0/+4
| | | | | | | This is for reporting whether or not double precision floating-point operations are supported. Reviewed-by: Francisco Jerez <[email protected]>
* target-helpers: don't use designated initializersRoland Scheidegger2014-07-021-4/+4
| | | | | | | | | it looks since ce1a1372280d737a1b85279995529206586ae480 they are now included in more places, in particular even for things buildable with msvc, and hence those break the build. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium/u_vbuf: get draw info from an indirect buffer if there's anyMarek Olšák2014-07-021-44/+72
| | | | This is required for fallbacks to work with ARB_draw_indirect.
* gallium: add facilities for indirect drawingChristoph Bumiller2014-07-023-0/+54
| | | | | | v2: Added comments to util_draw_indirect, clarified and fixed map size. Removed unlikely().
* gallium: add an index argument to create_queryIlia Mirkin2014-07-011-3/+3
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add vertex stream argument to EMIT/ENDPRIMIlia Mirkin2014-07-011-2/+2
| | | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* auxiliary/vl: Remove no longer used SPLIT_TARGETSEmil Velikov2014-06-261-8/+0
| | | | | | | | | Required for the conversion stage of all VL targets to a single library per API (static/shared pipe-drivers). No longer required as per last commit. Signed-off-by: Emil Velikov <[email protected]>
* draw: (trivial) fix clamping of viewport indexRoland Scheidegger2014-06-241-1/+1
| | | | | | | | | | | | | | The old logic would let all negative values go through unclamped, with potentially disastrous results (probably trying to fetch viewport values from random memory locations). GL has undefined rendering for vp indices outside valid range but that's a bit too undefined... (The logic is now the same as in llvmpipe.) CC: "10.1 10.2" <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Tested-by: Ilia Mirkin <[email protected]>
* targets/vdpau-nouveau: convert to static/shared pipe-driversEmil Velikov2014-06-222-1/+25
| | | | | | | | | | | | | | | | | | | | | | Create a single library (for the vdpau api) thus reducing the overall size of mesa. Current commit converts vdpau-nouveau, with upcomming commits handling the rest. The library can be built with the relevant pipe-drivers statically linked in, or loaded as shared modules. Currently we default to static. Add SPLIT_TARGETS to guard the other VL targets. Note: symlink handling is rather ugly and will need an update to work with BSD and other non-linux platforms. v2: Split the conversion into per-target basis. Cc: Maarten Lankhorst <[email protected]> Cc: Ilia Mirkin <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Thomas Helland <thomashelland90 at gmail.com>
* gallivm: Fix build after LLVM commit 211259Aaron Watry2014-06-201-1/+3
| | | | | Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* gallivm: set mcpu when initializing llvm execution engineRoland Scheidegger2014-06-191-2/+20
| | | | | | | | | | | | | | | Previously llvm detected cpu features automatically when the execution engine was created (based on host cpu). This is no longer the case, which meant llvm was then not able to emit some of the intrinsics we used as we didn't specify any sse attributes (only on avx supporting systems this was not a problem since despite at least some llvm versions enabling it anyway we always set this manually). So, instead of trying to figure out which MAttrs to set just set MCPU. This fixes https://bugs.freedesktop.org/show_bug.cgi?id=77493. Reviewed-by: Jose Fonseca <[email protected]> Tested-by: Vinson Lee <[email protected]>
* target-helpers: add dd_configuration(), dd_driver_name()Emil Velikov2014-06-191-0/+78
| | | | | | | | | | | Add a couple of helpers to be used by the dri targets when built with static pipe-drivers. Both functions provide functionality required by the dri state-tracker. With this patch ilo, nouveau and r300 gain support for throttle dri configuration. Signed-off-by: Emil Velikov <[email protected]>
* target-helpers: add dd_create_screen() helperEmil Velikov2014-06-191-0/+206
| | | | | | | | | | | Will be used by gallium targets that statically link the pipe-drivers in the final library. Provides identical functionality to device_descriptor.create_screan. v2: - Don't sw_screen_wrap the i915/svga screen. Signed-off-by: Emil Velikov <[email protected]>
* target-helpers: add a note about debug wrappersEmil Velikov2014-06-191-0/+4
| | | | | | | If memory serves me right, at least one debug wrapper does not return the base screen on failure. Signed-off-by: Emil Velikov <[email protected]>
* pipe-loader: add pipe_loader_ops::configuration()Emil Velikov2014-06-195-0/+53
| | | | | | | | | Required for the dri state-tracker. Will be used to retrieve driver specific configuration parameters: - share_fd (dmabuf) capability - throttle Signed-off-by: Emil Velikov <[email protected]>
* pipe-loader: note that we leak pipe_loader_drm_device->base->driver_nameEmil Velikov2014-06-191-0/+1
| | | | | | The string is malloc'd (strdup) in loader_get_driver_for_fd(). Signed-off-by: Emil Velikov <[email protected]>
* gallium: implement ARB_texture_query_levelsMarek Olšák2014-06-191-1/+1
| | | | | | | | | The extension is always supported if GLSL 1.30 is supported. Softpipe and llvmpipe support is also added (trivial). Radeon and nouveau support is already done. Reviewed-by: Roland Scheidegger <[email protected]>
* gallivm: fix SCALED -> NORM conversionsRoland Scheidegger2014-06-181-16/+23
| | | | | | | | | | | | | | | Such conversions (which are most likely rather pointless in practice) were resulting in shifts with negative shift counts and shifts with counts the same as the bit width. This was always undefined in llvm, the code generated was rather horrendous but happened to work. So make sure such shifts are filtered out and replaced with something that works (the generated code is still just as horrendous as before). This fixes lp_test_format, https://bugs.freedesktop.org/show_bug.cgi?id=73846. v2: prettify by using build context shift helpers. Reviewed-by: Jose Fonseca <[email protected]>