Commit Graph

74186 Commits

Author SHA1 Message Date
Chad Versace 8cb2e27c62 vk/0.170.2: Update VkRenderPassBeginInfo
Rename members:
    attachmentCount -> clearValueCount
    pAttachmentClearValues -> pClearValues
2015-10-04 09:26:25 -07:00
Chad Versace 3694518be5 vk/0.170.2: Drop VkBufferViewCreateInfo::viewType 2015-10-04 09:14:57 -07:00
Chad Versace 216d9f248d vk: Copy current header to vulkan-0.138.2.h
While upgrading Mesa to the new 0.170.2 API, it's convenient to have all
three headers available in the tree:
    - vulkan-0.138.2.h, the old one
    - vulkan-0.170.2.h, the new one
    - vulkan.h, the one in transition
2015-10-04 09:09:35 -07:00
Chad Versace 7f18ed4b9f vk: Import header 0.170.2 header LunarG SDK
From the LunarG SDK at tag sdk-0.9.1, import vulkan.h as
vulkan-0.170.2.h. This header is the first provisional header with the
addition of minor fixes.
2015-10-04 09:09:31 -07:00
Jason Ekstrand 09ba0a7c05 Merge remote-tracking branch 'mesa-public/master' into vulkan 2015-10-03 11:32:29 -07:00
Emil Velikov 3cd5395206 docs: add news item and link release notes for 10.6.9
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-03 13:23:13 +01:00
Emil Velikov 61c35ce4f9 docs: add sha256 checksums for 10.6.9
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 8957b696f9cc8a92b2c160c551c34545447ec28a)
2015-10-03 13:20:08 +01:00
Emil Velikov b2a987fc12 docs: add release notes for 10.6.9
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit ab9aacce2d26a802bac81fc25748320428996692)
2015-10-03 13:20:06 +01:00
Matthew Waters 11cabc45b7 egl: rework handling EGL_CONTEXT_FLAGS
As of version 15 of the EGL_KHR_create_context spec, debug contexts
are allowed for ES contexts.  We should allow creation instead of
erroring.

While we're here provide a more comprehensive checking for the other two
flags - ROBUST_ACCESS_BIT_KHR and FORWARD_COMPATIBLE_BIT_KHR

v2 [Emil Velikov] Rebase. Minor tweak in commit message.

Cc: Boyan Ding <boyan.j.ding@gmail.com>
Cc: Chad Versace <chad.versace@intel.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91044
Signed-off-by: Matthew Waters <ystreet00@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-03 12:30:13 +01:00
Jason Ekstrand 443d3bf340 i965/wm: Make compute_barycentric_interp_modes take a nir_shader and a devinfo
Now that everything comes in through NIR, we can pick this directly out of
the shader source and don't need to reference the gl_fragment_program.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 21:21:20 -07:00
Jason Ekstrand 1e3c1b107e i965: Use nir_foreach_variable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 21:21:18 -07:00
Jason Ekstrand 050e4787d3 nir: Add a nir_foreach_variable macro
This is a common enough operation that it's nice to not have to think about
the arguments to foreach_list_typed every time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 21:21:16 -07:00
Jason Ekstrand ca941799ce i965/nir: Remove the prog parameter from brw_nir_lower_inputs
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 21:21:00 -07:00
Jason Ekstrand ef56cf7738 Merge remote-tracking branch 'mesa-public/master' into vulkan 2015-10-02 16:52:47 -07:00
Tom Stellard a2e1e3d325 radeon/llvm: Initialize gallivm targets when initializing the AMDGPU target v2
This fixes a race condition in the glx-multithreaded-shader-compile
test.

v2:
  - Replace gallivm_init_llvm_{begin,end}() with gallivm_init_llvm_targets().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

CC: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
2015-10-02 23:41:27 +00:00
Tom Stellard 76cfd6f1da gallivm: Allow drivers and state trackers to initialize gallivm LLVM targets v2
Drivers and state trackers that use LLVM for generating code, must
register the targets they use with LLVM's global TargetRegistry.
The TargetRegistry is not thread-safe, so all targets must be added
to the registry before it can be queried for target information.

When drivers and state trackers initialize their own targets, they need
a way to force gallivm to initialize its targets at the same time.
Otherwise, there can be a race condition in some multi-threaded
applications (e.g. glx-multihreaded-shader-compile in piglit),
when one thread creates a context for a driver that uses LLVM (e.g.
radeonsi) and another thread creates a gallivm context (glxContextCreate
does this).

The race happens when the driver thread initializes its LLVM targets and
then starts using the registry before the gallivm thread has a chance to
register its targets.

This patch allows users to force gallivm to register its targets by
calling the gallivm_init_llvm_targets() function.

v2:
  - Use call_once and remove mutexes and static initializations.
  - Replace gallivm_init_llvm_{begin,end}() with
    gallivm_init_llvm_targets().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

CC: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
2015-10-02 23:41:26 +00:00
Jason Ekstrand 10f97718c3 anv/allocator: Add a sanity assertion in state stream finish.
We assert that the block offset we got while walking the list of blocks is
actually a multiple of the block size.  If something goes wrong and the GPU
decides to stomp on the surface state buffer we can end up getting
corruptions in our list of blocks.  This assertion makes such corruptions a
crash with a meaningful message rather than an infinite loop.
2015-10-02 16:24:42 -07:00
Jason Ekstrand 002e7b0cc3 anv: Remove the GLSL -> SPIR-V scraper/converter
This was very useful to get us up-and-going.  However, now that we can use
NIR directly for meta shaders, we don't need this anymore and we might as
well drop the glslc dependency.
2015-10-02 16:20:04 -07:00
Tom Stellard 3219b48ae5 gallium/radeon: Use call_once() when initailizing LLVM targets
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

CC: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
2015-10-02 23:19:01 +00:00
Jason Ekstrand f5ffb0e0cb anv/meta: Use NIR directly for blit shaders 2015-10-02 16:18:44 -07:00
Jason Ekstrand 7851a4392a anv/meta: Use NIR directly for clear shaders 2015-10-02 16:18:32 -07:00
Jason Ekstrand add99c4beb anv: Add a back-door for passing NIR shaders directly into the pipeline
This will allow us to use NIR directly for meta operations rather than
having to go through SPIR-V.
2015-10-02 16:16:57 -07:00
Jason Ekstrand b68805f83c anv: Add some NIR builder helpers
These should all eventually be up-streamed.  However, since they currently
have no upstream users, they would just bitrot there.  We'll keep them
local for the time being.
2015-10-02 16:15:53 -07:00
Jason Ekstrand bf7b6fd3fd i965/shader: Get rid of the shader, prog, and shader_prog fields
Unfortunately, we can't get rid of them entirely.  The FS backend still
needs gl_program for handling TEXTURE_RECTANGLE.  The GS vec4 backend still
needs gl_shader_program for handling transfom feedback.  However, the VS
needs neither and we can substantially reduce the amount they are used.
One day we will be free from their tyranny.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:54 -07:00
Jason Ekstrand 404419ee1a i965/fs,vec4: Get rid of the sanity_param_count
It doesn't exist for anything other than an assert that, as far as I can
tell, isn't possible to trip.  Soon, we will remove prog from the visitor
entirely and this will become even more impossible to hit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand ca6a436f12 i965/vec4: Use nir info instead of pulling things out of [shader_]prog
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand 756613ed35 i965/fs: Use the nir info instead of pulling things out of [shader_]prog
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand b62e36d18f i965/fs: Move sampler unit lookup into rescale_texcoord
The texunit variable we create and assign in nir_emit_texture gets passed
through two more layers of function calls before it gets to its sole use in
rescale_texcoord.  The best part is that we already pass the sampler into
rescale_texcoord so we can just look it up there.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand 7b974c5f90 i965/cs: Remove the prog argument from local_id_payload_dwords
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand 7926c3ea7d i965/backend_shader: Add a field to store the NIR shader
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand 7a8d06b6dd nir: Move GS data to nir_shader_info
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand e4fea486da nir: Add a a nir_shader_info struct
This commit also adds code to glsl_to_nir and prog_to_nir to fill it out.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand cd1ae6ebfa nir/glsl: Take a gl_shader_program and a stage rather than a gl_shader
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand 30c6357113 i965: Move prog_data uniform setup to the codegen level
As of now, uniform setup is more-or-less unified between vec4 and fs and no
longer requires the fs_visitor.  This makes uniform setup more of a
language/API thing than a backend compiler thing.  This commit moves
setting up the stage_prog_data.params arrays to the same place as we set up
the rest of stage_prog_data.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand ea006c4cb5 i965: Move binding table setup to codegen time.
Setting up binding tables really has little to do with the actual process
of turning shaders into instructions; it's more part of setting up
prog_data.  This commit moves it out of the visitors and with the rest of
the prog_data setup stuff.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:53 -07:00
Jason Ekstrand 28709e37d9 i965/shader: Pull assign_common_binding_table_offsets out of backend_shader
This really has nothing to do with the backend compiler and we'd like to
eventually be able to set this up earlier in the compile process.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-02 14:22:52 -07:00
Jason Ekstrand cdf314cb21 i965/nir: Simplify uniform setup
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand 7fee8b6f05 i965/nir: Pull GLSL uniform handling into a common function
The way we deal with GLSL uniforms and builtins is basically the same in
both the vec4 and the fs backend.  This commit takes the best parts of both
implementations and pulls the common code into a shared helper function.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand 03c4171b57 i965/nir: Pull common ARB program uniform handling into a common function
The way we deal with ARB program uniforms is basically the same in both the
vec4 and the fs backend.  This commit takes the best parts of both
implementations and pulls the common code into a shared helper function.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand 390b48fc4a i965/vec4: Use the uniform count from nir_assign_var_locations
Previously, we were counting up uniforms as we set them up.  However, this
count should be exactly identical to shader->num_uniforms provided by
nir_assign_var_locations.  (If it's not, we're in trouble anyway because
that means that locations don't match up.)  This matches what the fs
backend is already doing.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand 3de81508ea i965/shader: Get rid of the setup_vec4_uniform_value helper
It's not used by anything anymore

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand 58cea0c2b6 i965/shader: Pull setup_image_uniform_values out of backend_shader
I tried to do this once before but Curro pointed out that having it in
backend_shader meant it could use the setup_vec4_uniform_values helper
which did different things in vec4 and fs.  Now the setup_uniform_values
function differs only by an assert in the two backends so there's no real
good reason to be using it anymore.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand 5609e0d7b4 i965/vec4: Get rid of the uniform_vector_size array
The uniform_vector_size array was only ever used by pack_uniform_registers
which no longer needs it.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand ea35fb0fbe i965/vec4: Use the actual channels used in pack_uniform_registers
Previously, pack_uniform_registers worked based on the size of the uniform
as given to us when we initially set up the uniforms.  However, we have to
walk through the uniforms and figure out liveness anyway, so we migh as
well record the number of channels used as we go.  This may also allow us
to pack things tighter in a few cases.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand cd2132f45b glsl/types: Make subroutine types have a single matrix column
That way, if we do the usual thing of multiplying vector_elements by
matrix_columns we get the actual number of components in the type as per
component_slots().

While we're at it, we also switch to using the actual C++ field
initializers for vector_elements and matrix_columns.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand a7e0f755bc i965: Pull stage_prog_data.nr_params out of the NIR shader
Previously, we had a bunch of code in each stage to figure out how many
slots we needed in stage_prog_data.param.  This code was mostly identical
across the stages and had been copied and pasted around.  Unfortunately,
this meant that any time you did something special, you had to add code for
it to each of these places.  In particular, none of the stages took
subroutines into account; they were working entirely by accident.  By
taking this data from the NIR shader, we know the exact number of entries
we need and everything goes a bit smoother.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:39 -07:00
Jason Ekstrand fc3f45234b i965/vs: Move lazy NIR creation to codegen_vs_prog
The next commit will add code to codegen_vs_prog that requires the NIR
shader to be there in all cases.  It doesn't hurt anything to just move it
from brw_vs_emit to its only caller.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2015-10-02 14:19:38 -07:00
Jason Ekstrand 64b145422b i965/vec4: Delete the old vec4_vp code
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-10-02 14:19:36 -07:00
Jason Ekstrand 1153f12076 i965/vec4: Delete the old ir_visitor code
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-10-02 14:19:34 -07:00
Jason Ekstrand b85761d11d i965/vec4: Always use NIR
GLSL IR vs. NIR shader-db results for vec4 programs on i965:

   total instructions in shared programs: 1499328 -> 1388354 (-7.40%)
   instructions in affected programs:     1245199 -> 1134225 (-8.91%)
   helped:                                7469
   HURT:                                  2440

GLSL IR vs. NIR shader-db results for vec4 programs on G4x:

   total instructions in shared programs: 1436799 -> 1325825 (-7.72%)
   instructions in affected programs:     1205599 -> 1094625 (-9.20%)
   helped:                                7469
   HURT:                                  2440

GLSL IR vs. NIR shader-db results for vec4 programs on Iron Lake:

   total instructions in shared programs: 1436654 -> 1325682 (-7.72%)
   instructions in affected programs:     1205503 -> 1094531 (-9.21%)
   helped:                                7468
   HURT:                                  2440

GLSL IR vs. NIR shader-db results for vec4 programs on Sandy Bridge:

   total instructions in shared programs: 2016249 -> 1787033 (-11.37%)
   instructions in affected programs:     1850547 -> 1621331 (-12.39%)
   helped:                                14856
   HURT:                                  1481

GLSL IR vs. NIR shader-db results for vec4 programs on Ivy Bridge:

   total instructions in shared programs: 1848027 -> 1648216 (-10.81%)
   instructions in affected programs:     1660279 -> 1460468 (-12.03%)
   helped:                                14668
   HURT:                                  1369

GLSL IR vs. NIR shader-db results for vec4 programs on Bay Trail:

   total instructions in shared programs: 1848027 -> 1648216 (-10.81%)
   instructions in affected programs:     1660279 -> 1460468 (-12.03%)
   helped:                                14668
   HURT:                                  1369

GLSL IR vs. NIR shader-db results for vec4 programs on Haswell:

   total instructions in shared programs: 1848027 -> 1648216 (-10.81%)
   instructions in affected programs:     1660279 -> 1460468 (-12.03%)
   helped:                                14668
   HURT:                                  1369

I also ran our full suite of benchmarks on a Haswell and had the following
statistically significant (according to ministat) changes:

   Test                        master-glsl     master-nir     diff
   bench_OglGeomPoint          461.556         463.006        1.450
   bench_OglTerrainFlyInst     184.484         187.574        3.090
   bench_OglTerrainPanInst     132.412         136.307        3.895
   bench_OglTexFilterAniso     19.653          19.645         -0.008
   bench_OglTexFilterTri       58.333          58.009         -0.324
   bench_OglVSInstancing       65.049          65.327         0.278
   bench_trexoff               69.474          69.694         0.220
   bench_valley                40.708          41.125         0.417

v2 (Jason Ekstrand):
 - Remove more uses of NirOptions as a switch
 - New shader-db numbers
 - Added benchmark numbers

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-10-02 14:18:46 -07:00