mesa.git
8 years agoanv/blorp: Break the guts of alloc_binding_table into a shared helper
Jason Ekstrand [Sat, 22 Oct 2016 00:01:17 +0000 (17:01 -0700)]
anv/blorp: Break the guts of alloc_binding_table into a shared helper

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv: Bring back anv_cmd_buffer_emit_state_base_address
Jason Ekstrand [Fri, 21 Oct 2016 23:53:46 +0000 (16:53 -0700)]
anv: Bring back anv_cmd_buffer_emit_state_base_address

This reverts most of commit 52904ba85c7e1e3092601e3497bfbc246b00b84a.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Add a clear_attachments entrypoint
Jason Ekstrand [Fri, 21 Oct 2016 21:50:20 +0000 (14:50 -0700)]
intel/blorp: Add a clear_attachments entrypoint

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Add capability to use pre-baked binding tables
Jason Ekstrand [Sat, 22 Oct 2016 00:15:49 +0000 (17:15 -0700)]
intel/blorp: Add capability to use pre-baked binding tables

When a pre-baked binding table is requested, no binding table is created,
instead the binding table offset (relative to surface state base address)
provided by the user is used verbatim.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Add support for vertex shaders
Jason Ekstrand [Fri, 21 Oct 2016 20:10:52 +0000 (13:10 -0700)]
intel/blorp: Add support for vertex shaders

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Use an actual chunk of vertex buffer for the VUE header
Jason Ekstrand [Fri, 21 Oct 2016 21:32:03 +0000 (14:32 -0700)]
intel/blorp: Use an actual chunk of vertex buffer for the VUE header

We're about to start passing other things in as a sort of "VS header" for
vertex shaders and we need a place to put them.  Since we want the instance
id to be one of them, it makes sense to have one vec4 that's either VUE
header or VS header.  Always uploading some handy zeros makes the code a
bit simpler.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoblorp/exec: Use uint32_t for copying varying data
Jason Ekstrand [Fri, 21 Oct 2016 21:22:10 +0000 (14:22 -0700)]
blorp/exec: Use uint32_t for copying varying data

Some things may not be floats and intel CPUs are known for mangling bits
when a float type is used for copying integers.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Handle NIR clear inputs the same way as blit inputs
Jason Ekstrand [Fri, 21 Oct 2016 21:15:03 +0000 (14:15 -0700)]
intel/blorp: Handle NIR clear inputs the same way as blit inputs

By using offsetof() we can ensure that adding fiels to wm_inputs is always
safe as long as we maintain alignment.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Remove NIR support for uniforms
Jason Ekstrand [Fri, 21 Oct 2016 19:01:37 +0000 (12:01 -0700)]
intel/blorp: Remove NIR support for uniforms

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Add a shader type to make keys more unique
Jason Ekstrand [Fri, 21 Oct 2016 18:30:05 +0000 (11:30 -0700)]
intel/blorp: Add a shader type to make keys more unique

Depending on how the driver using blorp implements its shader caching,
there is a small chance of shader collisions due to identical keys between
blit and clear programs.  Adding a small shader type at the top of the key
alleviates this problem.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/blorp: Make the number of samples an explicit parameter
Jason Ekstrand [Fri, 21 Oct 2016 17:40:58 +0000 (10:40 -0700)]
intel/blorp: Make the number of samples an explicit parameter

Previously, we always inferred it from params->dst which meant that
references to params->dst were scattered all throughout the state upload
code.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv/cmd_buffer: Stop relying on the framebuffer for 3DSTATE_SF on gen7
Jason Ekstrand [Wed, 19 Oct 2016 23:37:03 +0000 (16:37 -0700)]
anv/cmd_buffer: Stop relying on the framebuffer for 3DSTATE_SF on gen7

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv: Rework the way render target surfaces are allocated
Jason Ekstrand [Wed, 19 Oct 2016 18:33:55 +0000 (11:33 -0700)]
anv: Rework the way render target surfaces are allocated

This commit moves the allocation and filling out of surface state from
CreateImageView time to BeginRenderPass time.  Instead of allocating the
render target surface state as part of the image view, we allocate it in
the command buffer state at the same time that we set up clears.  For
secondary command buffers, we allocate memory for the surface states in
BeginCommandBuffer but don't fill them out; instead, we use our new
SOL-based memcpy function to copy the surface states from the primary
command buffer.  This allows us to handle secondary command buffers without
the user specifying the framebuffer ahead-of-time.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv/cmd_buffer: Expose add_surface_state_reloc as an inline helper
Jason Ekstrand [Wed, 19 Oct 2016 17:29:30 +0000 (10:29 -0700)]
anv/cmd_buffer: Expose add_surface_state_reloc as an inline helper

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv/cmd_buffer: Use the surface state alloc helper in null_surface_state
Jason Ekstrand [Wed, 19 Oct 2016 17:15:27 +0000 (10:15 -0700)]
anv/cmd_buffer: Use the surface state alloc helper in null_surface_state

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv: Add a helper for doing buffer copies with nothing but VF and SOL.
Jason Ekstrand [Mon, 26 Sep 2016 19:10:11 +0000 (12:10 -0700)]
anv: Add a helper for doing buffer copies with nothing but VF and SOL.

This method of doing copies has the advantage of touching very little of
the GPU state.  While it does disable all the shader stages, it doesn't
have to blow away binding tables, viewports, scissors, or any other bits of
dynamic state other than VBO 32 which is already reserved.  All of the
state that it does touch is contained within a pipeline anyway so that's
the only thing that has to be dirtied.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/genxml: Add SO_WRITE_OFFSET registers for gen7-9
Jason Ekstrand [Wed, 19 Oct 2016 02:02:07 +0000 (19:02 -0700)]
intel/genxml: Add SO_WRITE_OFFSET registers for gen7-9

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agointel/isl: Add some basic info about RENDER_SURFACE_STATE to isl_device
Jason Ekstrand [Tue, 20 Sep 2016 05:04:40 +0000 (22:04 -0700)]
intel/isl: Add some basic info about RENDER_SURFACE_STATE to isl_device

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
8 years agoanv/pipeline: Use get_scratch_space/address for compute shaders
Jason Ekstrand [Sat, 12 Nov 2016 21:33:16 +0000 (13:33 -0800)]
anv/pipeline: Use get_scratch_space/address for compute shaders

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv: Move INTERFACE_DESCRIPTOR_DATA setup to the pipeline
Jason Ekstrand [Sat, 12 Nov 2016 20:13:17 +0000 (12:13 -0800)]
anv: Move INTERFACE_DESCRIPTOR_DATA setup to the pipeline

There are a few dynamic bits, namely binding table and sampler addresses,
but most of it is static and really belongs in the pipeline.  It certainly
doesn't belong in flush_compute_descriptor_set.  We'll use the same state
merging trick we use for gen7 DEPTH_STENCIL.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipeline: Roll genX_pipeline_util.h into genX_pipeline.c
Jason Ekstrand [Sat, 12 Nov 2016 19:42:09 +0000 (11:42 -0800)]
anv/pipeline: Roll genX_pipeline_util.h into genX_pipeline.c

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipeline: Unify graphics_pipeline_create
Jason Ekstrand [Sat, 12 Nov 2016 19:39:07 +0000 (11:39 -0800)]
anv/pipeline: Unify graphics_pipeline_create

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipline: Re-order state emission and make it consistent
Jason Ekstrand [Sat, 12 Nov 2016 19:28:17 +0000 (11:28 -0800)]
anv/pipline: Re-order state emission and make it consistent

This commit makes both gen7 and gen8 pipeline setup emit state packets
in exactly the same order.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Rework the 3DSTATE_VF_TOPOLOGY helper
Jason Ekstrand [Sat, 12 Nov 2016 19:26:05 +0000 (11:26 -0800)]
anv/pipeline: Rework the 3DSTATE_VF_TOPOLOGY helper

It gets a new name and moved to genX_pipeline_util.h.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Move 3DSTATE_PS_EXTRA setup into a helper
Jason Ekstrand [Sat, 12 Nov 2016 19:14:53 +0000 (11:14 -0800)]
anv/pipeline: Move 3DSTATE_PS_EXTRA setup into a helper

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Unify 3DSTATE_WM emission
Jason Ekstrand [Sat, 12 Nov 2016 19:11:37 +0000 (11:11 -0800)]
anv/pipeline: Unify 3DSTATE_WM emission

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agointel/genxml: Make 3DSTATE_WM more consistent across gens
Jason Ekstrand [Sat, 12 Nov 2016 18:46:02 +0000 (10:46 -0800)]
intel/genxml: Make 3DSTATE_WM more consistent across gens

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipeline: Unify 3DSTATE_PS emission
Jason Ekstrand [Sat, 12 Nov 2016 17:42:58 +0000 (09:42 -0800)]
anv/pipeline: Unify 3DSTATE_PS emission

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipeline/gen7: Properly set 3DSTATE_PS::DualSourceBlendEnable
Jason Ekstrand [Mon, 14 Nov 2016 17:17:20 +0000 (09:17 -0800)]
anv/pipeline/gen7: Properly set 3DSTATE_PS::DualSourceBlendEnable

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agointel/genxml: Make some 3DSTATE_PS fields more consistent
Jason Ekstrand [Sat, 12 Nov 2016 17:35:37 +0000 (09:35 -0800)]
intel/genxml: Make some 3DSTATE_PS fields more consistent

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Make emit_3dstate_sbe safe to call without a FS
Jason Ekstrand [Sat, 12 Nov 2016 18:58:48 +0000 (10:58 -0800)]
anv/pipeline: Make emit_3dstate_sbe safe to call without a FS

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipeline: Unify 3DSTATE_GS emission
Jason Ekstrand [Sat, 12 Nov 2016 17:18:52 +0000 (09:18 -0800)]
anv/pipeline: Unify 3DSTATE_GS emission

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline/gen8: Set 3DSTATE_GS::InstanceControl
Jason Ekstrand [Mon, 14 Nov 2016 16:42:22 +0000 (08:42 -0800)]
anv/pipeline/gen8: Set 3DSTATE_GS::InstanceControl

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agointel/genxml: Make some 3DSTATE_GS fields more consistent
Jason Ekstrand [Sat, 12 Nov 2016 17:05:59 +0000 (09:05 -0800)]
intel/genxml: Make some 3DSTATE_GS fields more consistent

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Unify 3DSTATE_VS emission
Jason Ekstrand [Sat, 12 Nov 2016 16:43:54 +0000 (08:43 -0800)]
anv/pipeline: Unify 3DSTATE_VS emission

With this commit, a few fields are now specified on gen7 which weren't
before.  However, the values specified are zero which is the default so the
final hardware packet remains the same.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline/gen8: Enable VS statistics
Jason Ekstrand [Sat, 12 Nov 2016 16:40:25 +0000 (08:40 -0800)]
anv/pipeline/gen8: Enable VS statistics

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
8 years agoanv/pipeline: Stop claiming to support running without a vertex shader
Jason Ekstrand [Sat, 12 Nov 2016 16:34:33 +0000 (08:34 -0800)]
anv/pipeline: Stop claiming to support running without a vertex shader

From the Vulkan spec version 1.0.32 docs for vkCreateGraphicsPipelines:

    The stage member of one element of pStages must be
    VK_SHADER_STAGE_VERTEX_BIT

Since a vertex shader is always required, this hasn't been used since we
deleted meta.  Let's get rid of the complexity.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agointel/genxml: Make some VS/GS fields consistent across gens
Jason Ekstrand [Fri, 21 Oct 2016 20:08:48 +0000 (13:08 -0700)]
intel/genxml: Make some VS/GS fields consistent across gens

We use the names from gen8+

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Get rid of the kernel pointer fields
Jason Ekstrand [Sat, 12 Nov 2016 16:07:54 +0000 (08:07 -0800)]
anv/pipeline: Get rid of the kernel pointer fields

Now that we have anv_shader_bin, they're completely redundant with other
information we have in the pipeline.  For vertex shaders, we also go
through way too much work to put the offset in one or the other field and
then look at which one we put it in later.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agoanv/pipeline: Set correct binding table and sampler counts
Jason Ekstrand [Sat, 12 Nov 2016 15:56:41 +0000 (07:56 -0800)]
anv/pipeline: Set correct binding table and sampler counts

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
8 years agomesa: if MESA_DEBUG=context, create a debug context
Brian Paul [Tue, 15 Nov 2016 22:56:04 +0000 (15:56 -0700)]
mesa: if MESA_DEBUG=context, create a debug context

A number of drivers report useful debug/perf information accessible
through GL_ARB_debug_output and with debug contexts (i.e. setting the
GLX_CONTEXT_DEBUG_BIT_ARB flag).  But few applications actually use
the GL_ARB_debug_output extension.

This change lets one set the MESA_DEBUG env var to "context" to force-set
a debug context and report debug/perf messages to stderr (or whatever
file MESA_LOG_FILE is set to).  This is a useful debugging tool.

The small change in st_api_create_context() is needed so that
st_update_debug_callback() gets called to hook up the driver debug
callbacks when ST_CONTEXT_FLAG_DEBUG was not set, but MESA_DEBUG=context.

v2: use %.*s format string instead of allocating temporary buffer.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agou_simple_shaders: try to un-break the Windows build
Nicolai Hähnle [Wed, 16 Nov 2016 10:26:11 +0000 (11:26 +0100)]
u_simple_shaders: try to un-break the Windows build

Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoradeonsi: fix a subtle bounds checking corner case with 3-component attributes
Nicolai Hähnle [Tue, 8 Nov 2016 14:24:04 +0000 (15:24 +0100)]
radeonsi: fix a subtle bounds checking corner case with 3-component attributes

I'm also sending out a piglit test, gl-2.0/vertexattribpointer-size-3,
which exposes this corner case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoradeonsi: reject some 3-component formats as buffer textures
Nicolai Hähnle [Tue, 8 Nov 2016 14:15:18 +0000 (15:15 +0100)]
radeonsi: reject some 3-component formats as buffer textures

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agost/mesa: swap bytes in the fallback format translation path of GetTexImage
Nicolai Hähnle [Wed, 9 Nov 2016 14:49:22 +0000 (15:49 +0100)]
st/mesa: swap bytes in the fallback format translation path of GetTexImage

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agost/mesa: simplify and fix st_GetTexSubImage
Nicolai Hähnle [Wed, 9 Nov 2016 14:46:21 +0000 (15:46 +0100)]
st/mesa: simplify and fix st_GetTexSubImage

By using _mesa_image_address, the code becomes simpler _and_ fixes the bug
that GL_PACK_SKIP_IMAGES was applied even on non-3D textures.

Also, converting a whole slice at a time simplifies the format translation
fallback path.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore.

v2: fix a silly mistake during code movement

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agost/mesa: fix SINT <-> UINT conversion during PBO upload / download
Nicolai Hähnle [Mon, 7 Nov 2016 17:12:08 +0000 (18:12 +0100)]
st/mesa: fix SINT <-> UINT conversion during PBO upload / download

This fixes use cases like glReadPixels from an RGBA8I framebuffer into
a PBO with type GL_INT by clamping values appropriately when they fall
outside the range of the destination format.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agost/mesa: change st_pbo_create_upload_fs to st_pbo_get_upload_fs
Nicolai Hähnle [Mon, 7 Nov 2016 16:55:56 +0000 (17:55 +0100)]
st/mesa: change st_pbo_create_upload_fs to st_pbo_get_upload_fs

For consistency with st_pbo_get_download_fs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agost/mesa: fix ReadPixels into packed formats with PBO
Nicolai Hähnle [Mon, 7 Nov 2016 16:49:24 +0000 (17:49 +0100)]
st/mesa: fix ReadPixels into packed formats with PBO

When using the GPU download path, we bind the PBO as a buffer texture,
so call is_format_supported accordingly. On radeonsi, this means that
GPU downloads aren't used for UNSIGNED_SHORT_5_6_5 destinations, for
example.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoutil/blitter: add clamping during SINT <-> UINT blits
Nicolai Hähnle [Mon, 7 Nov 2016 14:55:52 +0000 (15:55 +0100)]
util/blitter: add clamping during SINT <-> UINT blits

Even though glBlitFramebuffer cannot be used for SINT <-> UINT blits, we
still need to handle this type of blit here because it can happen as part
of texture uploads / downloads, e.g. uploading a GL_RGBA8I texture from
GL_UNSIGNED_INT data.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoutil/blitter: index texfetch_col shaders by type
Nicolai Hähnle [Mon, 7 Nov 2016 14:36:18 +0000 (15:36 +0100)]
util/blitter: index texfetch_col shaders by type

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
8 years agoi965: miptree: prevent potential NULL pointer access
Lionel Landwerlin [Wed, 9 Nov 2016 16:33:51 +0000 (16:33 +0000)]
i965: miptree: prevent potential NULL pointer access

If the mcs buffer allocation fails we might get a NULL pointer. This
was reported by Coverity and should only happen if we run out of
memory.

v2: return failure at the point of allocation (Chris)

CID: 1394290
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
8 years agointel/blorp: Use designated initializers in surf_convert_to_single_slice
Jordan Justen [Tue, 15 Nov 2016 10:21:00 +0000 (02:21 -0800)]
intel/blorp: Use designated initializers in surf_convert_to_single_slice

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoEGL/android: pbuffer implementation
Liu Zhiquan [Wed, 16 Nov 2016 02:11:28 +0000 (10:11 +0800)]
EGL/android: pbuffer implementation

Android path didn't support pbuffer, so add pbuffer support to fix
most failing dEQP and CTS pbuffer test cases.

Patch adds a single buffer config to support pbuffer, and creates
image in getBuffers for pbuffer when surface type is front surface.

The EGL 1.5 spec states that pbuffers have a back buffer but no front
buffer, single-buffered surfaces with no front buffer confuse Mesa;
so we deviate from the spec, following the precedent of Mesa's EGL
X11 platform.

V3: update commit message and code review changes.

Signed-off-by: Liu Zhiquan <zhiquan.liu@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoegl: add missing error-checking to eglReleaseTexImage()
Eric Engestrom [Fri, 30 Sep 2016 23:23:26 +0000 (00:23 +0100)]
egl: add missing error-checking to eglReleaseTexImage()

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
8 years agoi965: Fix KBL typo in string
Ben Widawsky [Thu, 10 Nov 2016 18:20:13 +0000 (10:20 -0800)]
i965: Fix KBL typo in string

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Consolidate GEN9 LP definition
Ben Widawsky [Thu, 10 Nov 2016 18:20:12 +0000 (10:20 -0800)]
i965: Consolidate GEN9 LP definition

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965/glk: Add basic Geminilake support
Ben Widawsky [Thu, 10 Nov 2016 18:20:11 +0000 (10:20 -0800)]
i965/glk: Add basic Geminilake support

v2: s/bdw/gen; Add the 2x6 config
v3: Add min_ds_entries

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoutil: Fix Clang trivial destructor check.
Vinson Lee [Mon, 14 Nov 2016 06:53:54 +0000 (22:53 -0800)]
util: Fix Clang trivial destructor check.

Check for Clang before GCC.

Clang defines __GNUC__ == 4 and __GNUC_MINOR__ == 2 and matches the GCC
check but not the GCC version for trivial destructor.

Fixes: 98ab905af0e0 ("mesa: Define introspection macro to determine
whether a type is trivially destructible.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98526
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
8 years agoswr: mark color clamping as unsupported
Ilia Mirkin [Sun, 13 Nov 2016 14:20:03 +0000 (09:20 -0500)]
swr: mark color clamping as unsupported

There is no functionality in swr to clamp either vertex or frag colors.
This could be added in swr_shader, at which point these could be
re-enabled.

Fixes arb_color_buffer_float-render

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: always enable adding start/base vertex to gl_VertexId
Ilia Mirkin [Sun, 13 Nov 2016 02:02:20 +0000 (21:02 -0500)]
swr: always enable adding start/base vertex to gl_VertexId

Fixes gl-3.2-basevertex-vertexid

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: add support for upper-left fragcoord position
Ilia Mirkin [Sat, 12 Nov 2016 23:58:46 +0000 (18:58 -0500)]
swr: add support for upper-left fragcoord position

Fixes glsl-arb-fragment-coord-conventions.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
8 years agoswr: make sure that all rendering is finished on shader destroy
Ilia Mirkin [Sat, 12 Nov 2016 19:20:53 +0000 (14:20 -0500)]
swr: make sure that all rendering is finished on shader destroy

Rendering could still be ongoing (or have yet to start) when the shader
is deleted. There's no refcounting on the shader text, so insert a
pipeline stall unconditionally when this happens.

[Note, we should instead introduce a way to attach work to
fences, so that the freeing can be done in the current fence.]

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: disable blending for integer formats
Ilia Mirkin [Sat, 12 Nov 2016 18:27:28 +0000 (13:27 -0500)]
swr: disable blending for integer formats

The EXT_texture_integer test says that blending and alphatest should
all be disabled. st/mesa takes care of alphatest already.

Fixes the ext_texture_integer-fbo-blending piglit test.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: mark rgb9_e5 as unrenderable
Ilia Mirkin [Sat, 12 Nov 2016 08:24:17 +0000 (03:24 -0500)]
swr: mark rgb9_e5 as unrenderable

The support in swr requires shaders to output the components as UINTs.
This is not how GL or Gallium work, and since this is not a
required-renderable format, just leave it out.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: no support for shader stencil export
Ilia Mirkin [Sat, 12 Nov 2016 07:30:51 +0000 (02:30 -0500)]
swr: no support for shader stencil export

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: mark both frag and vert textures read, don't forget about cbs
Ilia Mirkin [Thu, 10 Nov 2016 03:08:24 +0000 (22:08 -0500)]
swr: mark both frag and vert textures read, don't forget about cbs

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: fix texture layout for compressed formats
Ilia Mirkin [Wed, 9 Nov 2016 21:41:16 +0000 (16:41 -0500)]
swr: fix texture layout for compressed formats

Fixes the texsubimage piglit and lets the copyteximage one get further.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: add archrast generated files to gitignore
Ilia Mirkin [Wed, 9 Nov 2016 23:04:46 +0000 (18:04 -0500)]
swr: add archrast generated files to gitignore

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer jitter] don't bother quantizing unused channels
Ilia Mirkin [Sat, 12 Nov 2016 18:17:27 +0000 (13:17 -0500)]
swr: [rasterizer jitter] don't bother quantizing unused channels

In a BGR10X2 or BGR5X1 situation, there's no need to try to quantize the
X channel - the default will have the proper quantization required.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer memory] fix store tile for 128-bit ymajor tiling
Ilia Mirkin [Sat, 12 Nov 2016 08:30:38 +0000 (03:30 -0500)]
swr: [rasterizer memory] fix store tile for 128-bit ymajor tiling

Noticed by inspection.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoswr: [rasterizer memory] add support for R32_FLOAT_X8X24 formats
Ilia Mirkin [Wed, 9 Nov 2016 22:17:19 +0000 (17:17 -0500)]
swr: [rasterizer memory] add support for R32_FLOAT_X8X24 formats

This is the format used for the primary surface of a
PIPE_FORMAT_Z32_FLOAT_S8X24_UINT resource.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoac/nir/llvm: fix channel in texture gather lowering code.
Dave Airlie [Tue, 15 Nov 2016 07:30:09 +0000 (07:30 +0000)]
ac/nir/llvm: fix channel in texture gather lowering code.

This fixes a number of CTS tests like:
dEQP-VK.glsl.texture_gather.basic.2d.rgba8ui.size_npot.clamp_to_edge_repeat

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoradv: don't crash on null swapchain destroy.
Dave Airlie [Tue, 15 Nov 2016 20:11:51 +0000 (20:11 +0000)]
radv: don't crash on null swapchain destroy.

Just return if the passed in swapchain is NULL.

Fixes: dEQP-VK.wsi.xlib.swapchain.destroy.null_handle
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agowsi: fix VK_INCOMPLETE for vkGetSwapchainImagesKHR
Dave Airlie [Tue, 15 Nov 2016 21:18:50 +0000 (21:18 +0000)]
wsi: fix VK_INCOMPLETE for vkGetSwapchainImagesKHR

This fixes the x11 and wayland backends to not assert:
dEQP-VK.wsi.xcb.swapchain.get_images.incomplete

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoisl: Fix height calculation in isl_msaa_interleaved_scale_px_to_sa
Jordan Justen [Tue, 15 Nov 2016 10:18:25 +0000 (02:18 -0800)]
isl: Fix height calculation in isl_msaa_interleaved_scale_px_to_sa

No known fixed tests, but it looks like a typo from:

commit 8ac99eabb6570f0f3c5f7d7da1332a99ce636362

    intel/isl: Add a helper for getting the size of an interleaved pixel

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoamd: automake: android: rename sources lists to foo_FILES
Emil Velikov [Tue, 15 Nov 2016 19:36:33 +0000 (19:36 +0000)]
amd: automake: android: rename sources lists to foo_FILES

Autotools goes smart on us warning that foo_SOURCES variable is present
yet a target with name foo is missing. Rename things (like we do
throughout the build) to silence the warnings.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoamd: flatten amd/common makefile structure
Mauro Rossi [Sat, 12 Nov 2016 21:10:44 +0000 (22:10 +0100)]
amd: flatten amd/common makefile structure

This pulls amd/common build rules into upper level makefile,
along with amd/addlib which is already there.

v2: [Emil Velikov]
 - Move NEED_RADEON_LLVM conditional, drop amd/common from SUBDIRS
 - Drop AM_ from common_libamd_common_la*

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoradeonsi: set IF_THRESHOLD to 3
Marek Olšák [Fri, 28 Oct 2016 21:08:50 +0000 (23:08 +0200)]
radeonsi: set IF_THRESHOLD to 3

Piglit regressions (radeonsi or LLVM bugs, they pass on softpipe):
- glsl-1.10/execution/variable-indexing/vs-output-array-vec3-index-wr
- glsl-1.10/execution/variable-indexing/vs-output-array-vec4-index-wr
- glsl-110/execution/variable-indexing/vs-temp-array-mat2-index-col-row-wr
- glsl-110/execution/variable-indexing/vs-temp-array-mat2-index-row-wr

Totals:
SGPRS: 1132185 -> 1168801 (3.23 %)
VGPRS: 907856 -> 906204 (-0.18 %)
Spilled SGPRs: 2011 -> 2425 (20.59 %)
Spilled VGPRs: 368 -> 96 (-73.91 %)
Scratch VGPRs: 1344 -> 1060 (-21.13 %) dwords per thread
Code Size: 35916164 -> 35705372 (-0.59 %) bytes
LDS: 767 -> 767 (0.00 %) blocks
Max Waves: 194010 -> 194921 (0.47 %)
Wait states: 0 -> 0 (0.00 %)

Before:
 VGPR SPILLING APPS   Shaders SpillVGPR ScratchVGPR
 alien_isolation         2938        38        40
 bioshock-infinite       1769       245       732
 dirt-showdown            548        85        72
 f1-2015                  776         0       320
 ue4_lightroom_inter..     74         0       180

After:
 VGPR SPILLING APPS   Shaders SpillVGPR ScratchVGPR
 alien_isolation         2938        38        40
 bioshock-infinite       1769         0       480
 dirt-showdown            548        58        40
 f1-2015                  776         0       320
 ue4_lightroom_inter..     74         0       180

Bioshock and DiRT benefit.

If I set IF_THRESHOLD=4, tesseract starts spilling VGPRs

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl_to_tgsi: lower small branches based on the CAP
Marek Olšák [Fri, 28 Oct 2016 20:37:33 +0000 (22:37 +0200)]
glsl_to_tgsi: lower small branches based on the CAP

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium: add PIPE_SHADER_CAP_LOWER_IF_THRESHOLD
Marek Olšák [Fri, 28 Oct 2016 20:34:20 +0000 (22:34 +0200)]
gallium: add PIPE_SHADER_CAP_LOWER_IF_THRESHOLD

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl/lower_if: conditionally lower if-branches based on their size
Marek Olšák [Sun, 3 Jul 2016 15:11:07 +0000 (17:11 +0200)]
glsl/lower_if: conditionally lower if-branches based on their size

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl/lower_if: don't lower branches touching tess control outputs
Marek Olšák [Sun, 3 Jul 2016 15:01:09 +0000 (17:01 +0200)]
glsl/lower_if: don't lower branches touching tess control outputs

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl/lower_if: check more node types in check_control_flow -> check_ir_node
Marek Olšák [Sun, 3 Jul 2016 13:03:54 +0000 (15:03 +0200)]
glsl/lower_if: check more node types in check_control_flow -> check_ir_node

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoglsl/lower_if: move and rename found_control_flow
Marek Olšák [Sun, 3 Jul 2016 12:57:20 +0000 (14:57 +0200)]
glsl/lower_if: move and rename found_control_flow

I'll want to update more variables in check_control_flow, so using
the visitor is convenient.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoutil/disk_cache: use unambiguous naming
Marek Olšák [Sun, 13 Nov 2016 15:54:38 +0000 (16:54 +0100)]
util/disk_cache: use unambiguous naming

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoutil: import cache.c/h from glsl
Marek Olšák [Sun, 13 Nov 2016 15:38:01 +0000 (16:38 +0100)]
util: import cache.c/h from glsl

It's not dependent on GLSL and it can be useful for shader caches that don't
deal with GLSL.

v2: address review comments
v3: keep the other 3 lines in configure.ac

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agogallivm: limit use of setFastMathFlags to LLVM 3.8 and later
Marek Olšák [Tue, 15 Nov 2016 18:56:03 +0000 (19:56 +0100)]
gallivm: limit use of setFastMathFlags to LLVM 3.8 and later

Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agointel: Set min_ds_entries on Broxton.
Kenneth Graunke [Tue, 15 Nov 2016 08:15:02 +0000 (00:15 -0800)]
intel: Set min_ds_entries on Broxton.

This was missing.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com>
8 years agodri: make use of loader_get_extensions_name(..) helper
Christian Gmeiner [Wed, 9 Nov 2016 14:50:06 +0000 (15:50 +0100)]
dri: make use of loader_get_extensions_name(..) helper

Changes since v1:
 - removed not needed includes
 - use the loader version of the helper

v2 [Emil Velikov]
 - Keep the includes - they are required.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoRevert "dri: make use of dri_get_extensions_name(..) helper"
Emil Velikov [Tue, 15 Nov 2016 18:01:20 +0000 (18:01 +0000)]
Revert "dri: make use of dri_get_extensions_name(..) helper"

This reverts commit 1a21d21580965eff751414d140b3c176eeee2eb3.

Pushed the wrong version of the patch.

8 years agoradeonsi: set unsafe fpmath on FP instructions when allowed by R600_DEBUG
Marek Olšák [Sat, 12 Nov 2016 22:10:23 +0000 (23:10 +0100)]
radeonsi: set unsafe fpmath on FP instructions when allowed by R600_DEBUG

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallivm: add lp_create_builder with an unsafe_fpmath option
Marek Olšák [Sat, 12 Nov 2016 22:08:51 +0000 (23:08 +0100)]
gallivm: add lp_create_builder with an unsafe_fpmath option

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: fold some shader context initialization to si_llvm_context_init
Marek Olšák [Sat, 12 Nov 2016 21:51:41 +0000 (22:51 +0100)]
radeonsi: fold some shader context initialization to si_llvm_context_init

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoloader: fixup driver names if needed
Christian Gmeiner [Wed, 9 Nov 2016 14:50:07 +0000 (15:50 +0100)]
loader: fixup driver names if needed

This makes it possible to 'use' the imx-drm driver. Remeber that it
is not possible to have sysmbol names in C/C++ with a '-' in it.

Changes since v1:
 - move the fix to loader.c

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agodri: make use of dri_get_extensions_name(..) helper
Christian Gmeiner [Thu, 3 Nov 2016 14:25:21 +0000 (15:25 +0100)]
dri: make use of dri_get_extensions_name(..) helper

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoloader: add loader_get_extensions_name(..) helper
Christian Gmeiner [Wed, 9 Nov 2016 14:50:05 +0000 (15:50 +0100)]
loader: add loader_get_extensions_name(..) helper

Changes since v1:
 - renamed function to loader_get_extensions_name
 - moved function into loader

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
V2: [Emil Velikov]
 - Use local define.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoegl: Use pkg-config for Android NDK build
Gurchetan Singh [Thu, 10 Nov 2016 20:14:47 +0000 (12:14 -0800)]
egl: Use pkg-config for Android NDK build

It's possible to build Mesa for Android using the traditional
autotools workflow [1]. ChromiumOS fetches Android prebuilts and
puts them in a sysroot. We now want to use pkg-config to specify
the location of system headers and libraries [2].

To enable this, let's add the required pkg-config checks and link
against them.

[1] https://developer.android.com/ndk/guides/standalone_toolchain.html
[2] https://chromium-review.googlesource.com/#/c/403237/

v2: Bundle pkg-config checks together (Emil)
v3: Provide further context on standalone NDK Mesa build (Emil)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoconfigure.ac: Don't look for pthreads in Android platform
Gurchetan Singh [Thu, 27 Oct 2016 16:06:42 +0000 (09:06 -0700)]
configure.ac: Don't look for pthreads in Android platform

In Android, the pthreads libs are in bionic.  When building
Mesa for Android with the autotools workflow, we shouldn't
set -lpthread or -pthread.

[Emil Velikov]
Other platforms could use a similar fix, although that is left as
separate exercise.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agometa/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures
Eduardo Lima Mitev [Mon, 14 Nov 2016 23:25:14 +0000 (15:25 -0800)]
meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed textures

This option was being ignored when packing compressed 3D and cube textures.

Fixes CTS test (on gen8+):
* GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore

v2: Drop API checks.
v3 (Ken): Just apply the existing code in more cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>