Commit Graph

66437 Commits

Author SHA1 Message Date
Kenneth Graunke 8ca8dd123a mesa: Don't call _mesa_ClipControl from glPopAttrib when unsupported.
Otherwise, calling glPopAttrib on drivers that don't support
ARB_clip_control gives you a GL error, which is surprising at best.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 18:26:08 -08:00
Kenneth Graunke f781965097 i965: Disable fast color clears on Skylake for now.
We're not programming the clear values yet, so this won't work.

This patch should be (effectively) reverted eventually.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 15:35:25 -08:00
Kristian Høgsberg c31ce2c40c i965/skl: Use new MOCS for SKL
On Skylake, the MOCS bits are an index into a table of 63 different,
configurable cache configurations.  As for previous GENs, we only care about
WB and WT, which are available in the documented default set.  Define
SKL_MOCS_WB and SKL_MOCS_WT to the indices for those configucations and use
those for the Skylake MOCS values.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:12 -08:00
Jordan Justen 5745aaf15c i965/skl: Implement workaround for VF Invalidate issue
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:09 -08:00
Kenneth Graunke 35bbe177ec i965/skl: Update Viewport Z Clip Test Enable bits for Skylake.
Skylake has separate controls for enabling the Z Clip Test for the near
and far planes.  For now, maintain the legacy behavior by setting both.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:07 -08:00
Kenneth Graunke 77f584c7f9 i965/skl: Emit extra zeros in 3DSTATE_DS on Skylake.
Skylake's 3DSTATE_DS packet has a few more fields; we don't support
domain shaders yet though.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:33:05 -08:00
Kristian Høgsberg 0bb072b42b i965/skl: Init instructions compaction tables for SKL
They are the same as for BDW, so just add a case for SKL to the init switch.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 15:32:59 -08:00
Kristian Høgsberg d235c5afde i965/skl: Add fast clear resolve rect multipliers for SKL
SKL updates the resolve rectangle scaling factors again.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:55 -08:00
Kenneth Graunke 051bfe4d52 i965/skl: Always emit 3DSTATE_BINDING_TABLE_POINTERS_* on Skylake.
On SKL, 3DSTATE_CONSTANT_* command is not committed until we give
the corresponding 3DSTATE_BINDING_TABLE_POINTERS_* command.  If we
fail to do so, the constant buffers wont be read and push constants
will be wrong.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:53 -08:00
Kenneth Graunke 1df496edb9 i965/skl: Allocate 16 DWords for SURFACE_STATE on Skylake.
Otherwise they overlap and horrible things happen.  All the new DWords
are for fast color clear values, which we don't do yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:51 -08:00
Kenneth Graunke d18949ad82 i965/skl: Refactor surface state allocation.
We will need to allocate more DWords on Skylake.

v2: Don't mark brw_context parameter const.  It's modified.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:49 -08:00
Kenneth Graunke 263b584d5e i965/skl: Emit extra zeros in STATE_BASE_ADDRESS on Skylake.
Skylake introduces a new base address for a feature we don't yet expose.
Setting these to 0 should be safe.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:47 -08:00
Kenneth Graunke eaf12022d2 i965/skl: Update stencil reference handling for Skylake.
Skylake uploads the stencil reference values in DW3 of the
3DSTATE_WM_DEPTH_STENCIL packet, rather than in COLOR_CALC_STATE.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:45 -08:00
Kenneth Graunke 822e791321 i965/skl: Set mask bits in PIPELINE_SELECT on Skylake.
Skylake has some extra bits in PIPELINE_SELECT, none of which are
interesting for a 3D driver.  In order to selectively change them, it
also introduces new "mask bits" in 15:8.  We care about the "Pipeline
Selection" bits (1:0), so set the mask to 0x3.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:43 -08:00
Jordan Justen e813728b2b i965/skl: Set max OpenGL version the same as gen7/8
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:41 -08:00
Damien Lespiau 48157b904a i965/skl: Update 3DSTATE_SBE for Skylake.
This commands has seen the addition of 2 dwords that allow to specify
which channels of which attributes need to be forwarded to the fragment
shader.

v2: Rebase forward a year (done by Ken).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-11-03 15:32:34 -08:00
Kenneth Graunke 2b7f73af9c glsl: Improve the CSE pass debugging output.
The CSE pass now prints out why it thinks a value is not a candidate for
adding to the AE set.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-11-03 15:16:50 -08:00
Matt Turner 799106d387 i965/fs: Don't compute_to_mrf() on Gen >= 7.
No differences in shader-db on Haswell (Gen 7.5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-03 11:27:52 -08:00
Matt Turner 5fbcb1b41d glsl: Remove now useless dot optimization on basis vect
The optimization in commit d056863b covers these cases, which were the
first optimizations I added to the GLSL compiler.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-11-03 11:27:50 -08:00
Matt Turner 336e76c143 glsl: Emit mul instead of dot if only one component left.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85683
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85691
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-11-03 11:27:38 -08:00
Tom Stellard 263eb7fa39 clover: Fix clBuildProgram piglit regression
Should trigger CL_INVALID_VALUE if device_list is NULL and num_devices
is greater than zero.

Introduced by e5468dfa52

Reported by: EdB

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-11-03 10:35:07 -05:00
José Fonseca bfd453f942 gallivm: Disable frame-pointer-omission on x86 to ensure right stack alignment.
Between release 3.2 and 3.3 LLVM stopped aligning properly when certain
conditions (no allocas, but large number of vectors causing spills to
the stack, and frame pointer omission enabled).

We were already disabling frame-pointer-omission on several build types,
but we now disable it on all build types.

It's not clear whether this affects 32-bits x86 processes only, or if it
can also affect 64-bits x86_64 processes when AVX registers are
available and used.  So disable frame-pointer-omission on both
x86/x86_64 to be on the safe side.

See also:
- http://llvm.org/PR21435

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-11-03 14:47:00 +00:00
José Fonseca b7e447d323 gallivm: When disassemble a function, start by printing out its name.
To help recognize what's supposed to do.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-11-03 14:47:00 +00:00
Ben Widawsky 5695303563 i965/chv: Increase VS and GS thread counts
AFAICT the number of threads is 80, not 70. I am not sure if Ken knows
something I do not.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-11-02 21:18:08 -08:00
Brian Paul 52576dcb88 gallium/docs: fix NRM, NRM4 docs
Need to do a sqrt().

FWIW, the html that Sphinx 1.1.3 generates for the math expressions
looks completely broken.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-11-01 09:00:07 -06:00
Brian Paul afdc4309dc softpipe: use the tgsi_free_tokens() function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:30:00 -06:00
Brian Paul e6ee85ec61 tgsi: add a tgsi_free_tokens() function
To match tgsi_alloc_tokens().

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul c996b22329 util: simplify u_pstipple.c code
Use the new helper functions in the tgsi_transform.h file to emit
declarations and instructions.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul 55008ef697 util: simplify temp register selection in u_pstipple.c
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul ccd1ea9d52 util: simplify util_pstipple_create_fragment_shader() params
Pass and return tgsi_token buffers instead of pipe_shader_state.

And update softpipe driver (the only user of this function).

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul e3ecb8206a softpipe: remove unused softpipe_create_fs_variant_exec() parameter
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Brian Paul 2b9e63823f softpipe: check for SP_NEW_STIPPLE when building quad pipeline
Fixes polygon stipple if both DO_PSTIPPLE_IN_DRAW_MODULE and
DO_PSTIPPLE_IN_HELPER_MODULE are zero/off.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-10-31 15:29:59 -06:00
Tom Stellard b9e41b587f r600g: Fix build with opencl and radeonsi disabled 2014-10-31 16:26:52 -04:00
Tom Stellard 64b0fac5e2 clover: Fix bug when binary programs are passed to clBuildProgram() v2
This was a regression introduced by
611d66fe45

Passing a binary program to clBuildProgram() is legal, but passing one
to clCompileProgram() is not.

v2:
  - Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-31 15:24:00 -04:00
Tom Stellard e5468dfa52 clover: Factor input validation of clCompileProgram into a new function v2
This factors out the validation that is common with clBuildProgram().

v2:
  - Code cleanups.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-10-31 15:24:00 -04:00
Tom Stellard 1f4e48d5b5 radeonsi/compute: Enable PIPE_SHADER_IR_NATIVE for compute shaders v2
v2:
  - Drop dependency on LLVM >= 3.5.1
  - Rename si_create_shader() to si_shader_binary_read()
2014-10-31 15:24:00 -04:00
Tom Stellard fa07f4b68a r600g/compute: Enable PIPE_SHADER_IR_NATIVE for compute shaders v2
v2:
  - Drop dependency on LLVM >= 3.5.1
2014-10-31 15:24:00 -04:00
Tom Stellard e91735a641 gallium/radeon: Add query for symbol specific config information
This adds a query which allows drivers to access the config
information of a specific function within the LLVM generated ELF
binary.  This makes it possible for the driver to handle ELF
binaries with multiple kernels / global functions.
2014-10-31 15:24:00 -04:00
Marek Olšák f058c6bbd1 r300g: remove enabled/disabled hyperz and AA compression messages
It's annoying with octave. Reported by Michael Burian.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
2014-10-30 22:24:18 +01:00
Dieter Nützel 068b9f4f7a r600g: Delete unused variable 'max_global_size' in 'r600_get_compute_param'
Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2014-10-30 22:24:18 +01:00
Chia-I Wu 4ded2ef5e8 mesa: protect the debug state with a mutex
We are about to change mesa to spawn threads for deferred glCompileShader and
glLinkProgram, and we need to make sure those threads can send compiler
warnings/errors to the debug output safely.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-30 02:26:19 -07:00
Chia-I Wu 2d64e4ffba glsl: protect glsl_type with a mutex
glsl_type has several static hash tables and a static ralloc context.  They
need to be protected by a mutex as they are not thread-safe.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69200
Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-30 02:26:19 -07:00
Chia-I Wu a6706163cb glsl: protect anonymous struct id with a mutex
There may be two contexts compiling shaders at the same time, and we want the
anonymous struct id to be globally unique.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-10-30 02:26:19 -07:00
Chia-I Wu 61c3d49388 util: initialize locale_t with a static object
_mesa_strtod and _mesa_strtof may be called from multiple threads.  They need
to be thread-safe.

v2: platform checks are now done in configure.ac

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-30 02:26:19 -07:00
Chia-I Wu b039dbfffd configure: check for xlocale.h and strtof
With the assumptions that xlocale.h implies newlocale and strtof_l.  SCons is
updated to define HAVE_XLOCALE_H on linux and darwin.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-30 02:26:19 -07:00
Chia-I Wu e3f2029479 util: add _mesa_strtod and _mesa_strtof
Both core mesa and glsl have their own wrappers for strtof_l.  Merge
and move them to util/.  They are compiled with a C++ compiler so that
we can make them thread-safe in a following commit.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whiteacpe.org>
2014-10-30 02:26:19 -07:00
Mathias Fröhlich 2c2ada6720 mesa/gallium: Signal _NEW_TRANSFORM from glClipControl.
This removes the need for the gallium rasterizer state
to listen to viewport changes.
Thanks to Marek Olšák <maraeo@gmail.com>.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2014-10-30 07:52:00 +01:00
Matt Turner 600066af93 Revert "i965/compaction: Disable compaction on SNB temporarily."
This reverts commit cabc93c5ad.

Mark thinks the failures on the SNB GT2 in the lab are actually because
of faulty hardware, not instruction compaction. The GT1 didn't see any
problems after changes to the compaction code.
2014-10-29 21:38:39 -07:00
Matt Turner 601a134180 i965/vec4: Perform CSE on MAD instructions with final arguments switched.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29 21:35:46 -07:00
Matt Turner b65bd9583b i965/fs: Perform CSE on MAD instructions with final arguments switched.
Multiplication is commutative.

instructions in affected programs:     48314 -> 47954 (-0.75%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-10-29 21:35:46 -07:00