Commit Graph

60932 Commits

Author SHA1 Message Date
Siavash Eliasi d273fe72df i915g: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.
2014-01-29 09:11:39 -07:00
Siavash Eliasi 4329e99b23 i915g: Use alignment of 64 instead of 16 for buffer allocation
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi 809d3a7d25 llvmpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi 6317664de0 llvmpipe: Use alignment of 64 instead of 16 for buffer allocation
v2: Changed allocation alignment of llvmpipe_displaytarget_layout.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi c83b34c43b softpipe: Set PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT to 64
v2: Fixed setting switch cases prior to
PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT incorrectly.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Siavash Eliasi e36759a81e softpipe: Use alignment of 64 instead of 16 for buffer allocation
v2: Changed allocation alignment in softpipe_displaytarget_layout.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-29 09:09:41 -07:00
Stéphane Marchesin 023a50dd9b i915g: support more PIPE_CAPs 2014-01-28 18:56:54 -08:00
Michel Dänzer f8e16010e5 radeonsi: Put GS ring buffer descriptors with streamout buffer descriptors
And mark the constant buffers as read only for the GPU again.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:09:26 +09:00
Michel Dänzer d7c68e2dc1 radeonsi: Enable OpenGL 3.3
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:09:14 +09:00
Michel Dänzer db9d6af862 radeonsi: Geometry shader micro-optimizations
Move parameter loads out of loops, and use the instruction offset
instead of a VGPR for the vertex attribute offset when writing to the
ESGS ring buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:09:04 +09:00
Michel Dänzer 3b3687adcb radeonsi: We don't support indirect addressing of geometry shader inputs
Fixes piglit spec/glsl-1.50/execution/geometry/dynamic_input_array_index

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:54 +09:00
Michel Dänzer b4e14931a9 radeonsi: Pass VS resource descriptors to the HW ES shader stage as well
This makes sure constants and samplers work in the vertex shader even
when a geometry shader is active.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:43 +09:00
Michel Dänzer 67e385b3b7 radeonsi: Fix streamout from geometry shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:33 +09:00
Michel Dänzer d88a375229 radeonsi: Simplify shader PM4 state handling
Just always bind the current states before drawing.

Besides the simplification, as a bonus this makes sure the VS hardware
shader stage always uses the GS copy shader when a geometry shader is
active, fixing a number of GS related piglit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:21 +09:00
Michel Dänzer e884c560a6 radeonsi: Properly match ES outputs to GS inputs
Fixes piglit vs-gs-arrays-within-blocks-pass.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:08:10 +09:00
Michel Dänzer e1df0d45c4 radeonsi: Really dump TGSI code before any TGSI->LLVM conversion attempt
While we're at it, use the local variable 'sel'.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:58 +09:00
Michel Dänzer 7b19c391f4 radeonsi: Also export clip distances with geometry shader
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:48 +09:00
Michel Dänzer 8afde9fa23 radeonsi: Take GS into account for VS state in more places
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:35 +09:00
Michel Dänzer 28630713b2 radeonsi: Handle adjacency primitives
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:23 +09:00
Michel Dänzer d8b3d806fc radeonsi: Handle TGSI_SEMANTIC_PRIMID
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:07:11 +09:00
Michel Dänzer 7c7d7380f1 radeonsi: Generalize counting of shader parameters
Now it covers ES->GS as well as VS->PS.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:06:58 +09:00
Michel Dänzer f07a96dad1 radeonsi: Fix handling of geometry shader output vertex ID
It needs to increment at shader runtime, not at shader compile time, as
the geometry shader can emit vertices in loops. LLVM automagically
converts the ID back to an immediate value if its value can be
determined at compile time.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:06:45 +09:00
Michel Dänzer 404b29d765 radeonsi: Initial geometry shader support
Partly based on the corresponding r600g work by Vadim Girlin and Dave
Airlie.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:06:28 +09:00
Michel Dänzer 51f89a03e1 radeonsi: Refactor shader input / output handling code
In preparation for adding geometry shader support.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-29 11:05:58 +09:00
Matt Turner 947c828d5c i965/fs: Add a saturation propagation optimization pass.
Transforms, for example,

mul     vgrf3, vgrf2, vgrf1
mov.sat vgrf4, vgrf3

into

mul.sat vgrf3, vgrf2, vgrf1
mov     vgrf4, vgrf3

which gives register_coalescing an opportunity to remove the MOV
instruction.

total instructions in shared programs: 1515039 -> 1504634 (-0.69%)
instructions in affected programs:     798586 -> 788181 (-1.30%)
GAINED:                                0
LOST:                                  4

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-28 17:47:41 -08:00
Matt Turner 39d7ec2c9a i965: Add can_do_saturate() method to backend_instruction.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2014-01-28 17:47:41 -08:00
Anuj Phogat 3303475558 mesa: Generate correct error code in glDrawBuffers()
OpenGL 3.3 spec expects GL_INVALID_OPERATION:
 "For both the default framebuffer and framebuffer objects, the
  constants FRONT, BACK, LEFT, RIGHT, and FRONT AND BACK are not
  valid in the bufs array passed to DrawBuffers, and will result
  in the error INVALID OPERATION."

But OpenGL 4.0 spec changed the error code to GL_INVALID_ENUM:
 "For both the default framebuffer and framebuffer objects, the
  constants FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK are not
  valid in the bufs array passed to DrawBuffers, and will result
  in the error INVALID_ENUM."

This patch changes the behaviour to match OpenGL 4.0 spec
Fixes Khronos OpenGL CTS draw_buffers_api.test.

V2: Update the comment in code.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-28 15:30:55 -08:00
Dave Airlie faee376869 loader: fix running with --disable-egl builds
I sometimes build without EGL just for speed purposes, however
it no longer finds my drivers when I do due to the HAVE_LIBUDEV
defines being wrong.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-28 21:51:21 +00:00
Anuj Phogat dc2f94bc78 i965: Ignore 'centroid' interpolation qualifier in case of persample shading
I missed this change in commit f5cfb4a. It fixes the incorrect
rendering caused in Dolphin Emulator.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73915

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Markus Wick <wickmarkus@web.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-01-28 13:32:20 -08:00
Matt Turner 10dc994e09 gbm: Make libgbm.so.1 symlink.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-28 07:29:14 -08:00
Kevin Rogovin 1db9ed6495 mesa: Allow depth = 0 parameter for TexImage3D.
Fixes the tests for the depth parameter for TexImage3D calls when the
target type is GL_TEXTURE_2D_ARRAY or GL_TEXTURE_CUBE_MAP_ARRAY
so that a depth value of 0 is accepted. Previously, the check
incorrectly required the depth argument to be atleast 1.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-28 07:29:14 -08:00
Tom Stellard 7b4592a489 r600g,radeonsi: Don't set resource_create in r600_common_screen_init()
r600g and radeonsi have different implementations of resource_create.

https://bugs.freedesktop.org/show_bug.cgi?id=74139

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-01-28 07:24:11 -08:00
José Fonseca f29968b270 c11: Add missing stdlib.h include.
For malloc/free.

Silences gcc mingw warnings.
2014-01-28 14:35:04 +00:00
Emil Velikov 61c825e862 loader: include dlfcn.h when building with HAVE_LIBUDEV
The code depending on the definitions is already wrapped
in the same conditional so go ahead and wrap the include.

Otherwise we'll brake compilation on platforms that are
missing the header. Add assert.h in there as well, as it
is introduced and used in the same fashon.

Cc: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74122
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-01-28 14:32:03 +00:00
José Fonseca 2eddf91faf gallivm: Workaround http://llvm.org/PR18600
We have code generation paths that carry out swizzles of AoS vectors via
bitwise shifts, as these tend to generate more efficient code than
straightforward byte shuffles.  But when the input is a constant the
additional bitwise arithmetic operations somehow don't really get
constant propagated properly, evenutally causing assertion failure in
InstCombine pass.

Therefore avoid the bug by using the trivial shuffles for constant
inputs.

Although the sample LLVM IR can cause a crash with any LLVM version,
this was only seen in practice with LLVM 3.2.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-01-28 14:27:27 +00:00
Matt Turner 37f1903e00 glsl: Avoid combining statements from different basic blocks.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74113
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-27 21:15:35 -08:00
Matt Turner 8e2b8bd0e6 glsl: Set proper swizzle when a channel is missing in vectorizing.
Previously, for example if the x channel was missing from a series of
assignments we were attempting to vectorize, the wrong swizzle mask
would be applied.

   a.y = b.y;
   a.z = b.z;
   a.w = b.w;

would be incorrectly transformed into

   a.yzw = b.xyz;

Fixes two transform feedback tests in the ES3 conformance suite.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73978
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73954
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner 57109d57f8 glsl: Use bitfieldInsert in ldexp() lowering.
Shaves a few instructions off of lowered ldexp().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner 3ea64f9093 glsl: Add constant evaluation of ir_binop_bfm.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner c59a605c70 glcpp: Resolve implicit GLSL version to 100 if the API is ES.
Fixes a regression since b2d1c579 where ES shaders without a #version
declaration would fail to compile if their precision declaration was
wrapped in the standard #ifdef GL_ES check.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74066
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Matt Turner 3e0e9e3bf9 glcpp: Check version_resolved in the proper place.
The check was in the wrong place, such that if a shader incorrectly put
a preprocessor token before the #version declaration, the version would
be resolved twice, leading to a segmentation fault when attempting to
redefine the __VERSION__ macro.

 #extension GL_ARB_sample_shading: require
 #version 130
 void main() {}

Also, rename glcpp_parser_resolve_version to
             glcpp_parser_resolve_implicit_version to avoid confusion.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-27 21:15:35 -08:00
Michel Dänzer a818bf481a r600g: s/r600_llvm_gpu_string/r600_get_llvm_processor_name/
Fixes build failure introduced by commit
65dc588bfd ('r600g,radeonsi: consolidate
get_compute_param'), which consolidated the former into the latter.
2014-01-28 10:12:32 +09:00
Marek Olšák 7209703432 radeonsi: cleanup includes, add missing license
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:13 +01:00
Marek Olšák 2942124db8 radeonsi: remove open-coded PS_PARTIAL_FLUSH event
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:10 +01:00
Marek Olšák 8a4d7c296f radeonsi: move some inline functions from si_pipe.h to si_state.c
And si_tex_aniso_filter is unused.

v2: remove INLINE occurences

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:05 +01:00
Marek Olšák 530348680a radeonsi: remove si_resource.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:04 +01:00
Marek Olšák 6e38a3de8a radeonsi: remove si.h
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:40:02 +01:00
Marek Olšák 27a73a1b94 radeonsi: move si_upload_const_buffer to a better place
This gets rid of another file.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:59 +01:00
Marek Olšák 9f5c037ab9 radeonsi: inline si_translate_index_buffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:57 +01:00
Marek Olšák 0932f0ff14 radeonsi: inline si_upload_index_buffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-01-28 01:39:53 +01:00