summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)Anuj Phogat2014-04-161-1/+1
| | | | | | | | | | | | | | | mesa currently returns 4 when GL_VERTEX_ATTRIB_ARRAY_SIZE is queried for a vertex array initially set up with size=GL_BGRA. This patch makes changes to return size=GL_BGRA as required by the spec. Fixes Khronos OpenGL CTS test: vertex_array_bgra_basic.test V2: Use array->Format instead of adding a new variable Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: <[email protected]>
* Revert "i965/fs: Only sweep NOPs if register coalescing made progress."Matt Turner2014-04-151-8/+7
| | | | | | This reverts commit f092e8951ce5212ba3cbb382ce3a6666eb6c9bed. Didn't mean to push this...
* i965/fs: Only sweep NOPs if register coalescing made progress.Matt Turner2014-04-151-7/+8
| | | | Otherwise there's nothing to do.
* i965: Fix buffer overruns in MSAA MCS buffer clearing.Eric Anholt2014-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This manifested as rendering failures or sometimes GPU hangs in compositors when they accidentally got MSAA visuals due to a bug in the X Server. Today we decided that the problem in compositors was equivalent to a corruption bug we'd noticed recently in resizing MSAA-visual glxgears, and debugging got a lot easier. When we allocate our MCS MT, libdrm takes the size we request, aligns it to Y tile size (blowing it up from 300x300=900000 bytes to 384*320=122880 bytes, 30 pages), then puts it into a power-of-two-sized BO (131072 bytes, 32 pages). Because it's Y tiled, we attach a 384-byte-stride fence to it. When we memset by the BO size in Mesa, between bytes 122880 and 131072 the data gets stored to the first 20 or so scanlines of each of the 3 tiled pages in that row, even though only 2 of those pages were allocated by libdrm. In the glxgears case, the missing 3rd page happened to consistently be the static VBO that got mapped right after the first MCS allocation, so corruption only appeared once window resize made us throw out the old MCS and then allocate the same BO to back the new MCS. Instead, just memset the amount of data we actually asked libdrm to allocate for, which will be smaller (more efficient) and not overrun. Thanks go to Kenneth for doing most of the hard debugging to eliminate a lot of the search space for the bug. Cc: "10.0 10.1" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77207 Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for MSAA resolves from 2D_MS_ARRAY textures.Eric Anholt2014-04-152-17/+49
| | | | | | | | | We don't have any piglit tests for this currently. v2: Use vec3s for the texcoords so it has some hope of working. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add an accelerated glCopyTexSubImage using glBlitFramebuffer.Eric Anholt2014-04-154-12/+94
| | | | | | | | | | | | | | | You'll note from the previous commits that there's something of a loop here: You call CTSI, which calls BlitFB, then if things go wrong that falls back to CTSI. As a result, meta CTSI reaches over into blitfb to tell it "no, don't try that fallback". v2: Drop the _mesa_update_state(), which was only necessary due to use of _mesa_clip_blit() in _mesa_meta_BlitFramebuffer() in another patch series. v3: Drop an _EXT suffix I copy-and-pasted. Reviewed-by: Ian Romanick <[email protected]> (v2) Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Add support for CUBE_MAP_ARRAY to generatemipmap.Eric Anholt2014-04-152-1/+5
| | | | | | | | | | I added support to bind_fbo_image in the process of building meta CopyTexSubImage, and found that it broke generatemipmap because previously we would just throw a GL error there and then end up with an incomplete FBO and fallback. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Infer bind_fbo_image parameters from an incoming image.Eric Anholt2014-04-153-6/+13
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.Eric Anholt2014-04-153-34/+36
| | | | | | | | | I need to do the same code again for CopyTexSubImage(). v2: Drop incorrect, not-terribly-useful comment (review by Ken) Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Refactor the BlitFramebuffer depth CopyTexImage fallback.Eric Anholt2014-04-152-138/+2
| | | | | | | | | This avoids a ReadPixels() if there's accelerated CopyTexImage present. It now requires GLSL as opposed to just fragment programs, but we don't have any drivers that do ARB_fp but not GLSL. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Refactor the BlitFramebuffer color CopyTexImage fallback.Eric Anholt2014-04-151-52/+41
| | | | | | | | | | | | | | | | | | | There shouldn't be anything special about copying out a subset of the src rb to a temp before texturing from it, so just do it when we're figuring out our src texture binding. This drops Anuj's change to copy an extra border of 1 pixel around the src area. I can't see how that change could be valid, and presumably if there's some filtering problem at edges we just need to set the right wrap mode. v2: Don't fall back to swrast on non-2D/RECT/2D_MS textures when we can still CopyTexSubImage. Fixes a segfault regression on i965 with gl-3.2-layered-rendering-blit. Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]> (v1) Tested-by: Anuj Phogat <[email protected]>
* meta: Drop blit src size fallback.Eric Anholt2014-04-151-10/+0
| | | | | | | | | | | | | I think we can assert that renderbuffer size is <= maximum 2D texture size. Our source coordinates should have already been clipped to the src renderbuffer size, but haven't actually (so we could potentially have trouble if there's scaling, and we're in the CopyTexImage path that tries to use src size). However, this texture size dependency was blocking the next refactors, so I'm not sure if we want to go ahead with this series before we get the clipping sorted out or not. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Avoid dependency hints on math opcodesMike Stroyan2014-04-151-0/+8
| | | | | | | | | | | Putting NoDDClr and NoDDChk dependency control on instruction sequences that include math opcodes can cause corruption of channels. Treat math opcodes like send opcodes and suppress dependency hinting. Signed-off-by: Mike Stroyan <[email protected]> Tested-by: Tony Bertapelli <[email protected]> Cc: [email protected] Reviewed-by: Matt Turner <[email protected]>
* i965: Expand INTEL_DEBUG to uint64_t.Matt Turner2014-04-152-2/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* dri: Expand driParseDebugString return value to uint64_t.Matt Turner2014-04-152-6/+5
| | | | | | Users will downcast if they don't have >32 debug flags. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Remove dead_code_eliminate_local().Matt Turner2014-04-152-159/+0
| | | | | | | Subsumed by the new dead_code_eliminate() function. No shader-db changes. Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Clear variable from live-set if it's completely overwritten.Matt Turner2014-04-151-0/+9
| | | | | | | | One program affected: instructions in affected programs: 246 -> 244 (-0.81%) Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Reimplement dead_code_elimination().Matt Turner2014-04-153-56/+117
| | | | | | | | | | | | | | | | | total instructions in shared programs: 1653399 -> 1651790 (-0.10%) instructions in affected programs: 92157 -> 90548 (-1.75%) GAINED: 2 LOST: 2 Also significantly reduces the number of optimization loop iterations: total loop iterations in shared programs: 39724 -> 31651 (-20.32%) loop iterations in affected programs: 21617 -> 13544 (-37.35%) Including some great pathological cases, like 29 -> 3 in Strike Suit Zero and 24 -> 3 in Dota2. Reviewed-by: Eric Anholt <[email protected]>
* i965/vec4: Let DCE eliminate dead writes in other basic blocks.Matt Turner2014-04-151-4/+4
| | | | | | | | We previously stopped searching for unread writes after encountering control flow, but we can instead just search backwards until we hit control flow. instructions in affected programs: 22854 -> 22194 (-2.89%)
* i965/gs: Add dummy source to prepare_channel_masks instruction.Matt Turner2014-04-151-1/+2
| | | | | | The generator uses its destination as a source implicitly, which breaks some assumptions in dead code elimination. Giving the instruction a source allows us to reason about it better.
* i965: Disable Z16 in all APIs.Kenneth Graunke2014-04-151-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally thought that GL 3.0 required GL_DEPTH_COMPONENT16 to map exactly to Z16. However, we misread the specification, thanks in part to LaTeX reordering the tables in the PDF. Page 180 of the GL 3.0 specification (glspec30.20080923.pdf) says: "[...] memory allocation per texture component is assigned by the GL to match the allocations listed in tables 3.16-3.18 as closely as possible. [...] Required Texture Formats [...] In addition, implementations are required to support the following sized internal formats. Requesting one of these internal formats for any texture type will allocate exactly the internal component sizes and types shown for that format in tables 3.16-3.17:" Notably, however, GL_DEPTH_COMPONENT16 does /not/ appear in table 3.16 or table 3.17. It appears in table 3.18, where the "exact" rule doesn't apply, and it falls back to the "closely as possible" rule. The confusing part is that the ordering of the tables in the PDF is: Table 3.16 (pages 182-184) Table 3.18 (bottom of page 184 to top of 185) Table 3.17 (page 185) Presumably, people saw table 3.16, then saw the table immediately following with DEPTH_COMPONENT* formats, and assumed it was 3.17. Based on a patch by Chia-I Wu, but without the driconf option to force Z16 to be used. It's not required, and there's apparently no benefit to actually using it. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* i965: Update comments about Z16 being slow.Kenneth Graunke2014-04-151-7/+10
| | | | | | | | | | | | | | | We've learned a few things since we originally disabled Z16; this attempts to summarize the issue. I am no expert on this subject, though, so the comment may not be totally accurate. I did some benchmarking on GM45 and Ironlake, and discovered that for GLBenchmark 2.7 EgyptHD, using Z16 was 3% slower on GM45 (n=15), and 4.5% slower on Ironlake (n=95). So, we can drop the "on Ivybridge" aspect of the comment - it's always slower. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* i965/gen8: add debug code to show FS disasm with jump locationsJordan Justen2014-04-141-0/+9
| | | | | | | Copied from similar code in gen8_vec4_generator.cpp. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Consider gl_VertexID and gl_InstanceID active attribsChris Forbes2014-04-131-0/+9
| | | | | | | Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Extract is_active_attrib() in shaderapiChris Forbes2014-04-131-8/+19
| | | | | | | | | | The rules are about to get a bit more complex to account for gl_InstanceID and gl_VertexID, which are system values. Extracting this first avoids introducing duplication. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix typo in error messageChris Forbes2014-04-131-1/+1
| | | | Signed-off-by: Chris Forbes <[email protected]>
* i965: glClearBuffer() should only clear a single buffer.Iago Toral Quiroga2014-04-133-3/+7
| | | | | | | | | | | | | | | | glClearBuffer() is currently clearing all active draw color buffers (all buffers that have not been set to GL_NONE when calling glDrawBuffers) instead of only clearing the one it receives as parameter. Altough brw_clear() receives a bit mask indicating the color buffers that should be cleared, this mask is ignored when calling brw_blorp_clear_color(). This was breaking the 'fbo-drawbuffers-none glClearBuffer' piglit test. The patch provides the bit mask to brw_blorp_clear_color() so it can limit clearing to the color buffers present in the mask. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76832 Reviewed-by: Eric Anholt <[email protected]>
* i965: Add comment to explain the weird-looking shadow compares.Chris Forbes2014-04-131-5/+16
| | | | | | | | | | | This always looks crazy when I stumble across it, until I remember what the hardware is doing. Describing it ought to short-circuit that process next time :) V2: Fix indents to 6 spaces, not 7. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Drop do_common_optimization's max_unroll_iterations parameter.Kenneth Graunke2014-04-114-6/+3
| | | | | | | | | | | | Now that we pass in gl_shader_compiler_options, it makes sense to just use options->MaxUnrollIterations, rather than passing a separate parameter. Half of the invocations already passed options->MaxUnrollIterations, while the other half passed in a hardcoded value of 32. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.Kenneth Graunke2014-04-111-8/+7
| | | | | | | This will prevent the two from getting out of sync again. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Correct EmitNoIndirect shader compiler option flags.Kenneth Graunke2014-04-111-3/+2
| | | | | | | | These were out of sync with the flags used to control lower_variable_index_to_cond_assign in brw_shader.cpp. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Reset reg_from when we can't coalesce.Matt Turner2014-04-111-0/+1
| | | | | | | | | | | | Not setting this would prevented coalescing after a failed attempt if the sources for both MOVs were the same. total instructions in shared programs: 1654531 -> 1650224 (-0.26%) instructions in affected programs: 423167 -> 418860 (-1.02%) GAINED: 2 LOST: 0 Reviewed-by: Eric Anholt <[email protected]>
* i965: Fill in a bunch of gen7/hsw data cache-related disasm.Eric Anholt2014-04-111-7/+103
| | | | | | | | This gets us disasm of atomic ops. v2: Fix fallthrough on pre-gen7. (bug caught by Ilia Mirkin). Reviewed-by: Matt Turner <[email protected]>
* i965: Stop setting up a 1:1 "attrib" member in our vertex inputs.Eric Anholt2014-04-114-5/+2
| | | | | | | | | It's just the array index, so we can just go look at the array and see which element we are. No significant performance difference (n=140) Reviewed-by: Ian Romanick <[email protected]>
* i965: Skip a bunch of IB BO refcount twiddling.Eric Anholt2014-04-111-13/+13
| | | | | | Improves cairo performance on glamor by 1.64828% +/- 1.04742% (n=65). Reviewed-by: Ian Romanick <[email protected]>
* i965/gen7: Skip repeated NULL depth/stencil state emits.Eric Anholt2014-04-114-0/+20
| | | | | | Improves cairo performance on glamor by 2.87752% +/- 0.966977 (n=57). Reviewed-by: Ian Romanick <[email protected]>
* mesa: use _mesa_get_srgb_format_linear() in sRGB texstore functionsBrian Paul2014-04-111-25/+5
| | | | | | | Instead of switch statements. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* swrast: use macros to initialize texfetch_funcs[] tableBrian Paul2014-04-111-937/+172
| | | | Reviewed-by: Ian Romanick <[email protected]>
* swrast: fix more fetch_texel function namesBrian Paul2014-04-112-37/+37
| | | | | | | | | | These were missed/typo'd in the previous patch series: s/R8G8B8A/R8G8B8A8/ s/rgba_16/RGBA_UNORM16/ s/rgba_uint/RGBA_UINT/ s/rgba_int/RGBA_SINT/ Reviewed-by: Ian Romanick <[email protected]>
* i965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.Kenneth Graunke2014-04-101-2/+2
| | | | | | | | | | | | | The _Xmin/_Xmax/_Ymin/_Ymax values need to be guarded by _NEW_SCISSOR. Fixes Piglit's scissor-many, and rendering in GNOME Shell. Hopefully fixes similar issues with Unity and ChromeOS. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75879 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: James Ausmus <[email protected]> Tested-by: Timo Aaltonen <[email protected]>
* mesa/st: set min/max texture gather offset to driver-reported valueIlia Mirkin2014-04-101-0/+3
| | | | | | | | It was always getting set to -8/7 unconditionally. Use the driver-reported value instead. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/u_gen_mipmap: rewrite using pipe->blit (v2)Marek Olšák2014-04-104-73/+11
| | | | | | | | | | | | | | | This replaces u_gen_mipmap with an extremely simple implementation based on pipe->blit. st/mesa is also cleaned up. Pros: - less code - correct mipmap generation for NPOT 3D textures (u_blitter uses a better formula) - queries are not affected by mipmap generation if drivers disable them v2: add "first_layer", "last_layer" parameters, drop "face" v2.1: add format v2.2: document the format parameter
* st/mesa: properly implement MapTextureImage with multiple mapped slices (v2)Marek Olšák2014-04-103-21/+53
| | | | | | | | | This is needed by _mesa_generate_mipmap. This adds an array of pipe_transfers to st_texture_image. Each transfer is for mapping a single layer. v2: allocate the array of transfers on demand
* mesa: remove the MALLOC, CALLOC and FREE macrosBrian Paul2014-04-101-6/+0
| | | | | | | | | | No longer used anywhere. These also caused trouble in the Gallium state tracker code where we include both core Mesa and Gallium util headers (and the macros were defined differently in each world.) Removing these macros should help avoid macro mix-ups in the future. Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* xlib: s/FREE/free/Brian Paul2014-04-101-1/+1
| | | | | Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/FREE/free/ in vdpau codeBrian Paul2014-04-101-4/+4
| | | | | | Reviewed-by: Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Christian König <[email protected]>
* mesa: s/FREE/free/ in _mesa_free_errors_data()Brian Paul2014-04-101-1/+1
| | | | | Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: use malloc/free instead of MALLOC/FREE in attrib stack codeBrian Paul2014-04-101-10/+10
| | | | | | | We moved away from MALLOC/FREE in the rest of core Mesa a while ago. Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: fix sampler_view REALLOC/FREE macro mix-upBrian Paul2014-04-103-1/+16
| | | | | | | | | | | We were using REALLOC() from u_memory.h but FREE() from imports.h. This mismatch caused us to trash the heap on Windows after we deleted a texture object. This fixes a regression from commit 6c59be7776e4d. Reviewed-by: Christian König <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
* i965: Enable ARB_texture_view on Gen7Chris Forbes2014-04-101-0/+4
| | | | | | | | | V4: Don't enable this for Gen8 yet -- that still needs wired up. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Eric Anholt <[email protected]>