path: root/src/gallium
AgeCommit message (Collapse)AuthorFilesLines
2014-10-03st/xa: Fix regression in xa_yuv_planar_blit()Thomas Hellstrom2-0/+12
Commit "st/xa: scissor to help tilers" broke xa_yuv_planar_blit() and vmwgfx textured video. Fix this by implementing scissors also in the yuv draw path. Signed-off-by: Thomas Hellstrom <> Reviewed-by: Sinclair Yeh <> Cc: Rob Clark <> Cc: "10.2 10.3" <> (cherry picked from commit 46537f1d03ba6de83be70ac574f633bb4342a327)
2014-09-28st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variablesMarek Olšák1-35/+0
Some users don't understand that these variables can break OpenGL. The general is rule is that if an app supports MSAA, you mustn't use GALLIUM_MSAA. For example, if an app has an 8xMSAA FBO and GALLIUM_MSAA=4 is set, resolving the FBO to the back buffer will be rejected which will look like this on all gallium drivers: The environment variables also have no effect on modern apps like TF2, but there is still a performance hit due to wasted bandwidth and VRAM. In a nutshell, it does more harm than good. Cc: 10.2 10.3 <> Reviewed-by: Michel Dänzer <> (cherry picked from commit 8449121971ce1db03fea19665d314e523fdc10dd)
2014-09-27radeonsi: properly destroy the GS copy shader and scratch_bo for computeMarek Olšák2-3/+7
Cc: 10.2 10.3 <> Reviewed-by: Michel Dänzer <> (cherry picked from commit dc05a9e4e089d66a2ffe8919857ad9660e108c28) [Emil Velikov: remove unref scratch_bo, s/si_shader/si_pipe_shader/] Signed-off-by: Emil Velikov <>
2014-09-27radeonsi: release GS rings at context destructionMarek Olšák1-0/+2
Cc: 10.2 10.3 <> Reviewed-by: Michel Dänzer <> (cherry picked from commit 711623f7c8113d43f2d54ebfe5cbed3d406a3c79) [Emil Velikov: s/ring/ring.buffer/] Signed-off-by: Emil Velikov <>
2014-09-27nv50/ir: avoid deleting pseudo instructions too earlyIlia Mirkin1-1/+10
What happens is that a SPLIT operation is part of the spill node, and as a pseudo op, the instruction gets erased after processing its first def. However the later defs still need to refer to it, so instead delay deleting until after that whole RA node is done processing. Bugzilla: Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 0147c10c5f00b43696ba660aab604d674a75e83c)
2014-09-27gallivm: fix idivRoland Scheidegger1-7/+5
ffeb77c7b0552a8624e46e65d6347240ac5ae84d had a typo which turned all signed integer divisions into unsigned ones. Oops. This gets us back the 51 little piglits (all from glsl built-in-functions, fs/vs/gs-op-div-int-ivec2 and similar). Cc: "10.2 10.3" <> Reviewed-by: Jose Fonseca <> (cherry picked from commit 5e1fcc625824ae962d5f658e151e6bc2665adce8)
2014-09-23gallivm,tgsi: fix idiv by zero crashrconde2-7/+25
While the result of signed integer division by zero is undefined by glsl (and doesn't exist with d3d10), we must not crash, so need to make sure we don't get sigfpe much like udiv already does. Unlike udiv where we return 0xffffffff (as required by d3d10) there is no requirement right now to return anything specific so we use zero. (cherry picked from commit ffeb77c7b0552a8624e46e65d6347240ac5ae84d) Nominated-by: Roland Scheidegger <> Bugzilla:
2014-09-17gallivm: set mcpu when initializing llvm execution engineRoland Scheidegger1-2/+24
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 Reviewed-by: Jose Fonseca <> Tested-by: Vinson Lee <> (cherry picked from commit cad60420d5ea36a4b6fa2e6c91317f71423aa63e) Conflicts: src/gallium/auxiliary/gallivm/lp_bld_misc.cpp Nominated-by: Laurent Carlier <> Bugzilla:
2014-09-17gallivm: Disable workaround for PR12833 on LLVM 3.2+.José Fonseca1-2/+2
Fixed upstream. (cherry picked from commit 172ef0c5a5a97c211702eb4033eeaac20993350e) Nominated-by: Evangelos Foutras <> Bugzilla:
2014-09-17gallivm: Fix uses of 2^24Richard Sandiford1-4/+4
Fallback cases in lp_bld_arit.c used 2^24 to mean "2 to the power 24", but in C it's "2 xor 24", i.e. 26. Fixed by using 1<< instead. Signed-off-by: Richard Sandiford <> Reviewed-by: Roland Scheidegger <> Cc: "10.2 10.3" <> Signed-off-by: Dave Airlie <> (cherry picked from commit 1a65629ccc590fe04a97b6df63d73e349b793619)
2014-09-17nouveau: remove unneeded assertMaarten Lankhorst1-1/+0
No idea why it was added, but the code runs fine even on videos where it triggers. Signed-off-by: Maarten Lankhorst <> Cc: "10.2 10.3" <> (cherry picked from commit 8ab85bfcd5ddd44c50e5b384222731cb2a1a1496)
2014-09-17nouveau: rework reference frame handlingMaarten Lankhorst3-4/+37
Fixes a regression from "nouveau/vdec: small fixes to h264 handling" New picking order for frames: 1. Vidbuf pointer matches. 2. Take the first kicked ref. 3. If that fails, take a ref that has a different last_used. Signed-off-by: Maarten Lankhorst <> Cc: "10.2 10.3" <> (cherry picked from commit a41aad843108cec1901c88a76d5ceb4ede2e062b)
2014-09-17nouveau: fix MPEG4 hw decodingMaarten Lankhorst1-3/+3
Reorder some fields to make I-frame decoding work correctly. Signed-off-by: Maarten Lankhorst <> Cc: "10.2 10.3" <> (cherry picked from commit 121ceb38f45daacc938349d9d5aa82776b78dbab)
2014-09-17nouveau: re-allocate bo's on overflowMaarten Lankhorst4-11/+87
The BSP bo might be too small to contain all of the bsp data, bump its size on overflow. Also bump inter_bo when this happens, it might be too small otherwise. Signed-off-by: Maarten Lankhorst <> Cc: "10.2 10.3" <> (cherry picked from commit f6afed7076a6ef446dbec7cb10c8f8c60efafccd)
2014-09-09nv50/ir: avoid array overrun when checking for supported modsIlia Mirkin2-2/+2
Reported by Coverity Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 874a9396c5adfdcff63139bf6ababb55c1253402)
2014-09-09gallivm: Fix build after LLVM commit 211259Aaron Watry1-1/+3
Signed-off-by: Aaron Watry <> Reviewed-by: Tom Stellard <> (cherry picked from commit 564821c917f4a9d5a0de2ee77b90b0cd85e3d3a6) Nominated-by: Emil Velikov <> Bugzilla:
2014-09-09nvc0/ir: clarify recursion fix to finding first tex usesChristoph Bumiller1-9/+7
This is a simple shader for reproducing the case mentioned: FRAG DCL IN[0], GENERIC[0], PERSPECTIVE DCL OUT[0], COLOR DCL SAMP[0] DCL CONST[0] DCL TEMP[0..1], LOCAL IMM[0] FLT32 { 0.0000, -1.0000, 1.0000, 0.0000} 0: MOV TEMP[0].x, CONST[0].wwww 1: MOV TEMP[1].x, CONST[0].wwww 2: BGNLOOP 3: IF TEMP[0].xxxx 4: BRK 5: ENDIF 6: ADD TEMP[0].x, TEMP[0], IMM[0].zzzz 7: IF CONST[0].xxxx 8: TEX TEMP[1].x, CONST[0], SAMP[0], 2D 9: ENDIF 10: IF CONST[0].zzzz 11: MOV TEMP[1].x, CONST[0].zzzz 12: ENDIF 13: ENDLOOP 14: MOV OUT[0], TEMP[1].xxxx 15: END Cc: "10.2 10.3" <> Reviewed-by: Ilia Mirkin <> (cherry picked from commit ca9ab05d45ebf407485af2daa3742b897ff99162)
2014-09-09nv50/ir/util: fix BitSet issuesChristoph Bumiller3-3/+10
BitSet::allocate() is being used with the expectation that it would leave the bitfield untouched if its size hasn't changed, however, the function always zeroed the last word, which led to obscure bugs with live set computation. This also fixes BitSet::resize(), which was broken, but luckily not being used. Cc: "10.2 10.3" <> Reviewed-by: Ilia Mirkin <> (cherry picked from commit b9f9e3ce03dbd8d044a72a00e1e8856a500b5f72)
2014-09-08r600g,radeonsi: make sure there's enough CS space before resuming queriesMarek Olšák1-0/+28
Bugzilla: Cc: "10.2 10.3" <> Reviewed-by: Michel Dänzer <> (cherry picked from commit 3dbf55c1be5a8867616e475d943c776d8245d0cc)
2014-09-08winsys/svga: Fix incorrect type usage in IOCTL v2Thomas Hellstrom1-4/+9
While similar in layout, the size of the SVGA3dSize type may be smaller than the struct drm_vmw_size type that is part of the ioctl interface. The kernel driver could accordingly overwrite a memory area following the size variable on the stack. Typically that would be another local variable, causing breakage in, for example, ubuntu 12.04.5 where the handle local variable becomes overwritten. v2: Fix whitespace errors Signed-off-by: Thomas Hellstrom <> Reviewed-by: Jakob Bornecrantz <> Cc: "10.1 10.2 10.3" <> (cherry picked from commit 2d6206140afe9ecb551822ea00c36eeeef7edfbf)
2014-09-02radeonsi: Don't use anonymous struct trick in atom trackingAdam Jackson6-10/+10
I'm somewhat impressed that current gccs will let you do this, but sufficiently old ones (including 4.4.7 in RHEL6) won't. Reviewed-by: Marek Olšák <> Signed-off-by: Adam Jackson <> (cherry picked from commit 74388dd24bc7fdb9e62ec18096163f5426e03fbf) Nominated-by: Jonathan Gray <> Bugzilla:
2014-09-02nv50: attach the buffer bo to the miptree structuresIlia Mirkin1-8/+5
The current code... makes no sense. Use nouveau_bo_ref to attach the bo to the exposed resource so as to have the proper lifetime guarantees. Tested-by: Emil Velikov <> Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 2c440433130d3c64635684355a3667d145a188e3)
2014-09-02nv50: mt address may not be the underlying bo's start addressIlia Mirkin3-12/+14
With VP2, nv50_miptree is faked because the underlying bo's have to be laid out in a certain way. This is done by adjusting the address. Make sure that blits (and everything else for consistency) use the mt address rather than the bo address as a base. This fixes retrieving chroma plane with VDPAU. Bugzilla: Tested-by: Emil Velikov <> Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 9d52e551a5874e54bc80f306bf3cacbad2441315)
2014-09-02nv50: set the miptree address when clearing bo's in vp2 initIlia Mirkin1-0/+2
The mt address is about to be used more, make sure it's set appropriately. Reported-by: Emil Velikov <> Tested-by: Emil Velikov <> Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 2528d402b9e35601d4631cd80a301bacd87dfc95)
2014-09-02nv50/ir: avoid creating instructions that can't be emittedIlia Mirkin1-0/+4
When constant folding a MAD operation, we first fold the multiply and generate an ADD. However we do so without making sure that the immediate can be handled in the saturate case. If it can't, load the immediate in a separate instruction. Reported-by: Tiziano Bacocco <> Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 6c2b079231f84b09b3f35183930afe522baee168)
2014-09-02nvc0: don't make 1d staging textures linearIlia Mirkin1-1/+0
Experimentally, the sampler doesn't appear to like these, neither as buffer nor as rect textures. So remove 1D from the list of texture types to make linear when used for staging. This fixes the OSD in mplayer for VDPAU. Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 115d9a5525e74573ced9209063a1d4a551e6eaa4)
2014-09-02nv50: zero out unbound samplersIlia Mirkin1-2/+5
Samplers are only defined up to num_samplers, so set all samplers above nr to NULL so that we don't try to read them again later. Tested-by: Christian Ruppert <> Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit 362cd26960aff2e997584064443dcc0418516ae6)
2014-09-02nvc0/ir: avoid infinite recursion when finding first uses of texIlia Mirkin1-8/+28
In certain circumstances, findFirstUses could end up doubling back on instructions it had already processed, resulting in an infinite recursion. Avoid this by keeping track of already-visited instructions. Bugzilla: Tested-by: Tobias Klausmann <> Signed-off-by: Ilia Mirkin <> Cc: "10.2 10.3" <> (cherry picked from commit c4bb436f7660c951cd27e52660cf825da68793e5) Conflicts: src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h
2014-09-02gallivm: Fix build with LLVM >= 3.6 r215967.Vinson Lee1-0/+4
This LLVM 3.6 commit changed EngineBuilder constructor. commit 3f4ed32b4398eaf4fe0080d8001ba01e6c2f43c8 Author: Rafael Espindola <> Date: Tue Aug 19 04:04:25 2014 +0000 Make it explicit that ExecutionEngine takes ownership of the modules. git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8 Signed-off-by: Vinson Lee <> Reviewed-and-Tested-by: Michel Dänzer <> (cherry picked from commit c04a6d5c298f102469df45a7dbe81f40c6faed5f) Nominated-by: Marek Olšák <>
2014-09-02gallivm: Fix build with latest LLVMJan Vesely1-0/+8
Signed-off-by: Jan Vesely <> Reviewed-and-Tested-by: Michel Dänzer <> (cherry picked from commit e28136343b6aa7dfff8ec85f6463574d6625b5a6) Nominated-by: Marek Olšák <> Conflicts: src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
2014-09-02winsys/radeon: fix nop packet padding for hawaiiAndreas Boll3-29/+44
// Marek - merged cce58147eb1450a26c03756af37da52d180580c4 into this one The initial firmware for hawaii does not support type3 nop packet. Detect the new hawaii firmware with query RADEON_INFO_ACCEL_WORKING2. If the returned value is 3, then the new firmware is used. This patch uses type2 for the old firmware and type3 for the new firmware. It fixes the cases when the old firmware is used and the user wants to manually enable acceleration. The two possible scenarios are: - the kernel has no support for the new firmware. - the kernel has support for the new firmware but only the old firmware is available. Additionaly this patch disables GPU acceleration on hawaii if the kernel returns a value < 2. In this case the kernel hasn't the required fixes for proper acceleration. v2: - Fix indentation - Use private struct radeon_drm_winsys instead of public struct radeon_info - Rename r600_accel_working2 to accel_working2 v3: - Use type2 nop packet for returned value < 3 v4: - Fail to initialize winsys for returned value < 2 Cc: Cc: Alex Deucher <> Cc: Jérôme Glisse <> Cc: Marek Olšák <> Cc: Michel Dänzer <> Signed-off-by: Andreas Boll <> Signed-off-by: Alex Deucher <> (cherry picked from commit 36771dc60fc3934b326eeff4aa6d3a4d438222eb) Conflicts: src/gallium/winsys/radeon/drm/radeon_drm_winsys.c Also squashed together with: winsys/radeon: fix hawaii accel_working2 comment accel_working2 returns 3 if the new firmware is used. The comment wasn't updated in v3 of commit: 36771dc winsys/radeon: fix nop packet padding for hawaii Signed-off-by: Andreas Boll <> Reviewed-by: Alex Deucher <> (cherry picked from commit 64c379a3a8e397bf949705efecfc745ec4d7a843)
2014-08-27r600g/compute: Don't initialize vertex_buffer_state masks to 0x2Tom Stellard1-3/+0
cs_vertex_buffer_state.enabled_mask and cs_vertex_buffer_state.dirty_mask are both updated when r600_set_constant_buffer() is called, so we don't need to manually update these values. This fixes a crash with OpenCL programs that have a kernel with no arguments. CC: "10.2" <> (cherry picked from commit bf7a60f41d897be4d9804ba7c46633e38501ffe7)
2014-08-27pipe-loader: Fix memory leak v2Tom Stellard2-1/+2
v2: - Change driver_name to char* Reviewed-by: Emil Velikov <> CC: "10.2" <> (cherry picked from commit 43d954342e02a2bd719e543d567fd6c43b3e5367) Conflicts: src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
2014-08-27radeon: Add work-around for missing Hainan support in clang < 3.6 v2Tom Stellard1-1/+14
v2: - Add missing break. CC: "10.2" <> (cherry picked from commit 8109664dedee588dc98c9a7c25bd40c0eb56c35f)
2014-08-27radeonsi: save scissor state and sample mask for u_blitterMarek Olšák3-8/+29
Cc: Reviewed-by: Michel Dänzer <> (cherry picked from commit 7792f9858b60fd9f9f037f1aa15dd21cba30f2c4)
2014-08-27r600g: fix constant buffer fetchesMarek Olšák1-0/+1
Somebody forgot to do this. It was uncovered by recent st/mesa changes. Bugzilla: Cc: Reviewed-by: Alex Deucher <> Tested-by: Andreas Boll <> (cherry picked from commit da9c3ed304be5d08ff989d61c6e2d1be8a845767)
2014-08-27clover: Flush the command queue in clReleaseCommandQueue()Tom Stellard1-1/+5
This is required by the spec. Reviewed-by: Francisco Jerez <> CC: "10.2" <> (cherry picked from commit ed3f7eadad1527447df14ee0c33fdf75fcad47b1)
2014-08-27radeonsi/compute: Call si_pm4_free_state() after emitting compute stateTom Stellard1-1/+1
This will decrement the reference count for buffers referenced in the command stream will prevent us from leaking them. CC: "10.2" <> (cherry picked from commit 1e2e55067117f02542f4aa4b9a15b8eca81c1274)
2014-08-27radeonsi/compute: Update reference counts for buffers in si_set_global_binding()Tom Stellard1-2/+2
CC: "10.2" <> (cherry picked from commit 05e9681d5524981db623c077708816476553f908) Conflicts: src/gallium/drivers/radeonsi/si_compute.c
2014-08-27radeon/compute: Fix reported values for MAX_GLOBAL_SIZE and MAX_MEM_ALLOC_SIZETom Stellard1-13/+19
There is a hard limit in older kernels of 256 MB for buffer allocations, so report this value as MAX_MEM_ALLOC_SIZE and adjust MAX_GLOBAL_SIZE to statisfy requirements of OpenCL. CC: "10.2" <> (cherry picked from commit 77ea58ca81eb3f5521d67c4459d3469df6d5ffd8)
2014-08-25android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}Emil Velikov1-4/+0
Upstream Android (system/core) has dropped these formats with commit 6bac41f1bf9(get rid of HAL pixelformats 5551 and 4444) yet does not mention why. These formats never really worked so we're safe to drop them as well. Identical commit is available in the android-x86 external/mesa repo commit 06a2d36edcd1e2247440e5800e6bf3028f37aee6 Author: Chih-Wei Huang <> Date: Wed Sep 25 01:16:57 2013 +0800 android: get rid of HAL pixelformats 5551 and 4444 Cc: "10.1 10.2" <> Signed-off-by: Emil Velikov <> (cherry picked from commit dfa6dc5eb8e76953bfc45a966813f736b0aa2346)
2014-08-25android: gallium/auxiliary: drop log2/log2f redefitionsEmil Velikov1-22/+0
Recent versions of bionic has picked up support for these functions, leading to build issues due to the redefition of the symbols. Note: wrapping things in #ifdef does not cut it :\ Identical patch is available in chromium, android-x86 and perhaps other projects. commit 66c1c789ce3407472de9ed620c9f815639058835 Author: Date: Wed Apr 02 10:59:34 2014 +0000 Porting to x64 Android. Remove redefinitions of log2 and log2f. BUG= Review URL: commit 9cc0a0d2b0499556680b182888af86f29d4ec30b Author: Chih-Wei Huang <> Date: Sun Jul 21 23:04:19 2013 +0800 android: remove log2, log2f The functions are already defined in the latest bionic. Cc: Chia-I Wu <> Cc: "10.1 10.2" <> Signed-off-by: Emil Velikov <> Acked-by: Chia-I Wu <> (cherry picked from commit 51a9a09ba8ca9a9d7bc00e3fac281a11cc94fd02)
2014-08-25android: egl/main: add/enable freedrenoEmil Velikov1-0/+3
For all everyone willing to give the freedreno driver a go they can now build it under Android. Cc: "10.1 10.2" <> Cc: Rob Clark <> Cc: Signed-off-by: Emil Velikov <> (cherry picked from commit 792041ebe5d6ccfdd03cf6903f4942aa115387c6)
2014-08-25android: gallium/freedreno: add preliminary buildEmil Velikov3-0/+86
For all the people interested in testing the freedreno driver on their Android devices. The next commit will hook these up within the libEGL driver (via the gallium-egl backend). There may be some rough edges but those can be sorted when a willing builder/tester comes along. v2: - s/freefreno/freedreno/. Spotted by Matt Turner. - Use the installed libdrm headers. Cc: "10.1 10.2" <> Cc: Rob Clark <> Cc: Signed-off-by: Emil Velikov <> (cherry picked from commit bf05e067577a8d8e87a377dfb357806b67b6afca)
2014-08-25automake: gallium/freedreno: drop spurious include dirsEmil Velikov2-4/+2
Rather than including two extra folders only for two headers, just prefix the headers and be done with it. Cc: "10.1 10.2" <> Cc: Rob Clark <> Cc: Signed-off-by: Emil Velikov <> Reviewed-by: Rob Clark <> (cherry picked from commit 458d03a4a4cebe7b9e9ea265d18bfc547bc4b49c) Conflicts: src/gallium/drivers/freedreno/
2014-08-25android: gallium/radeon: attempt to fix the android buildPaulo Sergio Travaglia6-7/+45
- include the correct folders - add a new buildscript for the common radeon folder v2: Use the installed libdrm headers over the DRM_TOP ones. Cc: "10.1 10.2" <> [Emil Velikov] Split up and add commit message. Signed-off-by: Emil Velikov <> (cherry picked from commit 5bbfa308c918ee40ec4deea91362688d325886f9)
2014-08-25android: gallium/nouveau: fix include folders, link against libstlportEmil Velikov2-8/+6
nouveau uses STL for a while now thus we need to include external/stlport/ in order to get the build at least partially working. v2: Use the installed libdrm headers over the DRM_TOP ones. Cc: "10.1 10.2" <> Signed-off-by: Emil Velikov <> (cherry picked from commit 6b510c63383a421eabe0d6e7b0249dbab85cffde)
2014-08-11radeonsi: fix CMASK and HTILE allocation on TahitiMarek Olšák2-3/+56
Tahiti has 12 tile pipes, but P8 pipe config. It looks like there is no way to get the pipe config except for reading GB_TILE_MODE. The TILING_CONFIG ioctl doesn't return more than 8 pipes, so we can't use that for Hawaii. This fixes a regression caused by fcb6c0d2b8cb36c3d1b7cbbf3437aeb65a808682 (cherry picked from 9b046474c95f15338d4c748df9b62871bba6f36f as part of Mesa 10.2.5) on Tahiti. v2: add an assertion and print an error on failure Cc: Reviewed-by: Michel Dänzer <> (cherry picked from commit 955505f6ff1c8bba7eb142200d3bd065eb4d2297)
2014-08-11radeonsi: fix a hang with instancing in Unigine Heaven/Valley on HawaiiMarek Olšák1-5/+2
This isn't documented anywhere, but it's the only thing that works for this case. Cc: Reviewed-by: Alex Deucher <> (cherry picked from commit 515269b3a73cd64ac9c017e8b3c698be9a5383f6) Conflicts: src/gallium/drivers/radeonsi/si_state_draw.c
2014-08-06gallivm: fix up out-of-bounds level when using conformant out-of-bound behaviorRoland Scheidegger1-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: <> Reviewed-by: Jose Fonseca <> (cherry picked from commit 5a12155503c9cd0cc77b0a0e52bc563c39631275)