aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: fix component overlap validation for doublesTimothy Arceri2016-06-121-5/+5
| | | | | | | | | | | This change makes sure to remove arrays when checking if type is a double. The check for the end of the first slot of a multi-slot double is also fixed by bumping the check to 4 rather than 3. Previously we were we not reserving the last component. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: fix max varyings count for ARB_enhanced_layoutsTimothy Arceri2016-06-123-20/+43
| | | | | | | | | | | Since this extension allows more than one varying to share a single location we can't just count the number of slots a varying takes and add it to the total. Instead we now reuse the reserved varyings bitfield to determine how many slots are reserved for explicit locations instead. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use the correct number of threads for compute shaders.Kenneth Graunke2016-06-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were programming the number of threads per subslice, when we should have been programming the total number of threads on the GPU as a whole. Thanks to Curro and Jordan for helping track this down! On Skylake GT3e: - Improves performance in Unreal's Elemental Demo by roughly 1.5-1.7x. - Improves performance in Synmark's Gl43CSDof by roughly 3.7x. - Improves performance in Synmark's Gl43GSCloth by roughly 1.18x. On Broadwell GT2: - Improves performance in Unreal's Elemental Demo by roughly 1.2-1.5x. - Improves performance in Synmark's Gl43CSDof by roughly 2.0x. - Improves performance in Synmark's Gl43GSCloth by 1.47035% +/- 0.255654% (n=25). On Haswell GT3e: - Improves performance in Unreal's Elemental Demo (in GL 4.3 mode) by roughly 1.10x. - Improves performance in Synmark's Gl43CSDof by roughly 1.18x. - Decreases performance in Synmark's Gl43CSCloth by -1.99484% +/- 0.432771% (n=64). On Ivybridge GT2: - Improves performance in Unreal's Elemental Demo (in GL 4.2 mode) by roughly 1.03x. - Improves performance in Synmark's G/43CSDof by roughly 1.25x. - No change in Synmark's Gl43CSCloth (n=28). Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Assert that the scratch spaces are in range.Kenneth Graunke2016-06-121-0/+14
| | | | | | | | | | | | | | | I don't know that anything actually guarantees this, but if we exceed the limits, we may end up overflowing and trashing random buffers that happen to be nearby in the VMA space, leading to rendering corruption, hangs, or worse. We should really fix this properly. However, the pitfall has existed for ages, so for now we should at least detect it. Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Fix CS scratch size calculations on Ivybridge and Baytrail.Kenneth Graunke2016-06-122-2/+10
| | | | | | | | | These are linear, not powers of two, and much more limited. Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Fix Haswell CS per-thread scratch space encoding.Kenneth Graunke2016-06-122-3/+25
| | | | | | | | | | | | | | | | | | | | | | Most scratch stages use power of two sizes, in kilobytes, where 0 means 1kB. But compute shaders on Haswell have a minimum of 2kB, and use a representation where 0 = 2kB. This meant that we were effectively telling the hardware to allocate each thread twice as much space as we meant to, while simultaneously not allocating that much space in the buffer, leading to overflows. Note that the existing code is completely wrong for Ivybridge, but that will take additional work to sort out, so I've left it as is for now. A subsequent commit will take care of that. Together with the previous patches, this fixes rendering corruption on Synmark's Gl43CSDof on Haswell. Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Account for poor address calculations in Haswell CS scratch size.Kenneth Graunke2016-06-121-1/+20
| | | | | | | | | | | | | | | | Curro figured this out by investigating the simulator. Apparently there's also a workaround in the Windows driver. I'm not sure it's actually documented anywhere. We were underallocating the scratch buffer by a factor of 128/70. v2: Rename threads_per_subslice to scratch_ids_per_subslice (suggested by Jordan Justen). Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Allocate scratch space for the maximum number of compute threads.Kenneth Graunke2016-06-121-1/+3
| | | | | | | | | | | | | | | | | | | | We were allocating enough space for the number of threads per subslice, when we should have been allocating space for the number of threads in the entire GPU. Even though we currently run with a reduced thread count (due to a bug), we might still overflow the scratch buffer because the address calculation is based on the FFTID, which can depend on exactly which threads, EUs, and threads are executing. We need to allocate enough for every possible thread that could run. Fixes rendering corruption in Synmark's Gl43CSDof on Gen8+. Earlier platforms need additional bug fixes. Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Set subslice_total on Gen7/7.5 platforms.Kenneth Graunke2016-06-121-1/+4
| | | | | | | | | | | | We'll use this for compute shader thread counts and scratch space calculations shortly. Note that subslices are referred to as "half slices" on Ivybridge. Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Fix shared local memory size for Gen9+.Kenneth Graunke2016-06-124-27/+37
| | | | | | | | | | | | | | | | | | | | | Skylake changes the representation of shared local memory size: Size | 0 kB | 1 kB | 2 kB | 4 kB | 8 kB | 16 kB | 32 kB | 64 kB | ------------------------------------------------------------------- Gen7-8 | 0 | none | none | 1 | 2 | 4 | 8 | 16 | ------------------------------------------------------------------- Gen9+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | The old formula would substantially underallocate the amount of space. This fixes GPU hangs on Skylake when running with full thread counts. v2: Fix the Vulkan driver too, use a helper function, and fix the table in the comments and commit message. Cc: "12.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* nv50: reinstate dedicated constbuf push pathIlia Mirkin2016-06-115-29/+50
| | | | | | | | | | | | | | | | | This was disabled due to occasionally incorrect behavior when trying to upload data. It later became apparent that nvc0 also had a similar but slightly different issue, which was resolved in commit e50c01d5. This takes the same logic as nvc0 and applies it to nv50 (which has somewhat different interfaces). Unfortunately I did not note down precisely what was broken with UBOs when removing the support from nv50, but I've tested a bunch of local traces, and none of them appear to regress. This should hopefully improve performance when UBOs are used, but this was not directly verified. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* nv50: enable indirect addressing of fragment shader inputsIlia Mirkin2016-06-112-1/+2
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* mesa: add drawbuffer argument to ClearNamedFramebufferfiIlia Mirkin2016-06-103-3/+4
| | | | | | | | | | | This was fixed in revision 47 of the ARB_dsa spec in Oct 22, 2015. Since it's horrible to have differing APIs across library versions, we should attempt to minimize the impact by backporting it as far as possible and hope no one notices. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Cc: "11.2 12.0" <[email protected]>
* llvmpipe: turn on pipe cap for GL_ARB_copy_image supportBrian Paul2016-06-101-1/+2
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* llvmpipe: don't use 3-component formats, except 32-bit x 3 formatsBrian Paul2016-06-101-11/+12
| | | | | | | | | | | This basically disallows all 8-bit x 3 and 16-bit x 3 formats for textures and render targets. Some 3-component formats were already disallowed before. This avoids problems with GL_ARB_copy_image. v2: the previous version of this patch disallowed all 3-component formats Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: turn on pipe cap for GL_ARB_copy_image supportBrian Paul2016-06-101-1/+2
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* softpipe: don't use 3-component formatsBrian Paul2016-06-101-0/+18
| | | | | | | | | | | | | | | Mesa and gallium don't have a complete set of matching 3-component texture formats. For example, 8-bit sRGB unorm. To fully support the GL_ARB_copy_image extension we need to have support for all of these formats: RGB8_UNORM, RGB8_SNORM, RGB8_SRGB, RGB8_UINT, and RGB8_SINT using the same component order. Since we don't have that, disable the 3-component formats for now. v2: Simplify 3-component format check, per Marek. Also check that target != PIPE_BUFFER. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: tweak surface format mapping tableBrian Paul2016-06-101-9/+11
| | | | | | | | | | | 1. Try to choose R8G8B8A8 unorm/srgb formats before others in an effort to try to match component ordering for UINT/SINT/etc. 2. If we can't get a format such as PIPE_FORMAT_A16_UNORM, try PIPE_FORMAT_R16G16B16A16_UNORM before shallower formats. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* util: update util_resource_copy_region() for GL_ARB_copy_imageBrian Paul2016-06-101-20/+95
| | | | | | | This primarily means added support for copying between compressed and uncompressed formats. Reviewed-by: Charmaine Lee <[email protected]>
* gallium: Fix region overlap conditions for rectangles with a shared edgeAnuj Phogat2016-06-101-4/+4
| | | | | | | | | | | | | | | | | | | | | >From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels": "The pixels corresponding to these buffers are copied from the source rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1) to the destination rectangle bounded by the locations (dstX0, dstY 0) and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive, while the upper bounds are exclusive." So, the rectangles sharing just an edge shouldn't overlap. ----------- | | ------- --- | | | | | | ------- --- Cc: "12.0" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Fix region overlap conditions for rectangles with a shared edgeAnuj Phogat2016-06-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | >From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels": "The pixels corresponding to these buffers are copied from the source rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1) to the destination rectangle bounded by the locations (dstX0, dstY 0) and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive, while the upper bounds are exclusive." So, the rectangles sharing just an edge shouldn't overlap. ----------- | | ------- --- | | | | | | ------- --- Cc: "12.0" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallivm: more 64-bit integer prep work.Dave Airlie2016-06-111-8/+8
| | | | | | | This converts one other place to using the new helper. Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radeonsi: convert to 64-bitness checks instead of doubles.Dave Airlie2016-06-113-31/+33
| | | | | | | | This converts to testing for 64-bit types and renames some things in anticipation of 64-bit integer support. Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallivm: make non-float return code bitcast consistent.Dave Airlie2016-06-111-12/+6
| | | | | | | | This just uses the same form across the fetches. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium/gallivm: use 64-bit test instead of doubles.Dave Airlie2016-06-111-37/+36
| | | | | | | | | This just makes some generic code that currently emits double suitable for emitting 64-bit values. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium/tgsi: add 64-bitness type check function.Dave Airlie2016-06-111-0/+7
| | | | | | | | | Currently this just doubles, but we'll convert users to this so making adding 64-bit integers easier. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* anv/entrypoints: Rework #if guardsJason Ekstrand2016-06-101-7/+9
| | | | | | | | | | | | | | | This reworks the #if guards a bit. When Emil originally wrote them, he just guarded everything. However, part of what anv_entrypoints_gen.py generates is a hash table for looking up entrypoints based on their name. This table *cannot* get out of sync between C and python regardless of preprocessor flags. In order to prevent this, this commit makes us use void pointers in the dispatch table for those entrypoints which aren't available. This means that the dispatch table size and entry order is constant and it should never get out-of-sync with the python. Signed-off-by: Jason Ekstrand <[email protected]> Acked-by: Emil Velikov <[email protected]> Cc: "12.0" <[email protected]>
* anv/entrypoints: Use the function pointer types provided by vulkan.hJason Ekstrand2016-06-101-1/+1
| | | | | | | | | This is a bit cleaner than generating the types ourselves when making the table. Signed-off-by: Jason Ekstrand <[email protected]> Acked-by: Emil Velikov <[email protected]> Cc: "12.0" <[email protected]>
* st/mesa: use base level size as "guess" when availableNicolai Hähnle2016-06-101-6/+27
| | | | | | | | | | | | | | | | | | | | When an applications specifies mip levels _before_ setting a mipmap texture filter, we will initially guess a single texture level. When the second level image is created, we try to allocate the full texture -- however, we get the base level size guess wrong if that size is odd. This leads to yet another re-allocation of the texture later during st_finalize_texture. Even worse, this re-allocation breaks a (reasonable) assumption made by st_generate_mipmaps, because the re-allocation in the finalization call will again allocate a single-level pipe texture (based on the non-mipmap texture filter!). As a result, mipmap generation fails in interesting ways. All of this can be avoided by just using the fact that we already know the size of the base level. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95529 Cc: 12.0 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* anv: Remove the PhysicalDeviceLimits FINISHMEJason Ekstrand2016-06-101-2/+0
| | | | | | | | At this point, the limits are probably more-or-less correct. If there is an invalid limit, that's a bug not a FINSHME. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline_cache: Allow for an zero-sized cacheJason Ekstrand2016-06-101-1/+4
| | | | | | | This gets ANV_ENABLE_PIPELINE_CACHE=false working again. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Store the (set, binding, index) tripple in the bind mapJason Ekstrand2016-06-105-15/+25
| | | | | | | | | | | This way the the bind map (which we're caching) is mostly independent of the pipeline layout. The only coupling remaining is that we pull the array size of a binding out of the layout. However, that size is also specified in the shader and should always match so it's not really coupled. This rendering issues in Dota 2. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/descriptor_set: Ensure that bindings are always in increasing orderJason Ekstrand2016-06-101-0/+13
| | | | | | | | | | | Since applications are allowed to specify some set of bindings which need not be dense they also need not be in order. For most things, this doesn't matter, but it could result getting the wrong dynamic offsets. This adds a quick-and-dirty sort to ensure that everything is always in increasing order of binding index. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/descriptor_set: Add a type field in debug buildsJason Ekstrand2016-06-102-0/+10
| | | | | | | | This allows for some extra validation and makes it easier to see what's going on when poking around in gdb. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/descriptor_set: Set array_size to zero for non-existant descriptorsJason Ekstrand2016-06-101-0/+1
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* vl/dri3: support receiving new pixmap for front bufferLeo Liu2016-06-101-1/+6
| | | | | | | | | | | | With glx of gstreamer-vaapi, the temporary pixmap for front buffer gets renewed in each frame, so when we receive a new pixmap, should get a new front buffer for it. This also fixes Totem player playback corruption. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Cc: "12.0" <[email protected]>
* vl/dri3: get Makefile properlyLeo Liu2016-06-103-5/+10
| | | | | | | | | | | | | | From original commit, the macro "if HAVE_DRI3" was in Makefile.sources, this file is shared with SCons, SCons is not able to parse this marco, the SCons build failed. Jose quickly gave two approaches and quick fix with his second approach, thanks Jose for the solutions and fixes. This patch is Jose's first approach, and it's more proper, because the dri3 c file should not be included to build when DRI3 is not enabled. Signed-off-by: Leo Liu <[email protected]> Acked-by: Emil Velikov <[email protected]> Cc: "12.0" <[email protected]>
* gallivm: Never emit llvm.fmuladd on LLVM 3.3.Jose Fonseca2016-06-102-1/+7
| | | | | | | | Besides the old JIT bug, it seems the X86 backend on LLVM 3.3 doesn't handle llvm.fmuladd and instead it fall backs to a C function. Which in turn causes a segfault on Windows. Reviewed-by: Roland Scheidegger <[email protected]>
* gallivm: Use llvm.fmuladd.*.Jose Fonseca2016-06-107-68/+98
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* util,gallivm: Explicitly enable/disable fma attribute.Jose Fonseca2016-06-104-0/+13
| | | | | | | | | | As suggested by Roland Scheidegger. Use the same logic as f16c, since fma requires VEX encoding. But disable FMA on LLVM 3.3 without MCJIT. Reviewed-by: Roland Scheidegger <[email protected]>
* radeonsi: Reinitialize all descriptors in CE preamble.Bas Nieuwenhuizen2016-06-103-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem with the CE preamble and restoring only stuff in the preamble when needed. To illustrate suppose we have two graphics IB's 1 and 2, which are submitted in that order. Furthermore suppose IB 1 does not use CE ram, but IB 2 does, and we have a context switch at the start of IB 1, but not between IB 1 and IB 2. The old code put the CE RAM loads in the preamble of IB 2. As the preamble of IB 1 does not have the loads and the preamble of IB 2 does not get executed, the old values are not load into CE RAM. Fix this by always restoring the entire CE RAM. v2: - Just load all descriptor set buffers instead of load and store the entire CE RAM. - Leave the ce_ram_dirty tracking in place for the non-preamble case. v3: - Fixed parameter alignment. - Rebased to master (Nicolai's descriptor series). Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Wrap extensions.h declarations with extern "C".Jose Fonseca2016-06-101-0/+8
| | | | | | | This should fix the MSVC linker failures that arose with commit 5e2d25894b962aae9158261897e13843377e3b95. Trivial.
* st/mesa: fix type confusion with reladdrsIlia Mirkin2016-06-091-5/+5
| | | | | | | | | | | The reality is that this doesn't matter, because we manually emit the ARL to the sampler reladdr, and those arguments don't get an extra load later, so it's effectively just a boolean. However having the types be wrong is confusing and could trigger very odd bugs should usage change down the line. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glsl/ir: remove TABs in ir_constant_expression.cppDave Airlie2016-06-101-535/+535
| | | | | | | | Adding 64-bit integers support was going to make this file worse, just remove the tabs from it now. Acked-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965/gen9: Don't change halign and valign to fit in fast copy blitAnuj Phogat2016-06-091-4/+2
| | | | | | | | | An update in graphics specs has deleted the halign and valign fields from XY_FAST_COPY_BLT command. See mesa commit 97f0f91. Cc: Ben Widawsky <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* mesa: Add a helper function for shared code in get_tex_rgba_{un}compressedAnuj Phogat2016-06-091-45/+38
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Let compute shaders work in compatibility profilesSamuel Pitoiset2016-06-091-1/+1
| | | | | | | | | | The extension is already advertised in compatibility profile, but the _mesa_has_compute_shaders only returns true in core profile. If we advertise it, we should allow it to work. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* swr: implement clipPlanes/clipVertex/clipDistance/cullDistanceTim Rowley2016-06-095-2/+94
| | | | | | | | | | | | | | v2: only load the clip vertex once v3: fix clip enable logic, add cullDistance v4: remove duplicate fields in vs jit key, fix test of clip fixup needed v5: fix clipdistance linkage for slot!=0,4 v6: support clip+cull; passes most piglit clip (failures understood) Reviewed-by: Bruce Cherniak <[email protected]>
* glx: fix crash with bad fbconfigDaniel Czarnowski2016-06-091-0/+23
| | | | | | | | | | | | | | | | | | | GLX documentation states: glXCreateNewContext can generate the following errors: (...) GLXBadFBConfig if config is not a valid GLXFBConfig Function checks if the given config is a valid config and sets proper error code. Fixes currently crashing glx-fbconfig-bad Piglit test. v2: coding style cleanups (Emil, Topi) use DefaultScreen macro (Emil) Signed-off-by: Matt Roper <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: "11.2" <[email protected]>
* st/vdpau: implement luma keyingNayan Deshmukh2016-06-092-12/+39
| | | | | Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>