summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-04-26softpipe: add support for compute shaders.HEADmasterDave Airlie7-3/+325
This enables ARB_compute_shader on softpipe. I've only tested this with piglit so far, and I hopefully plan on integrating it with my vulkan work. I'll get to testing it with deqp more later. The basic premise is to create up to 1024 restartable TGSI machines, and execute workgroups of those machines. v1.1: free machines. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi/exec: misc fixes for compute shaders.Dave Airlie1-1/+4
We want to use the SysSemanticToIndex to tell if we've seen the semantics at all. Also add semantic swizzle support. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi/exec: implement restartable machine.Dave Airlie2-17/+29
This lets us restart the machine at a PC value, and exits the machine when we hit a barrier. Compute shaders will then execute all the threads up to the barrier, then restart the machines after the barrier once all are done. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi/exec: make inputs/outputs optional for compute shaders.Dave Airlie1-19/+24
compute shaders don't need input/outputs so don't bother allocating memory for these. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi/exec: implement load/store/atomic on MEMORY.Dave Airlie2-3/+110
This implements basic load/store/atomic ops on MEMORY types for compute shaders. TODO: finish off atomic ops. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi/exec: split out setting up masks to separate functionDave Airlie1-9/+14
This is just a cleanup that will make later changes easier to make. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi: accept a starting PC value for exec machine.Dave Airlie5-5/+5
This will be used later to restart barriered execution threads in compute, for now we just want to change the API. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi/exec: fix system value handling.Dave Airlie1-3/+5
a) SysSemanticToIndex needs to be indexed with the semantic name not the decl->Declaration.Semantic. b) doing this in run is too late, as the mappings are all setup prior to run in the execs. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi: move to using vector for system values.Dave Airlie4-7/+7
For compute support some of the system values are .xyz types, so move to using a vector instead of a single channel. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-25glsl: add ability to use essl 3.20Ilia Mirkin4-0/+11
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-25main: select ES3.2 version when all extensions are availableIlia Mirkin1-1/+17
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-04-26tgsi: pass a shader type to the machine create and clean up.Dave Airlie5-15/+15
There was definitely bugs here mixing up the PIPE_ and TGSI_ defines, hopefully they didn't cause any problems, since mostly it was special cases for GEOMETRY. This clarifies at shader machine create what type of shader this machine will execute. This is needed also for compute shaders where we don't want to allocate inputs/outputs. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26gallium/tgsi: move tgsi_exec.h header out of draw_context.hDave Airlie2-1/+1
It gets annoying that changing the tgsi exec rebuilds the state tracker unnecessarily. Putting this include into draw_gs.h which uses it causes a lot less rebuilds. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26gallivm: make sampling more robust against bogus coordinatesRoland Scheidegger3-13/+43
Some cases (especially these using fract for coord wrapping) did not handle NaNs (or Infs) correctly - the following code assumed the fract result could not be outside [0,1], but if the input is a NaN (or +-Inf) the fract result was NaN - which then could produce out-of-bound offsets. (Note that the explicit NaN behavior changes for min/max on x86 sse don't result in actual changes in the generated jit code, but may on other architectures. Found by looking through all the wrap functions.) This fixes https://bugs.freedesktop.org/show_bug.cgi?id=94955 No piglit changes. (v2: fix min/max typo in coord_mirror, add comment) Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Tested-by: Bruce Cherniak <bruce.cherniak@intel.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2016-04-26radeonsi: fix missing include for Elements.Dave Airlie1-0/+1
Since u_blitter.h no longer defines this. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-26nvc0: bump the amount of shared memory per MP on MaxwellSamuel Pitoiset1-1/+11
According to the CUDA compute capability version, GM10x can expose 64KB of shared memory while GM20x can use 96KB. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-04-26r600: fix missing include for Elements macroDave Airlie1-0/+1
This got removed from u_blitter.h and we were taking it from there, this should just move to ARRAY_SIZE eventually. Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-04-25gm107/ir: s/invalid load/invalid store/Samuel Pitoiset1-1/+1
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-04-25freedreno/a3xx: remove unused fxnRob Clark1-6/+0
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25freedreno/ir3: convert over to rallocRob Clark2-40/+6
The home-grown heap scheme (which is ultra-simple but probably not good to always allocate and memset such a chunk of memory up front) was a remnant of fdre (where the ir originally came from). But since we have ralloc in mesa, lets just use that instead. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25mesa/st: log some additional invalid-fbo casesRob Clark1-0/+3
Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-25freedreno: honor handle->offsetRob Clark1-2/+4
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25freedreno: disallow cat4 immed srcRob Clark1-1/+1
Normally this would never happen (constant-propagation in NIR would eliminate the instruction), except it does happen for 'undef' which we turn into immed 0.0 for bookkeeping purposes. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25freedreno/a4xx: add render-target formatsRob Clark1-3/+3
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25freedreno: update generated headersRob Clark5-5/+8
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25freedreno: reduce line width for deqp furtherRob Clark1-1/+1
See a7eb12d0.. but that wasn't restrictive enough. Fixes dEQP-GLES3.functional.rasterization.primitives.line_strip_wide, and similar Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25freedreno/ir3: fix sin/cosRob Clark8-1/+92
We seem to need range reduction to get sane results. Fixes glmark2 jellyfish bench, and a whole bunch of dEQP-GLES3.functional.shaders.builtin_functions.precision.{sin,cos,tan}.* v2: squashed in android build fixes from Rob Herring Signed-off-by: Rob Clark <robclark@freedesktop.org>
2016-04-25i965: Unroll SIMD16 DDY_FINE on Sandybridge.Kenneth Graunke1-1/+5
This fixes 10 dEQP-GLES3 subtests: dEQP-GLES3.functional.shaders.derivate.dfdy.texture.float_nicest.*. Matt noticed that our Piglit tests for this use even numbered registers, while the failing dEQP tests use odd numbered registers. We believe that it works for even numbered registers, but not otherwise. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-04-25mesa/gles: Allow format GL_RED to be used with MESA_FORMAT_R_UNORMJordan Justen1-0/+2
If the bound framebuffer has a format of MESA_FORMAT_R_UNORM, then IMPLEMENTATION_COLOR_READ_FORMAT will return GL_RED. This change applies to OpenGLES contexts where additional restrictions are placed on the formats that are allowed to be supported. Fixes OpenGLES 3.1 CTS tests: * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC16 * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC16Linear * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC32F * ES31-CTS.texture_border_clamp.sampling_texture.Texture2DDC32FLinear Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-04-25svga: eliminiate unnecessary constant buffer updatesCharmaine Lee3-2/+23
Currently if the texture binding is changed, emit_fs_consts() is triggered to update texture scaling factor for rectangle texture or texture buffer size in the constant buffer. But the update is only relevant if the texture binding includes a rectangle texture or a texture buffer. To eliminate the unnecessary constant buffer updates due to other texture binding changes, a new flag SVGA_NEW_TEXTURE_CONSTS will be used to trigger fragment shader constant buffer update when a rectangle texture or a texture buffer is bound. With this patch, the number of constant buffer updates in Lightsmark2008 reduces from hundreds per frame to about 28 per frame. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-25svga: mark the texture dirty for write transfer map onlyCharmaine Lee1-2/+4
Instead of unconditionally mark the texture subresource dirty at transfer map, we'll set the dirty bit for write transfer only. Tested with lightsmark2008 and glretrace. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-25svga: fix assert with PIPE_QUERY_OCCLUSION_PREDICATE for non-vgpu10Charmaine Lee1-23/+20
With this patch, when running in hardware version 11, we'll use SVGA3D_QUERYTYPE_OCCLUSION query type for PIPE_QUERY_OCCLUSION_PREDICATE and return TRUE if samples-passed count is greater than 0. Fixes glretrace/solidworks2012_viewport running in hardware version 11. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-25svga: minimize surface flushCharmaine Lee2-15/+85
Currently, we always do a surface flush when we try to establish a synchronized write transfer map. But if the subresource has not been modified, we can skip the surface flush. In other words, we only need to do a surface flush if the to-be-mapped subresource has been modified in this command buffer. With this patch, lightsmark2008 shows about 15% performance improvement. Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-25glapi: fix _glapi_get_proc_address() for mangled function namesFrederic Devernay1-12/+6
In the dispatch table, all functions are stored without the "m" prefix. Modify code so that OSMesaGetProcAddress works both with gl and mgl prefixes. Similar to https://lists.freedesktop.org/archives/mesa-dev/2015-September/095251.html Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94994 Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2016-04-25util/blitter: use ARRAY_SIZE macroBrian Paul1-9/+3
And remove local definition of Elements() macro. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-04-25svga: s/Elements/ARRAY_SIZE/Brian Paul19-55/+55
Standardize on the later macro rather than a mix of both. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-04-25svga: whitespace and formatting fixes in svga_pipe_rasterizer.cBrian Paul1-16/+13
2016-04-25svga: whitespace and formatting fixes in svga_pipe_depthstencil.cBrian Paul1-14/+14
2016-04-25svga: whitespace and formatting fixes in svga_pipe_sampler.cBrian Paul1-31/+33
2016-04-25gallium/util: initialize pipe_framebuffer_state to zerosBrian Paul1-1/+1
To silence a valgrind uninitialized memory warning. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94955 Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-04-25util/cache: add comments, fix formattingBrian Paul1-5/+35
2016-04-25i965: Mark URB reads as volatile.Kenneth Graunke1-0/+3
They can be affected by URB writes. In the upcoming scalar TCS backend, this prevents read-modify-write cycles from being broken by CSE removing reads. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-04-25i965: Make a few tessellation related functions non-static.Kenneth Graunke3-47/+51
Also, move them to brw_shader.cpp so they're in a location for code used by both the vec4 and fs worlds. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-04-25svga: separate HUD counters for state objectsBrian Paul7-12/+29
Count depth/stencil, blend, sampler, etc. state objects separately but just report the sum for the HUD. This change lets us use gdb to see the breakdown of state objects in more detail. Also, count sampler views too. Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-04-25st/omx: Fix resource leak on OMX_ErrorNoneRobert Foss1-0/+1
Avoid leaking buffer allocated for task if an error has occured. Coverity id: 1213929 Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-25isl: remove ffs function that conflicts with system headersJonathan Gray1-5/+1
Remove a wrapper around __builtin_ffs that conflicts with system headers on OpenBSD and perhaps elsewhere: isl_priv.h:44: error: conflicting types for 'ffs' v2: include strings.h to ensure prototype is found Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-25gallium: use unreachable instead of assertsGrazvydas Ignotas1-1/+1
Avoids warnings in release builds. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-25anv: fix warnings in release buildGrazvydas Ignotas4-4/+4
Mark variables MAYBE_UNUSED to avoid unused-but-set-variable warnings in release build. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-25isl: fix warnings in release buildGrazvydas Ignotas2-2/+2
Mark variables MAYBE_UNUSED to avoid unused-but-set-variable warnings in release build. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-25spirv: fix warning in release buildGrazvydas Ignotas1-1/+1
Mark variable MAYBE_UNUSED to avoid unused-but-set-variable warning in release build. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>