mesa.git
9 years agoanv/pipeline: Remove the ViewportState finishme
Jason Ekstrand [Sat, 17 Oct 2015 17:35:27 +0000 (10:35 -0700)]
anv/pipeline: Remove the ViewportState finishme

We should be doing everything we need to with the viewport state

9 years agoanv: Add support for immutable descriptors
Jason Ekstrand [Sat, 17 Oct 2015 15:17:00 +0000 (08:17 -0700)]
anv: Add support for immutable descriptors

9 years agoanv: Add facilities for dumping an image to a file
Jason Ekstrand [Sat, 17 Oct 2015 03:01:45 +0000 (20:01 -0700)]
anv: Add facilities for dumping an image to a file

The ability to dump an arbitrary miplevel or array slice of an anv_image to
a file is very useful for debugging.  Nothing inside of the driver calls
this right now, but it's very useful to call from GDB.

9 years agoanv/pipeline: Rework dynamic state handling
Jason Ekstrand [Fri, 16 Oct 2015 19:04:13 +0000 (12:04 -0700)]
anv/pipeline: Rework dynamic state handling

Aparently, we had the dynamic state array in the pipeline backwards.
Instead of enabling the bits in the pipeline, it disables them and marks
them as "dynamic".

9 years agonir/spirv: Fix handling of vector component selects via OpAccessChain
Jason Ekstrand [Fri, 16 Oct 2015 04:16:41 +0000 (21:16 -0700)]
nir/spirv: Fix handling of vector component selects via OpAccessChain

When we get to the end of the _vtn_load/store_varaible recursion, we may
have one link left in the deref chain if there is a vector component select
on the end.  In this case, we need to truncate the deref chain early so
that, when we make the copy for the load, we don't get the extra deref.
The final deref will be handled by the vector extract/insert that comes
later.

9 years agoanv/cmd_buffer: Reset the command buffer in BeginCommandBuffer
Jason Ekstrand [Fri, 16 Oct 2015 01:28:00 +0000 (18:28 -0700)]
anv/cmd_buffer: Reset the command buffer in BeginCommandBuffer

9 years agoanv/batch_chain: Add some sanity-check asserts for relocations
Jason Ekstrand [Fri, 16 Oct 2015 00:24:32 +0000 (17:24 -0700)]
anv/batch_chain: Add some sanity-check asserts for relocations

9 years agoanv/x11: Only advertise VK_FORMAT_B8R8G8A8_UNORM
Jason Ekstrand [Thu, 15 Oct 2015 23:16:15 +0000 (16:16 -0700)]
anv/x11: Only advertise VK_FORMAT_B8R8G8A8_UNORM

The others don't work at the moment so we shouldn't be advertising them.

9 years agoanv/x11: Treat the pPlatformWindow as a xcb_window_t* instead of xcb_window_t
Jason Ekstrand [Thu, 15 Oct 2015 22:38:20 +0000 (15:38 -0700)]
anv/x11: Treat the pPlatformWindow as a xcb_window_t* instead of xcb_window_t

9 years agoanv/device: Add support for combined image and sampler descriptors
Jason Ekstrand [Thu, 15 Oct 2015 22:17:27 +0000 (15:17 -0700)]
anv/device: Add support for combined image and sampler descriptors

9 years agoanv/device: Remove some unneeded anv_finishmes
Jason Ekstrand [Thu, 15 Oct 2015 22:17:07 +0000 (15:17 -0700)]
anv/device: Remove some unneeded anv_finishmes

9 years agoanv/device: Make the CreateSemaphore stub return success
Jason Ekstrand [Thu, 15 Oct 2015 21:34:07 +0000 (14:34 -0700)]
anv/device: Make the CreateSemaphore stub return success

9 years agoanv: Add support for BufferInfo in descriptor sets
Jason Ekstrand [Thu, 15 Oct 2015 20:45:53 +0000 (13:45 -0700)]
anv: Add support for BufferInfo in descriptor sets

9 years agoanv/cmd_buffer: Add an alloc_surface_state helper
Jason Ekstrand [Thu, 15 Oct 2015 20:45:07 +0000 (13:45 -0700)]
anv/cmd_buffer: Add an alloc_surface_state helper

9 years agoanv: Get rid of the descriptor_set_binding struct
Jason Ekstrand [Thu, 15 Oct 2015 02:00:17 +0000 (19:00 -0700)]
anv: Get rid of the descriptor_set_binding struct

We no longer need it as we have a better way to deal with dynamic offsets.

9 years agoanv: Get rid of backend compiler hacks for descriptor sets
Jason Ekstrand [Thu, 15 Oct 2015 00:02:55 +0000 (17:02 -0700)]
anv: Get rid of backend compiler hacks for descriptor sets

Now that we have anv_nir_apply_pipeline_layout, we can hand the backend
compiler intrinsics and texture instructions that use a flat buffer index
just like it wants.  There's no longer any reason for any of these hacks.

9 years agoanv/nir: Rewrite apply_dynamic_offsets to handle the new vk intrinsics
Jason Ekstrand [Thu, 15 Oct 2015 00:46:24 +0000 (17:46 -0700)]
anv/nir: Rewrite apply_dynamic_offsets to handle the new vk intrinsics

9 years agoanv/nir: Add a pass for applying a applying a pipeline layout to a shader
Jason Ekstrand [Wed, 14 Oct 2015 23:39:58 +0000 (16:39 -0700)]
anv/nir: Add a pass for applying a applying a pipeline layout to a shader

This new pass lowers the _vk intrinsics which take a (set, binding, index)
tripple to the single-index non-vk intrinsics based on the pipeline layout.

9 years agonir/spirv: Use the Vulkan ubo intrinsics
Jason Ekstrand [Wed, 14 Oct 2015 23:49:34 +0000 (16:49 -0700)]
nir/spirv: Use the Vulkan ubo intrinsics

9 years agonir/intrinsics: Add new Vulkan load/store intrinsics
Jason Ekstrand [Wed, 14 Oct 2015 23:37:59 +0000 (16:37 -0700)]
nir/intrinsics: Add new Vulkan load/store intrinsics

9 years agonir/intrinsic: Allow up to four indices
Jason Ekstrand [Wed, 14 Oct 2015 23:37:35 +0000 (16:37 -0700)]
nir/intrinsic: Allow up to four indices

9 years agoanv: Completely rework descriptor set layouts
Jason Ekstrand [Wed, 14 Oct 2015 22:18:49 +0000 (15:18 -0700)]
anv: Completely rework descriptor set layouts

This patch reworks a bunch of stuff in the way we do descriptor set
layouts.  Our previous approach had a couple of problems.  First, it was
based on a misunderstanding of arrays in descriptor sets.  Second, it
didn't properly handle descriptor sets where some bindings were missing
stages.  The new apporach should be correct and also makes some operations,
particularly those on the hot-path, a bit easier.

We use the descriptor set layout for four things:

 1) To determine the map from bindings to the actual flattened descriptor
    set in vkUpdateDescriptorSets().

 2) To determine the descriptor <-> binding table entry mapping to use in
    anv_cmd_buffer_flush_descriptor_sets().

 3) To determine the mappings of dynamic indices.

 4) To determine the (set, binding, array index) -> binding table entry
    mapping inside of shaders.

The new approach is directly taylored towards these operations.

9 years agovk: Add README
Chad Versace [Wed, 14 Oct 2015 20:56:48 +0000 (13:56 -0700)]
vk: Add README

Requested by developers outside Intel.

During the driver's pre-release development, let's make the README easy
to find for external experimenters. Keep it at the top of the source
tree.

9 years agonir/spirv: Fix a bug in indirect OpAccessChain handling
Jason Ekstrand [Wed, 14 Oct 2015 03:00:05 +0000 (20:00 -0700)]
nir/spirv: Fix a bug in indirect OpAccessChain handling

9 years agoanv/image: Add a basic implementation of GetImageSubresourceLayout
Jason Ekstrand [Tue, 13 Oct 2015 22:50:02 +0000 (15:50 -0700)]
anv/image: Add a basic implementation of GetImageSubresourceLayout

9 years agoanv/formats: Use the surface_format_info struct from brw_surface_formats.h
Jason Ekstrand [Tue, 13 Oct 2015 22:20:28 +0000 (15:20 -0700)]
anv/formats: Use the surface_format_info struct from brw_surface_formats.h

The surface_format_info struct changed in mesa but the copied-and-pasted
version didn't get updated on the last mesa master merge.  This both fixes
the bug and should prevent this in the future.

9 years agoi965/surface_formats: Pull the surface_format_info struct into a header
Jason Ekstrand [Tue, 13 Oct 2015 22:19:58 +0000 (15:19 -0700)]
i965/surface_formats: Pull the surface_format_info struct into a header

9 years agoanv/x11: Do something sensible if get_geometry fails in GetSurfaceProperties
Jason Ekstrand [Tue, 13 Oct 2015 22:00:35 +0000 (15:00 -0700)]
anv/x11: Do something sensible if get_geometry fails in GetSurfaceProperties

9 years agoanv/wsi: Add the GetSurfacePresentModesKHR stub
Jason Ekstrand [Tue, 13 Oct 2015 18:45:58 +0000 (11:45 -0700)]
anv/wsi: Add the GetSurfacePresentModesKHR stub

Support has existed in the X11 and Wayland backends for a while but,
somehow, the entrypoint got missed in the API shuffle.

9 years agoanv: Declare/validate the correct API version
Jason Ekstrand [Tue, 13 Oct 2015 01:25:19 +0000 (18:25 -0700)]
anv: Declare/validate the correct API version

9 years agoanv/device: Return VK_SUCCESS after setting pCount in QueueFamilyProperties
Jason Ekstrand [Sat, 10 Oct 2015 16:31:03 +0000 (09:31 -0700)]
anv/device: Return VK_SUCCESS after setting pCount in QueueFamilyProperties

9 years agoMerge ../mesa into vulkan
Kristian Høgsberg Kristensen [Thu, 8 Oct 2015 19:25:34 +0000 (12:25 -0700)]
Merge ../mesa into vulkan

9 years agoanv/queue: Get rid of the serial
Jason Ekstrand [Thu, 8 Oct 2015 19:15:58 +0000 (12:15 -0700)]
anv/queue: Get rid of the serial

This was a remnant of the object tagging implementation we had at one
point.  We haven't used it for a long time so there's no good reason to
keep it around.

9 years agoi965: Link compiler unit tests to libi965_compiler.la
Kristian Høgsberg Kristensen [Wed, 7 Oct 2015 12:09:48 +0000 (05:09 -0700)]
i965: Link compiler unit tests to libi965_compiler.la

We can now link the unit tests against just libi965_compiler.la. This
lets us drop a lot of DRI driver dependencies, but we still pull in all
of libmesa and more.

This also provides a few standalone users of libi965_compiler.la, which
will help us accidentally using i965_dri.so functions from the compiler.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Break out backend compiler to its own library
Kristian Høgsberg Kristensen [Tue, 6 Oct 2015 23:54:52 +0000 (16:54 -0700)]
i965: Break out backend compiler to its own library

This introduces a new libtool helper library, libi965_compiler.la.  This
library is moderately self-contained, but still needs to link to all of
libmesa.la among other things.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965/cs: Get max_cs_threads from brw_compiler devinfo
Kristian Høgsberg Kristensen [Wed, 7 Oct 2015 12:13:50 +0000 (05:13 -0700)]
i965/cs: Get max_cs_threads from brw_compiler devinfo

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Move brw_get_shader_time_index() call out of emit functions
Kristian Høgsberg Kristensen [Wed, 7 Oct 2015 12:06:30 +0000 (05:06 -0700)]
i965: Move brw_get_shader_time_index() call out of emit functions

brw_get_shader_time_index() is all tangled up in brw_context state and
we can't call it from the compiler. Thanks the Jasons recent
refactoring, we can just get the index and pass to the emit functions
instead.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Move brw_select_clip_planes() to brw_shader.cpp
Kristian Høgsberg Kristensen [Wed, 7 Oct 2015 11:19:39 +0000 (04:19 -0700)]
i965: Move brw_select_clip_planes() to brw_shader.cpp

We call this from the compiler so move it to brw_shader.cpp.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Use util_next_power_of_two() for brw_get_scratch_size()
Kristian Høgsberg Kristensen [Mon, 5 Oct 2015 21:02:56 +0000 (14:02 -0700)]
i965: Use util_next_power_of_two() for brw_get_scratch_size()

This function computes the next power of two, but at least 1024. We can
do that by bitwise or'ing in 1023 and calling util_next_power_of_two().

We use brw_get_scratch_size() from the compiler so we need it out of
brw_program.c. We could move it to brw_shader.cpp, but let's make it a
small inline function instead.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Move brw_mark_surface_used() to brw_shader.cpp
Kristian Høgsberg Kristensen [Tue, 6 Oct 2015 23:11:08 +0000 (16:11 -0700)]
i965: Move brw_mark_surface_used() to brw_shader.cpp

brw_program.c won't be part of the compiler library, but we need
brw_mark_surface_used() in the compiler. Move to brw_shader.cpp.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965/cs: Split out helper for building local id payload
Kristian Høgsberg Kristensen [Tue, 6 Oct 2015 05:07:58 +0000 (22:07 -0700)]
i965/cs: Split out helper for building local id payload

The initial motivation for this patch was to avoid calling
brw_cs_prog_local_id_payload_dwords() in gen7_cs_state.c from the
compiler. This commit ends up refactoring things a bit more so as to
split out the logic to build the local id payload to brw_fs.cpp. This
moves the payload building closer to the compiler code that uses the
payload layout and makes it available to other users of the compiler.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Move brw_link_shader() and friends to new file brw_link.cpp
Kristian Høgsberg Kristensen [Mon, 5 Oct 2015 21:22:23 +0000 (14:22 -0700)]
i965: Move brw_link_shader() and friends to new file brw_link.cpp

We want to use the rest of brw_shader.cpp with the rest of the compiler
without pulling in the GLSL linking code.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Configure bufmgr debug options from intel_screen.c
Kristian Høgsberg Kristensen [Tue, 6 Oct 2015 23:19:04 +0000 (16:19 -0700)]
i965: Configure bufmgr debug options from intel_screen.c

We need the debug flag parsing and INTEL_DEBUG in the compiler, but we
don't want the dependency on bufmgr (libdrm_intel) in there. Move to
intel_screen.c.

There are now only two lines left in brw_process_intel_debug_variable(),
but we keep it in intel_debug.h to avoid having to expose
'debug_control' as a global variable.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoutil: Move DRI parse_debug_string() to util
Kristian Høgsberg Kristensen [Mon, 5 Oct 2015 21:13:29 +0000 (14:13 -0700)]
util: Move DRI parse_debug_string() to util

We want to use intel_debug.c in code that doesn't link to dri common.

v2: Remove unnecessary stddef.h include (Topi), use util/debug.h
    in all DRI driver and remove driParseDebugString() (Iago).

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agoi965: Move brw_dump_ir() out of brw_*_emit() functions
Kristian Høgsberg Kristensen [Mon, 5 Oct 2015 20:58:05 +0000 (13:58 -0700)]
i965: Move brw_dump_ir() out of brw_*_emit() functions

We move these calls one level up into the codegen functions.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
9 years agovk/0.170.2: Update to the new VK_EXT_KHR_swapchain extensions
Jason Ekstrand [Wed, 7 Oct 2015 21:13:55 +0000 (14:13 -0700)]
vk/0.170.2: Update to the new VK_EXT_KHR_swapchain extensions

9 years agogallium/ddebug: add missing dd_util.h to sources list
Emil Velikov [Thu, 8 Oct 2015 14:50:54 +0000 (15:50 +0100)]
gallium/ddebug: add missing dd_util.h to sources list

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
9 years agogallium/ddebug: automake: sort sources alphabetically
Emil Velikov [Thu, 8 Oct 2015 14:50:12 +0000 (15:50 +0100)]
gallium/ddebug: automake: sort sources alphabetically

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
9 years agonir/sweep: Reparent the shader name
Jason Ekstrand [Tue, 6 Oct 2015 00:16:02 +0000 (17:16 -0700)]
nir/sweep: Reparent the shader name

Previously the name of the nir shader was being freed prematurely during
nir_sweep. Since 756613ed35d the name was later being used to generate
filenames for the optimiser debug output and these would end up with
garbage from the dangling pointer.

Co-authored-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoc11/threads: initialize timeout structure
Jan Vesely [Sun, 4 Oct 2015 00:19:13 +0000 (19:19 -0500)]
c11/threads: initialize timeout structure

Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agodocs/relnotes: document EGL_KHR_create_context on llvmpipe and softpipe
Boyan Ding [Thu, 8 Oct 2015 07:38:15 +0000 (15:38 +0800)]
docs/relnotes: document EGL_KHR_create_context on llvmpipe and softpipe

Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
9 years agoi965/gs/gen6: Maximum allowed size of SEND messages is 15 (4 bits)
Iago Toral Quiroga [Wed, 23 Sep 2015 06:52:07 +0000 (08:52 +0200)]
i965/gs/gen6: Maximum allowed size of SEND messages is 15 (4 bits)

Comit d48ac9306619 addressed this for VS, but we forgot to do the same for
URB writes generated by the gen6 GS.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Define FIRST_SPILL_MRF and FIRST_PULL_LOAD_MRF only once and in one place
Iago Toral Quiroga [Tue, 22 Sep 2015 11:14:52 +0000 (13:14 +0200)]
i965: Define FIRST_SPILL_MRF and FIRST_PULL_LOAD_MRF only once and in one place

That should make tracking where we do spills and pull loads a bit easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: make pull constant loads in gen6 start at MRFs 16/17
Iago Toral Quiroga [Tue, 22 Sep 2015 11:01:18 +0000 (13:01 +0200)]
i965: make pull constant loads in gen6 start at MRFs 16/17

So they do not conflict with our (un)spills (MRF 21..23) or our
URB writes (MRF 1..15)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Fix remove_duplicate_mrf_writes so it can handle 24 MRFs in gen6
Iago Toral Quiroga [Tue, 22 Sep 2015 10:53:08 +0000 (12:53 +0200)]
i965: Fix remove_duplicate_mrf_writes so it can handle 24 MRFs in gen6

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: include bad type in error string of _mesa_pack_depth_span
Tapani Pälli [Thu, 8 Oct 2015 06:25:16 +0000 (09:25 +0300)]
mesa: include bad type in error string of _mesa_pack_depth_span

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoglsl: add varyings to resource list only with SSO
Tapani Pälli [Wed, 7 Oct 2015 07:04:06 +0000 (10:04 +0300)]
glsl: add varyings to resource list only with SSO

Varyings can be considered inputs or outputs of a program only when
SSO is in use. With multi-stage programs, inputs contain only inputs
for first stage and outputs contains outputs of the final shader stage.

I've tested that fix works for Assault Android Cactus (demo version)
and does not cause Piglit or CTS regressions in glGetProgramiv tests.

Following ES 3.1 CTS separate shader tests that do query properties
of varyings in SSO shader programs pass:

   ES31-CTS.program_interface_query.separate-programs-vertex
   ES31-CTS.program_interface_query.separate-programs-fragment

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92122

9 years agomesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks
Jason Ekstrand [Wed, 7 Oct 2015 22:52:09 +0000 (15:52 -0700)]
mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks

The EXT_texture_format_BGRA8888 extension (which mesa supports
unconditionally) adds a new format and internal format called GL_BGRA_EXT.
Previously, this was not really handled at all in
_mesa_ex3_error_check_format_and_type.  When the checks were tightened in
commit f15a7f3c, we accidentally tightened things too far and GL_BGRA_EXT
would always cause an error to be thrown.

There were two primary issues here.  First, is that
_mesa_es3_effective_internal_format_for_format_and_type didn't handle the
GL_BGRA_EXT format.  Second is that it blindly uses _mesa_base_tex_format
which returns GL_RGBA for GL_BGRA_EXT.  This commit fixes both of these
issues as well as adds explicit checks that GL_BGRA_EXT is only ever used
with GL_BGRA_EXT and GL_UNSIGNED_BYTE.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
9 years agoRevert "mesa: enable KHR_debug for ES contexts"
Emil Velikov [Wed, 7 Oct 2015 20:23:16 +0000 (21:23 +0100)]
Revert "mesa: enable KHR_debug for ES contexts"

This reverts commit b69cfbdf18fa64606a76761b20bc268f4ac731e5.

This isn't quite baked yet. Seems that despite building the ES piglits,
none of them got executed.

9 years agoMerge branch 'vulkan-0.170.2' into vulkan
Chad Versace [Wed, 7 Oct 2015 18:48:29 +0000 (11:48 -0700)]
Merge branch 'vulkan-0.170.2' into vulkan

This updates the API from 0.138.2 to 0.170.2,
and updates SPIR-V to v32.

9 years agoegl/dri2: Properly dereference array.
Matt Turner [Wed, 7 Oct 2015 18:43:58 +0000 (11:43 -0700)]
egl/dri2: Properly dereference array.

Fixes a regression that broke EGL since

commit 858f2f2ae6d72f338fdd6d544b0c733814e22724
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sun Sep 13 12:25:27 2015 +0100

    egl/dri2: ease srgb __DRIconfig conditionals

9 years agovk: Remove temporary vulkan headers
Chad Versace [Wed, 7 Oct 2015 18:45:48 +0000 (11:45 -0700)]
vk: Remove temporary vulkan headers

Remove vulkan-0.138.2.h and vulkan-0.170.2.h. Their purpose was to aid
the header update to 0.170.2.

9 years agovk/0.170.2: Bump header version
Chad Versace [Wed, 7 Oct 2015 18:44:44 +0000 (11:44 -0700)]
vk/0.170.2: Bump header version

The header is now fully updated.

9 years agovk/0.170.2: Update C++ errata and typedefs
Chad Versace [Wed, 7 Oct 2015 18:43:13 +0000 (11:43 -0700)]
vk/0.170.2: Update C++ errata and typedefs

9 years agovk/0.170.2: Update remaining enums
Chad Versace [Wed, 7 Oct 2015 18:39:49 +0000 (11:39 -0700)]
vk/0.170.2: Update remaining enums

9 years agovk/0.170.2: Update VkResult
Chad Versace [Wed, 7 Oct 2015 18:36:51 +0000 (11:36 -0700)]
vk/0.170.2: Update VkResult

Version 0.170.2 removes most of the error enums. In many cases, I had to
replace an error with a less accurate (or even incorrect) one.
In other cases, the error path is replaced with an assertion.

9 years agovk/0.170: Update VkDescriptorInfo
Chad Versace [Wed, 7 Oct 2015 17:58:55 +0000 (10:58 -0700)]
vk/0.170: Update VkDescriptorInfo

Ignore the new bufferInfo field with a anv_finishme.

9 years agovk/0.170.2: Update vkCreateDescriptorPool
Chad Versace [Wed, 7 Oct 2015 17:45:41 +0000 (10:45 -0700)]
vk/0.170.2: Update vkCreateDescriptorPool

Nothing to do. In Mesa the pool is a stub.

9 years agovk/0.170.2: Update VkAttachmentDescription
Chad Versace [Wed, 7 Oct 2015 17:44:40 +0000 (10:44 -0700)]
vk/0.170.2: Update VkAttachmentDescription

9 years agovk/0.170.2: Update VkImageViewCreateInfo
Chad Versace [Wed, 7 Oct 2015 17:43:44 +0000 (10:43 -0700)]
vk/0.170.2: Update VkImageViewCreateInfo

9 years agovk/0.170.2: Update VkImageCreateInfo
Chad Versace [Wed, 7 Oct 2015 17:42:59 +0000 (10:42 -0700)]
vk/0.170.2: Update VkImageCreateInfo

9 years agovk/0.170.2: Update VkPhysicalDeviceProperties
Chad Versace [Wed, 7 Oct 2015 17:36:46 +0000 (10:36 -0700)]
vk/0.170.2: Update VkPhysicalDeviceProperties

9 years agovk/0.170.2: Update VkImageFormatProperties
Chad Versace [Wed, 7 Oct 2015 17:28:30 +0000 (10:28 -0700)]
vk/0.170.2: Update VkImageFormatProperties

9 years agoradeonsi: fix a GS hang on VI
Marek Olšák [Fri, 2 Oct 2015 17:21:54 +0000 (19:21 +0200)]
radeonsi: fix a GS hang on VI

Broken by one of the cleanups: 0d46c3bc9d09b376d74f7399e1a2d1b0a923640b
Not applicable to stable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoradeonsi: remove TC L2 cache flush for index buffers on VI
Marek Olšák [Sun, 6 Sep 2015 13:43:23 +0000 (15:43 +0200)]
radeonsi: remove TC L2 cache flush for index buffers on VI

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
9 years agovk/0.170.2: Update VkFormatProperties
Chad Versace [Wed, 7 Oct 2015 17:15:59 +0000 (10:15 -0700)]
vk/0.170.2: Update VkFormatProperties

9 years agovk/0.170.2: Update VkPhysicalDeviceFeatures
Chad Versace [Wed, 7 Oct 2015 17:05:02 +0000 (10:05 -0700)]
vk/0.170.2: Update VkPhysicalDeviceFeatures

9 years agovk/0.170.2: Update VkPhysicalDeviceLimits
Chad Versace [Wed, 7 Oct 2015 16:57:51 +0000 (09:57 -0700)]
vk/0.170.2: Update VkPhysicalDeviceLimits

9 years agoanv/device: Remove some #ifdef'd out code
Jason Ekstrand [Wed, 7 Oct 2015 16:45:47 +0000 (09:45 -0700)]
anv/device: Remove some #ifdef'd out code

This was a left-over from the dynamic state update.

9 years agovk/0.170.2: Make vkUpdateDescriptorSets return void
Jason Ekstrand [Wed, 7 Oct 2015 16:44:51 +0000 (09:44 -0700)]
vk/0.170.2: Make vkUpdateDescriptorSets return void

9 years agoanv/pipeline: Add support for dynamic state in pipelines
Jason Ekstrand [Wed, 7 Oct 2015 16:28:21 +0000 (09:28 -0700)]
anv/pipeline: Add support for dynamic state in pipelines

9 years agovk/0.170.2: Switch to the new dynamic state model
Jason Ekstrand [Wed, 7 Oct 2015 00:21:44 +0000 (17:21 -0700)]
vk/0.170.2: Switch to the new dynamic state model

9 years agoanv: Add a dynamic state data structure and basic helpers
Jason Ekstrand [Wed, 7 Oct 2015 16:31:53 +0000 (09:31 -0700)]
anv: Add a dynamic state data structure and basic helpers

9 years agoanv/private: Add a typed_memcpy macro
Jason Ekstrand [Wed, 7 Oct 2015 16:27:31 +0000 (09:27 -0700)]
anv/private: Add a typed_memcpy macro

This is amazingly helpful when copying arrays of things around.

9 years agovk/meta: Fix -Wstrict-prototypes
Chad Versace [Wed, 7 Oct 2015 16:09:37 +0000 (09:09 -0700)]
vk/meta: Fix -Wstrict-prototypes

In C, functions with no arguments require a void argument.
build_nir_clear_fragment_shader() lacked that.

Fixes:
  anv_meta.c:70:1: warning: function declaration isn't a prototype
  [-Wstrict-prototypes]

9 years agovk/0.170.2: Merge VkAttachmentView into VkImageView
Chad Versace [Wed, 7 Oct 2015 14:30:52 +0000 (07:30 -0700)]
vk/0.170.2: Merge VkAttachmentView into VkImageView

9 years agovk/image: Fix retrieval of anv_surface for depthstencil aspect
Chad Versace [Wed, 7 Oct 2015 16:03:47 +0000 (09:03 -0700)]
vk/image: Fix retrieval of anv_surface for depthstencil aspect

If anv_image_get_surface_for_aspect_mask() is given a combined
depthstencil aspect mask, and the image has a stencil surface but no
depth surface, then return the stencil surface.

Hacks on hacks.

9 years agosvga: whitespace fixes in svga_sampler_view.c
Brian Paul [Tue, 6 Oct 2015 22:55:39 +0000 (16:55 -0600)]
svga: whitespace fixes in svga_sampler_view.c

9 years agosvga: whitespace fixes in svga_resource_buffer.c
Brian Paul [Tue, 6 Oct 2015 22:55:39 +0000 (16:55 -0600)]
svga: whitespace fixes in svga_resource_buffer.c

9 years agomesa: Remove GL_ARB_sampler_object depth compare error checking.
Stefan Dösinger [Tue, 6 Oct 2015 22:55:39 +0000 (16:55 -0600)]
mesa: Remove GL_ARB_sampler_object depth compare error checking.

Version 3: Simplify the code comment, word wrap commit description.

Version 2: Return GL_FALSE if ARB_shadow is unsupported instead of
pretending to store the value as suggested by Brian Paul.

This fixes a GL error warning on r200 in Wine.

The GL_ARB_sampler_objects extension does not specify a dependency on
GL_ARB_shadow or GL_ARB_depth_texture for setting the depth texture
compare mode and function. Silently ignore attempts to change these
settings. They won't matter without a depth texture being assigned
anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agosvga: round UBO constant buffer size up/down to multiple of 16 bytes
Brian Paul [Tue, 6 Oct 2015 22:55:39 +0000 (16:55 -0600)]
svga: round UBO constant buffer size up/down to multiple of 16 bytes

The svga3d device requires constant buffers to be a multiple of 16 bytes
in size.  OpenGL UBOs may not fit that restriction.  As a work-around,
round the size up if possible, else round down.

Note that this patch only effects UBO constant buffers (index 1 or higher),
not the 0th/default constant buffer.

Fixes the game Grim Fandango Remastered.  VMware bug 1510130.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
9 years agovk: Drop -Wextra
Chad Versace [Wed, 7 Oct 2015 14:28:46 +0000 (07:28 -0700)]
vk: Drop -Wextra

Eliminates lots of warnings due to anv_meta.c's inclusion of nir.h.

I like the extra warnings, and they should probably get fixed. However,
git-grep reveals that no other Mesa directory uses -Wextra. Building
Vulkan produces a lot of compiler warnings from core Mesa headers that
no other Mesa developer sees, and hence no other Mesa developer will
fix.

9 years agoegl/dri2: enable EGL_KHR_gl_colorspace for swrast
Emil Velikov [Sun, 13 Sep 2015 11:36:54 +0000 (12:36 +0100)]
egl/dri2: enable EGL_KHR_gl_colorspace for swrast

No driver changes needed for softpipe/llvmpipe - things just work.

v2: Whitespace fixes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
9 years agoegl/dri2: ease srgb __DRIconfig conditionals
Emil Velikov [Sun, 13 Sep 2015 11:25:27 +0000 (12:25 +0100)]
egl/dri2: ease srgb __DRIconfig conditionals

One can simplify the if-else chain, by declaring the driconfigs as a
two sized array, whist using srgb as a index to the correct entry.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
9 years agomesa: enable KHR_debug for ES contexts
Emil Velikov [Mon, 14 Sep 2015 17:35:48 +0000 (18:35 +0100)]
mesa: enable KHR_debug for ES contexts

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomain/get: make KHR_debug enums available everywhere
Matthew Waters [Wed, 16 Sep 2015 15:38:27 +0000 (16:38 +0100)]
main/get: make KHR_debug enums available everywhere

Move all the enums but CONTEXT_FLAGS. The spec seems quite explicit
about the latter (wrt OpenGL ES)

    "In OpenGL ES versions prior to and including ES 3.1 there is no
    CONTEXT_FLAGS state and therefore the CONTEXT_FLAG_DEBUG_BIT cannot
    be queried."

v2 [Emil Velikov] Rebase.
v3 [Emil Veliokv] Drop the CONTEXT_FLAGS hunk - not applicable for GLES

Signed-off-by: Matthew Waters <ystreet00@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglapi: add function pointers for KHR_debug for gles
Matthew Waters [Mon, 14 Sep 2015 17:35:46 +0000 (18:35 +0100)]
glapi: add function pointers for KHR_debug for gles

v2 [Emil Velikov]
 - Rebase.
 - Correct version in gles11 dispatch_sanity.
 - Move the extension enable to a separate patch.

Signed-off-by: Matthew Waters <ystreet00@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl: move memcpy to bring conf->base operations together
Varad Gautam [Wed, 7 Oct 2015 04:18:15 +0000 (09:48 +0530)]
egl: move memcpy to bring conf->base operations together

Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl: restore surface type before linking config to its display
Varad Gautam [Wed, 7 Oct 2015 04:18:14 +0000 (09:48 +0530)]
egl: restore surface type before linking config to its display

commit c2c2e9a (egl: implement EGL_KHR_gl_colorspace (v2)) leaves
_EGLConfig->SurfaceType set incorrectly before calling _eglLinkConfig(),
and the bad value is passed around to platform_android. set it to zero
as earlier.

v2: Set SurfaceType to 0, rather than surface_type (Suggested by Emil)

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91596
Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agonouveau: make sure there's always room to emit a fence
Ilia Mirkin [Mon, 5 Oct 2015 19:19:05 +0000 (15:19 -0400)]
nouveau: make sure there's always room to emit a fence

I started seeing a lot of situations on nv30 where fence emission
wouldn't fit into the previous buffer (causing assertions). This ensures
that whenever checking for space, we always leave a bit of extra room
for the fence emission commands. Adjusts the nv30 and nvc0 fence
emission logic to bypass the space checking as well.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>