Commit Graph

76880 Commits

Author SHA1 Message Date
Jason Ekstrand
ceb05131da anv_get_isl_format: Support depth+stencil aspect value
You just get the depth format in this case.
2016-01-04 16:08:05 -08:00
Jason Ekstrand
a7cc12910d anv/image: Do more work in anv_image_view_init
There was a bunch of common code in gen7/8_image_view_init that we really
should be sharing.
2016-01-04 16:08:05 -08:00
Jason Ekstrand
87dd59e578 anv/formats: Rework GetPhysicalDeviceFormatProperties
It now calls get_isl_format to get both linear and tiled views of the
format and determines linear/tiled properties from that.  Buffer properties
are determined from the linear format.
2016-01-04 16:08:05 -08:00
Jason Ekstrand
2712c0cca3 anv/formats: Add a tiling parameter to get_isl_format
Currently, this parameter does nothing.
2016-01-04 16:08:05 -08:00
Jason Ekstrand
603a3a9439 isl/format: Add some helpers for working with RGB formats 2016-01-04 16:08:05 -08:00
Jason Ekstrand
0639f44d0f isl: Add a file for format helpers 2016-01-04 16:08:05 -08:00
Jason Ekstrand
5f5fc23e7c genX/state: Pull some generic helpers into a shared header 2016-01-04 16:08:05 -08:00
Jason Ekstrand
ad9ff4f2b2 meta/blit: Rework how format and aspect choices are made
This commit does two things.  First, it introduces choose_* functions for
chosing formats and aspects.  Second, it changes the copy (not blit) code
to use appropreately sized UINT formats for everything except depth.  There
are two main reasons for this:  First, it means that compressed and other
non-renderable texture upload should "just work" because it won't be
tripping over non-renderable formats.  Second, it allows us to easly copy
an RGB buffer to and from an RGBX image because the formats will get
switched over to their UINT variants and the shader will deal with the
extra channel for us.
2016-01-04 16:08:05 -08:00
Jason Ekstrand
3200a81a55 anv/image: Add a vk_format field
We've been trying to move away from anv_format for a while and this should
help with the transition.  There are cases (mostly in meta) where we need
the original format for the image and not the isl_format.  These will be
moved over to the new vk_format and everythign else will use the isl_format
from the particular anv_surface.
2016-01-04 16:08:05 -08:00
Chad Versace
0d7614dce6 isl: Document mnemonic in Yf and Ys tiling
The 'f' means "four K". The 's' means "sixty-four K".
2016-01-04 15:37:39 -08:00
Kristian Høgsberg Kristensen
0f34a4ec4e isl: Use isl_align_npot for row_pitch
Many formats are not power-of-two bytes per pixels and we need the
non-power-of-two align macro here.

This reverts the revert from 4f9a211b, but keeps the change from a827b553
that fixed the yuv if-else mix-up.
2016-01-04 10:53:47 -08:00
Kristian Høgsberg Kristensen
abc1c9878f vk: Don't leak pipeline if initialization fails 2016-01-04 10:42:50 -08:00
Kristian Høgsberg Kristensen
fca1c08e34 vk: Allocate subpass attachment in one big block
This avoids making a lot of small allocations and handles allocation
failure correctly.

Fixes dEQP-VK.api.object_management.alloc_callback_fail.* failures.
2016-01-04 10:07:10 -08:00
Kristian Høgsberg Kristensen
5526c1782a vk: Handle allocation failures in meta init paths
Fixes dEQP-VK.api.object_management.alloc_callback_fail.* failures.
2016-01-04 10:07:08 -08:00
Kristian Høgsberg Kristensen
b2ad2a20b6 vk: Handle allocation failure in anv_pipeline_init()
Fixes dEQP-VK.api.object_management.alloc_callback_fail.* failures.
2016-01-04 10:06:50 -08:00
Kristian Høgsberg Kristensen
3954594eb4 vk: Call vk_error when we generate a VK_ERROR 2016-01-04 10:02:50 -08:00
Kristian Høgsberg Kristensen
75e01c8b2d vk: Only finish wayland wsi if we created it
Failure during instance creation will leave instance->wayland_wsi
undefined. When we then try to clean that up we crash. Set
instance->wayland_wsi to NULL on failure and only clean it up if it's
non-NULL.

Fixes part of dEQP-VK.api.object_management.alloc_callback_fail.*
2016-01-04 10:02:50 -08:00
Chad Versace
05c22f2d74 isl: Fix row pitch for linear buffers
isl always aligned the row pitch to the surface's image alignment.  This
was sometimes wrong when the surface backed a VkBuffer. For a VkBuffer,
the surface's row pitch is set by VkBufferImageCopy::bufferRowLength,
whose required alignment is only that of the VkFormat.

In particular, VkBuffer rows are packed in many dEQP and Crucible tests.
And packed rows are rarely aligned to the surface's image alignment.

Fixes: dEQP-VK.pipeline.image.view_type.2d.format.r8g8b8a8_unorm.size.13x13
2016-01-04 09:57:25 -08:00
Chad Versace
a827b553d9 isl: Fix swapped if-else in isl_calc_row_pitch
The YUV case was applied to non-YUV formats. Oops.
2016-01-04 09:57:23 -08:00
Jason Ekstrand
f6c4658cde nir/spirv: Fix group decorations
They were completely bogus before.  For one thing, OpDecorationGroup
created a value of type undef rather than decoration_group.  Also
OpGroupMemberDecorate didn't properly apply the decoration to the different
members of the different groups.  It *should* be correct now but there's no
good way to test it yet.
2016-01-02 11:53:36 -08:00
Jason Ekstrand
6b0b57225c anv/device: Only allocate whole pages in AllocateMemory
The kernel is going to give us whole pages anyway, so allocating part of a
page doesn't help.  And this ensures that we can always work with whole
pages.
2016-01-02 07:52:24 -08:00
Jason Ekstrand
f076d5330d anv/device: Handle non-4k-aligned calls to MapMemory
As per the spec:

   minMemoryMapAlignment is the minimum required alignment, in bytes, of
   host-visible memory allocations within the host address space. When
   mapping a memory allocation with vkMapMemory, subtracting offset bytes
   from the returned pointer will always produce a multiple of the value of
   this limit.
2016-01-01 09:29:29 -08:00
Jason Ekstrand
6b5cbdb317 anv/format: Get rid of num_channels 2015-12-31 12:07:43 -08:00
Jason Ekstrand
3fe1f118f8 anv/cmd_buffer: Fix a pointer-cast typo 2015-12-31 12:07:43 -08:00
Chad Versace
86ecb28ec6 isl: Document some isl_surf::phys_level0_sa invariants
isl_dim_layout restricts the range of isl_surf::phys_level0_sa.
2015-12-31 12:06:02 -08:00
Jason Ekstrand
5318424d49 anv/pipeline: Better vertex input channel setup
First off, it now uses isl formats instead of anv_format.  Also, it
properly handles integer vs. floating-point default channels and can
properly handle alpha-only channels.  (Not sure if those are allowed).
2015-12-31 12:02:08 -08:00
Jason Ekstrand
c6364495b2 anv/pipeline: Move vk_to_gen tables into a shared header 2015-12-31 12:02:08 -08:00
Chad Versace
d25cff687b isl: Better document surface units
Logical pixels, physical surface samples, and physical surface elements.

Requested-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-12-31 11:56:13 -08:00
Chad Versace
373fd89e4b isl: Document the 3D block extent of isl_format 2015-12-31 11:55:48 -08:00
Jason Ekstrand
1ddcbbf05f nir/spirv: Add a missing break statement in handle_image 2015-12-30 21:57:04 -08:00
Jason Ekstrand
4f9a211b4a Revert "isl: Fix assertion failure for npot pixel formats"
This reverts commit 96d1baa88d.
2015-12-30 21:01:55 -08:00
Jason Ekstrand
0bb103d010 nir/spirv: Handle push constants after decorations 2015-12-30 20:54:27 -08:00
Jason Ekstrand
3421ba1843 anv/device: Place memory types at heapIndex == 0
Previously, they were at heapIndex == 1 even though we only advertised one
heap.
2015-12-30 19:32:43 -08:00
Jason Ekstrand
cf6ce424e0 nir/spirv: Fix constant num_elements and allocation
Thanks to the addition of nir_clone, we now have a num_elements field in
nir_constant which we weren't setting.  Also, constants have to be parented
to the variable they initialize, so we have to make a copy.
2015-12-30 18:51:59 -08:00
Jason Ekstrand
601b7d5f98 nir/lower_outputs_to_temporaries: Reparent constant initializers 2015-12-30 18:51:06 -08:00
Jason Ekstrand
7d57528233 nir/clone: Expose nir_constant_clone 2015-12-30 18:44:19 -08:00
Jason Ekstrand
fed98df428 nir/gather_info: Add support for end_primitive_with_counter 2015-12-30 17:45:43 -08:00
Jason Ekstrand
5afac62b28 nir/spirv: Handle OpLine 2015-12-30 17:45:43 -08:00
Jason Ekstrand
149f35bbba nir/spirv: Let OpEntryPoint act as an OpName 2015-12-30 17:45:43 -08:00
Jason Ekstrand
5f7f88524c nir/lower_outputs_to_temporaries: Take a nir_function entrypoint 2015-12-30 17:45:43 -08:00
Jason Ekstrand
0fe4580e64 nir/spirv: Add support for multiple entrypoints per shader
This is done by passing the entrypoint name into spirv_to_nir.  It will
then process the shader as if that were the only entrypoint we care about.
Instead of returning a nir_shader, it now returns a nir_function.
2015-12-30 17:45:43 -08:00
Jason Ekstrand
e993e45eb1 nir/spirv: Get the shader stage from the SPIR-V
Previously, we depended on it being passed in.
2015-12-30 17:45:43 -08:00
Jason Ekstrand
db3a64fcea nir/spirv: Use shader stage for determining variable locations 2015-12-30 17:45:43 -08:00
Jason Ekstrand
d7ae2200f9 nir/spirv: Get rid of default GS info
shaderc has been fixed for a while now.
2015-12-30 17:45:43 -08:00
Jason Ekstrand
d9c9a117dc nir/spirv: Handle execution modes as decorations
They're basically the same thing.
2015-12-30 17:45:43 -08:00
Jason Ekstrand
2b6bcaf91a nir/spirv: Separate handling of preamble from type/var/const instructions 2015-12-30 17:45:43 -08:00
Chad Versace
96d1baa88d isl: Fix assertion failure for npot pixel formats
When aligning to isl_format_layout::bs (which is the number of bytes in
the pixel), use isl_align_npot() instead of isl_align(), because
isl_align() works only for power-of-2 alignment.

Fixes assertion in
dEQP-VK.pipeline.image.view_type.1d.format.r16g16b16_sfloat.size.512x1.
2015-12-30 16:28:19 -08:00
Jason Ekstrand
07b4f17aaf nir/spirv/GLSL450: Add support for SAbs 2015-12-30 14:41:49 -08:00
Kenneth Graunke
e6cd0c0e1c nir/spirv: Implement IsInf and IsNan built-ins. 2015-12-30 14:10:44 -08:00
Jason Ekstrand
a7e827192b isl: Tile-align height in image size calculation
This fixes a bunch of gpu hangs on the dEQP-VK.glsl.ShaderExecutor.common
group of CTS tests.
2015-12-30 14:03:47 -08:00