summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* draw: fix prim id float cast for non-llvm pathRoland Scheidegger2014-08-081-8/+4
| | | | | | | These values are always uints, casting them to floats does no good. Fixes piglit glsl-1.50-geometry-primitive-id-restart tests for softpipe. Reviewed-by: Brian Paul <[email protected]>
* clover: Add support for CL_MAP_WRITE_INVALIDATE_REGIONBruno Jiménez2014-08-082-0/+14
| | | | | | | | | | | | | | | | OpenCL 1.2 CL_MAP_WRITE_INVALIDATE_REGION sounds a lot like PIPE_TRANSFER_DISCARD_RANGE: From OpenCL 1.2 spec: The contents of the region being mapped are to be discarded. From p_defines.h: Discards the memory within the mapped region. v2: Move the code for validating flags to the front-end as suggested by Francisco Jerez Reviewed-by: Francisco Jerez <[email protected]>
* ilo: break down the format tableChia-I Wu2014-08-081-299/+431
| | | | | | | The PRMs no longer have a single table for format capabilities. Multiple tables take up less space, and are easier to maintain. Encode typed write information while at it.
* 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]>
* libgl-xlib: drop duplicate mesautil from scons buildEmil Velikov2014-08-051-1/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* llvmpipe/tests: automake: link against libmesautil.laEmil Velikov2014-08-051-5/+6
| | | | | | | Or the build will fail due to unresolved symbols. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* gallium/tests: automake: link against libmesautil.laEmil Velikov2014-08-052-0/+2
| | | | | | | Or the build will fail due to unresolved symbols. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* targets/omx: automake: link against libmesautil.laEmil Velikov2014-08-051-0/+1
| | | | | | | Or the build will fail due to unresolved symbols. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* targets/xvmc: automake: link against libmesautil.laEmil Velikov2014-08-051-0/+1
| | | | | | | Or the build will fail due to unresolved symbols. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* targets/clover: link against libmesautil.laJan Vesely2014-08-051-0/+1
| | | | | Signed-off-by: Jan Vesely <[email protected]> Reviewed-and-Tested-by: Michel Dänzer <[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]>
* targets/dri: link with mesautilRoland Scheidegger2014-08-051-0/+1
| | | | | | Similar to other recent build fixes. Reviewed-by: Emil Velikov <[email protected]>
* gallium/docs: Document TEX2/TXL2/TXB2 instructions and fix up other tex docRoland Scheidegger2014-08-051-25/+102
| | | | | | | | Add documentation for TEX2/TXL2/TXB2 tgsi opcodes. Also, the texture opcode documentation wasn't very accurate so fix this up a bit. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[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]>
* llvmpipe: implement support for cube map arraysRoland Scheidegger2014-08-055-4/+16
| | | | | | | | This just covers the resource side of things, not the actual sampling. Here things are trivial as cube map arrays are identical to 2d arrays in all respects. Reviewed-by: Brian Paul <[email protected]>
* targets/graw-gdi: link with mesautil, not mesautilsBrian Paul2014-08-041-1/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* targets/libgl-gdi: link with mesautilBrian Paul2014-08-041-0/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* targets/egl-static: link with libmesautil.laBrian Paul2014-08-041-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* targets/vdpau: link with libmesautil.la to fix build breakageBrian Paul2014-08-041-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* svga: SVGA_3D_CMD_BIND_GB_SHADER needs to reserve two relocations.Matthew McClure2014-08-041-1/+1
| | | | | | | | | | | | With this patch, the SVGA_3D_CMD_BIND_GB_SHADER functionality will reserve two relocations, one for the shader ID and the second for the MOB ID. Verified with the WDDM winsys path that the number of relocations and patch locations required is two. Fixes Bug 1277406 Reviewed-by: Charmaine Lee <[email protected]>
* gallium: Add libmesautil dependency to gdm and xa targetsJason Ekstrand2014-08-042-0/+2
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: Move sRGB <-> RGB handling to libmesautilJason Ekstrand2014-08-0417-322/+14
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-049-4/+7
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Move ralloc to a new src/util directory.Kenneth Graunke2014-08-043-1/+5
| | | | | | | | | | | | | | | | | | For a long time, we've wanted a place to put utility code which isn't directly tied to Mesa or Gallium internals. This patch creates a new src/util directory for exactly that purpose, and builds the contents as libmesautil.la. ralloc seemed like a good first candidate. These days, it's directly used by mesa/main, i965, i915, and r300g, so keeping it in src/glsl didn't make much sense. Signed-off-by: Kenneth Graunke <[email protected]> v2 (Jason Ekstrand): More realloc uses and some scons fixes Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* targets/dri: resolve the scons buildEmil Velikov2014-08-041-0/+1
| | | | | | | | | | | With earlier commit we've conditionally enabled/added the kms_dri target for automake builds. Unfortunately the we forgot to add the appropriate define in the scons build, resulting in a broken library due to the undefined symbol 'kms_swrast_create_screen'. Reported-by: Roland Scheidegger <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Roland Scheidegger <[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]>
* st/dri: Fix driver loading if swrast isn't builtAaron Watry2014-08-031-0/+4
| | | | | | | | | | | | | | | | | | | | If building hardware drivers only, then kms_swrast_create_screen won't be defined in inline_drm_helper.h and hardware drivers will fail to dlopen as a result. Copy the #if guards from inline_drm_helper.h to dri_kms_init_screen to make the definition/use of the function match. Fixes radeonsi_dri.so dlopen with the following configure: ./configure --with-dri-drivers= --with-dri-driverdir=/usr/local/lib/dri/ \ --enable-gbm --enable-gallium-gbm --enable-debug --enable-opencl \ --enable-opencl-icd --with-gallium-drivers=radeonsi \ --with-egl-platforms=drm --enable-glx-tls --enable-texture-float \ --enable-omx Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Remove XA state tracker support for RadeonMarek Olšák2014-08-031-32/+0
| | | | | | | We don't support this type of X acceleration and we never did. Other drivers might want to do the same thing. Reviewed-by: Emil Velikov <[email protected]>
* llvmpipe: don't store number of layers per levelRoland Scheidegger2014-08-012-78/+50
| | | | | | | | | | | | | | | | This could be recalculated, though it turns out the only use of it after resource allocation is for calculating whole resource size (for scene size accounting though that isn't quite ideal neither). Thus, instead just store the whole resource size and drop it (saving a couple bytes of storage per resource). It makes things simpler too. Note that for the accounting winsys resources always come back with size 0 but this is unchanged (we don't actually know the size in any case). Also reformat llvmpipe_texture_layout (drop unneded indentation). v2: adapt to previous changes. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: integrate memory allocation into llvmpipe_texture_layoutRoland Scheidegger2014-08-011-45/+29
| | | | | | | | | | | | | | | Seems pointless to just duplicate some of the calculations (the calculation of actual memory used compared to what was predicted in llvmpipe_texture_layout actually could have differed slightly in some cases due to different alignment rules used though this should have been of no consequence). v2: keep the previous mip alignment of MAX2(64, cacheline). This was added for ARB_map_buffer_alignment - I'm not convinced it's needed for textures, but it was supposed to be cleanup without functional change. Also replace div with 64bit mul / comparison. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: get rid of impossible code in alloc_image_dataRoland Scheidegger2014-08-011-26/+13
| | | | | | | Only used for non display target resources. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* r600g: Implement gpu_shader5 textureGatherGlenn Kennard2014-08-012-5/+36
| | | | | | | | | | | | | | | Adds 0-3 textureGather component selection and non-constant offsets Caveat: 0 and 1 texture swizzles only work if textureGather component select is 3 or a component that does not exist in the sampler texture format. This is a hardware limitation, any other value returns 128/255=0.501961 for both 0 and 1. Passes all textureGather piglit tests on radeon 6670, except for those using 0/1 texture swizzles due to aforementioned reason. Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* r600g/radeonsi: Prefer VRAM for CPU -> GPU streaming buffersMichel Dänzer2014-08-011-4/+11
| | | | Reviewed-by: Marek Olšák <[email protected]>
* r600g/radeonsi: Reduce or even drop special treatment of persistent mappingsMichel Dänzer2014-08-011-4/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* target-helpers: Do not build kms_dri on libdrm-less platforms.Jon TURNEY2014-08-012-0/+3
| | | | | | | | Fix build since 3b176c441b7ddc5f7d2f891da3f76cf3c1814ce1 for dri_platform=none hosts. Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* r600g: gpu_shader5 gl_SampleMaskIn supportGlenn Kennard2014-07-312-7/+40
| | | | | | | | Map TGSI_SEMANTIC_SAMPLEMASK to register/component. Enable face register when sample mask is needed by shader. Requires Evergreen/Cayman Reviewed-by: Alex Deucher <[email protected]>
* r600g: Implement gpu_shader5 integer opsGlenn Kennard2014-07-311-0/+190
| | | | Reviewed-by: Alex Deucher <[email protected]>
* r600g: Add IMUL_HI/UMUL_HI supportGlenn Kennard2014-07-311-6/+6
| | | | | | | Fixes fs-imulExtended, fs-imulExtended-only-msb, fs-umulExtended, fs-umulExtended-only-msb piglit tests. Reviewed-by: Alex Deucher <[email protected]>
* r600g: Implement GL_ARB_texture_query_lodGlenn Kennard2014-07-312-2/+13
| | | | | | | | Requires Evergreen or later v2 (Andreas): Update relnotes/10.3 Reviewed-by: Alex Deucher <[email protected]> (v1)
* 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]>
* dri: Add a new capabilities for drivers that can't share buffersGiovanni Campagna2014-07-304-8/+32
| | | | | | | | | | | | | | | | | | | The kms-dri swrast driver cannot share buffers using the GEM, so it must tell the loader to disable extensions relying on that, without disabling the image DRI extension altogether (which would prevent the loader from working at all). This requires a new gallium capability (which is queried on the pipe_screen and for swrast drivers it's forwarded to the winsys), and requires a new version of the DRI image extension. [Emil Velikov] - Rebased on top of gallium-dri megadrivers. - Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook. The can_share_buffer cap is set at InitScreen. We use a different InitScreen (and thus value for the cap) function for kms_dri, due to deeper differences originating from dri megadrivers. Signed-off-by: Emil Velikov <[email protected]>
* gallium: Add a dumb drm/kms winsys backed swrast providerGiovanni Campagna2014-07-3011-0/+523
| | | | | | | | | | | | | | | | | | | | | | 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]>
* st/gbm: don't segfault if the fail to create the screenEmil Velikov2014-07-301-1/+1
| | | | | | | Whenever dd_create_screen/pipe_loader_* fails, gdrm->dev may be NULL. Thus peeking inside the struct will lead to a crash. Signed-off-by: Emil Velikov <[email protected]>
* st/gbm: retrieve the driver-name via dd_driver_name()Emil Velikov2014-07-301-0/+6
| | | | | | | ... on static targets. Otherwise we'll crash badly as gdrm->dev is NULL when we try to copy the string driver_name. 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]>
* svga: remove unneeded depth==1 assertion in svga_texture_view_surface()Brian Paul2014-07-291-1/+0
| | | | | | | We can create 3D texture views. Avoids an assertion in piglit fbo-generatemipmap-3d test and allows it to pass. Reviewed-by: Charmaine Lee <[email protected]>
* st/wgl: Clamp wglChoosePixelFormatARB's output nNumFormats to nMaxFormats.José Fonseca2014-07-291-2/+4
| | | | | | | | | | | | | | While running https://github.com/nvMcJohn/apitest with apitrace I noticed that Mesa was producing bogus results: wglChoosePixelFormatARB(hdc, piAttribIList = {...}, pfAttribFList = &0, nMaxFormats = 1, piFormats = {19, 65576, 37, 198656, 131075, 0, 402653184, 0, 0, 0, 0, -573575710}, nNumFormats = &12) = TRUE However https://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt states <nNumFormats> returns the number of matching formats. The returned value is guaranteed to be no larger than <nMaxFormats>. Cc: "10.2" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/radeon: Add some Emacs .dir-locals.el filesMichel Dänzer2014-07-294-0/+45
| | | | | | Based on the toplevel one but adapted to the driver/winsys coding styles. Reviewed-by: Marek Olšák <[email protected]>