summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
Commit message (Collapse)AuthorAgeFilesLines
* anv: Handle null in all destructorsJason Ekstrand2016-11-241-1/+11
| | | | | | | | | | | | | | | | This fixes a bunch of new CTS tests which look for exactly this. Even in the cases where we just call vk_free to free a CPU data structure, we still handle NULL explicitly. This way we're less likely to forget to handle NULL later should we actually do something less trivial. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 49f08ad77f51cc344e4bfe60ba9f8d9fccfbd753) [Emil Velikov: color_rt_surface_state is still around] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/intel/vulkan/anv_image.c
* anv: move to using vk_alloc helpers.Dave Airlie2016-10-191-7/+7
| | | | | | | This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* anv: drop local MIN/MAX macros.Dave Airlie2016-10-191-1/+1
| | | | | | | Use the ones from mesa, most places already did. Acked-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* anv/image: Create views directly in VkCreate*ViewJason Ekstrand2016-10-141-56/+34
| | | | | | | Without meta, we no longer need the _init helpers and the ability to back an image view with surface states allocated out of the command buffer. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/image: Get rid of the usage hacks for metaJason Ekstrand2016-10-141-95/+27
| | | | | | | | Now that meta is gone and we're using blorp, we don't need all of the usage hacks. Instead, the usage provided by the app is exactly the usage that we want because the app is the only thing creating image views. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/image: Add an isl_view to anv_image_viewJason Ekstrand2016-10-141-19/+18
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* anv/image: Rework our handling of 3-D image array rangesJason Ekstrand2016-10-141-4/+12
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* anv/image: Memset hiz surfaces to 0 when binding memoryJason Ekstrand2016-10-071-1/+30
| | | | | | | | | Nanley Chery (amend): - Change memset value from 0xff to 0 (a defined value for HiZ). Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Move BindImageMemory to anv_image.cJason Ekstrand2016-10-071-0/+20
| | | | | | Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Allocate hiz surfaceChad Versace2016-10-071-3/+34
| | | | | | | | | | | | | | | | Nanley Chery: (rebase) - Use isl_surf_get_hiz_surf() (amend) - Only add a HiZ surface onto a depth/stencil attachment - Add comment above HiZ surface addition - Hide HiZ behind INTEL_VK_HIZ prior to BDW - Disable HiZ for untested cases - Remove DISABLE_AUX_BIT instead of preventing it from being added Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org>
* anv/image: Set correct base_array_layer and array_len for storage imagesJason Ekstrand2016-09-131-0/+4
| | | | | | | Since Vulkan doesn't allow single-slice 3D storage images, we need to just set the base_array_layer and array_len to the full size of the 3-D LOD. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Make image_get_surface_for_aspect_mask constJason Ekstrand2016-09-131-3/+4
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
* intel/isl: Add an isl_swizzle structure and use it for isl_view swizzlesJason Ekstrand2016-09-121-10/+10
| | | | | | | | | This should be more compact than the enum isl_channel_select[4] that we were using before. It's also very convenient because we already had such a structure in the Vulkan driver we just needed to pull it over. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* anv/image: Don't create invalid render target surfacesJason Ekstrand2016-08-231-1/+12
| | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: remove internal 'validate' layerEmil Velikov2016-08-181-75/+0
| | | | | | | | | | | Presently the layer has only a single entry point. As mentioned by Jason the function does not validate anything that isn't checked elsewhere, thus we can drop the whole thing. Cc: "12.0" <mesa-stable@lists.freedesktop.org> Cc: Jason Ekstrand <jason@jlekstrand.net> Suggested-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* anv/image: Assert that the image format is actually supportedJason Ekstrand2016-07-221-2/+5
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-dev@lists.freedesktop.org>
* anv: Handle VK_WHOLE_SIZE properly for buffer viewsJason Ekstrand2016-07-151-3/+4
| | | | | | | | | | | | The old calculation, which used view->offset, encorporated buffer->offset into the size calculation where it doesn't belong. This meant that, if buffer->offset > buffer->size, you would always get a negative size. This fixes 170 dEQP-VK.renderpass.attachment.* Vulkan CTS tests on Haswell. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/image: Fix initialization of the ISL tilingNanley Chery2016-07-151-4/+11
| | | | | | | | | | | | | | | If an internal user creates an image with Vulkan tiling VK_IMAGE_TILING_OPTIMAL and an ISL tiling that isn't set, ISL will fail to create the image as anv_image_create_info::isl_tiling_flags will be an invalid value. Correct this by making anv_image_create_info::isl_tiling_flags an opt-in, filtering bitmask, that allows the caller to specify which ISL tilings are acceptable, but not contradictory to the Vulkan tiling. Opt-out of filtering for vkCreateImage. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* isl: Kill off isl_format_layout::bsJason Ekstrand2016-07-131-2/+2
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv,isl: Lower storage image formats in anvJason Ekstrand2016-06-221-0/+3
| | | | | | | | | | ISL was being a bit too clever for its own good and lowering the format for us. This is all well and good *if* we always want to lower it. However, the GL driver selectively lowers the format depending on whether the surface is write-only or not. Reviewed-by: Chad Versace <chad.versace@intel.com> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Add a devinfo argument to the get_format functionsJason Ekstrand2016-05-171-4/+5
|
* anv/formats: Use the isl_channel_select enum for the swizzleJason Ekstrand2016-05-171-12/+6
|
* anv/formats: Add an anv_get_format helperJason Ekstrand2016-05-171-13/+11
| | | | | | | | | This commit removes anv_format_for_vk_format and adds an anv_get_format helper. The anv_get_format helper returns the anv_format by-value. Unlike anv_format_for_vk_format the format returned by anv_get_format is 100% accurate and includes any tweaks needed for tiled vs. linear. anv_get_isl_format is now just a wrapper around anv_get_format that picks off just the isl_format.
* anv/image: Use aspects for computing full usageJason Ekstrand2016-05-171-4/+3
|
* anv: Remove the anv_format member from anv_imageJason Ekstrand2016-05-171-1/+0
|
* anv/image: Stop using anv_format for image create validationJason Ekstrand2016-05-171-6/+2
|
* anv/image: Make heavier use of aspectsJason Ekstrand2016-05-171-50/+34
|
* anv/image: Use get_isl_format when creating buffer viewsJason Ekstrand2016-05-171-5/+6
|
* anv/image: Add an aspects fieldJason Ekstrand2016-05-171-0/+3
| | | | | This makes several checks easier and allows us to avoid calling anv_format_for_vk_format in a number of cases.
* anv: fix warnings in release buildGrazvydas Ignotas2016-04-251-1/+1
| | | | | | | | | Mark variables MAYBE_UNUSED to avoid unused-but-set-variable warnings in release build. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* anv/image: Use the has_matching_typed_storage_image_format helper from islJason Ekstrand2016-04-211-12/+3
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* isl: Take a devinfo in lower_storage_image_format instead of an isl_deviceJason Ekstrand2016-04-211-1/+1
| | | | | | | We want to call this function from the shader compiler and having a full isl_device available at that point isn't practical. Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv/image: Remove the offset parameter from image_view_initJason Ekstrand2016-04-081-3/+2
| | | | | | | The only place we were using this was in meta_blit2d which always creates a new image anyway so we can just use the image offset. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/image: Expose the guts of CreateBufferView for metaJason Ekstrand2016-04-081-16/+24
| | | | Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/image: Enable specifying a surface's minimum pitchNanley Chery2016-03-251-1/+1
| | | | | | | | | | | | | This is required to create multiple, horizontally adjacent, max-width images from one blit2d surface. This is also required for more accurate width specification of surfaces within a larger surface (which is seen as the smaller surface's enclosing region). Note that anv_image_create_info::stride has been unused since commit, b36938964063a4072abfd779f5607743dbc3b6f1 . Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Sanitize Image extents and offsetsNanley Chery2016-03-241-19/+5
| | | | | | | | | | | | | | | Prepare Image extents and offsets for internal consumption by assigning the default values implicitly defned by the spec. Fixes textures on several Vulkan demos in which the VkImageCopy depth is set to zero when copying a 2D image. v2 (Jason Ekstrand): Replace "prep" with "sanitize" Make function static inline Pass structs instead of pointers Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
* anv: Implement VK_REMAINING_{MIP_LEVELS,ARRAY_LAYERS}Nanley Chery2016-03-041-6/+6
| | | | | | | v2: Subtract the baseMipLevel and baseArrayLayer (Jason) Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* isl: Get rid of isl_surf_fill_state_info::level0_extent_pxNanley Chery2016-03-041-30/+3
| | | | | | | This field is no longer needed. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* anv/image: Create a linear image when requestedNanley Chery2016-03-031-1/+1
| | | | | | | | If a linear image is requested, the only possible result should be a linearly-tiled surface. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
* anv/image: Use isl for filling brw_image_paramJason Ekstrand2016-02-271-111/+6
|
* anv: Fill out image_param structs at view creation timeJason Ekstrand2016-02-271-0/+5
|
* anv/image: Add a ussage_mask field to image_view_initJason Ekstrand2016-02-271-5/+6
| | | | | | | | This allows us to avoid doing some unneeded work on the meta paths where we know that the image view will be used for exactly one thing. The meta paths also sometimes do things that aren't quite valid like setting the array slice on a 3-D texture and we want to limit the number of paths that need to be able to sensibly handle the lies.
* anv: Remove unneeded fiels from anv_image_viewJason Ekstrand2016-02-271-5/+6
|
* anv: Use ISL to fill out surface statesJason Ekstrand2016-02-271-71/+79
|
* Move the intel vulkan driver to src/intel/vulkanJason Ekstrand2016-02-181-0/+911