summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_formats.c
Commit message (Collapse)AuthorAgeFilesLines
* anv/format: handle unsupported formats properlyIago Toral Quiroga2016-11-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the spec for vkGetPhysicalDeviceImageFormatProperties: "If format is not a supported image format, or if the combination of format, type, tiling, usage, and flags is not supported for images, then vkGetPhysicalDeviceImageFormatProperties returns VK_ERROR_FORMAT_NOT_SUPPORTED." Makes the following Vulkan CTS tests report 'Not Supported' instead of crashing: dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_unorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_snorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_uscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_sscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_uint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_sint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_unorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_snorm dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_uscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_sscaled dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_uint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_sint dEQP-VK.api.image_clearing.clear_color_image.1d_b8g8r8a8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_r4g4_unorm_pack8 dEQP-VK.api.image_clearing.clear_color_image.1d_r8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_r8g8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_r8g8b8_srgb dEQP-VK.api.image_clearing.clear_color_image.1d_b5g5r5a1_unorm_pack16 Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (cherry picked from commit 35deeda66f5fcbccb24f8eda42c8a4f67bb106c9) Squashed with: anv/format: handle unsupported formats earlier Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 277f868e6682b9ee398ed326425274c3d1898417)
* anv/formats: Fix build on gcc-4 and earlierVille Syrjälä2016-10-031-4/+19
| | | | | | | | | | | | | | | | | | | | gcc-4 and earlier don't allow compound literals where a constant is required in -std=c99/gnu99 mode, so we can't use ISL_SWIZZLE() when populating the anv_formats[] array. There are a few ways around it: First one would be -std=c89/gnu89, but the rest of the code depends on c99 so it's not really an option. The second option would be to upgrade to gcc-5+ where the compiler behaviour was relaxed a bit [1]. And the third option is just to avoid using compound literals. I chose the last option since it keeps gcc-4 and earlier working. [1] https://gcc.gnu.org/gcc-5/porting_to.html Cc: Jason Ekstrand <jason@jlekstrand.net> Cc: Topi Pohjolainen <topi.pohjolainen@intel.com> Fixes: 7ddb21708c80 ("intel/isl: Add an isl_swizzle structure and use it for isl_view swizzles") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* intel/i965: make gen_device_info mutableLionel Landwerlin2016-09-231-8/+8
| | | | | | | | | | | | Make gen_device_info a mutable structure so we can update the fields that can be refined by querying the kernel (like subslices and EU numbers). This patch does not make any functional change, it just makes gen_get_device_info() fill a structure rather than returning a const pointer. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* intel/isl: Add an isl_swizzle structure and use it for isl_view swizzlesJason Ekstrand2016-09-121-8/+1
| | | | | | | | | 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>
* intel: s/brw_device_info/gen_device_info/Jason Ekstrand2016-09-031-3/+3
| | | | | | | | | | | | | Generated by: sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.c sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.h sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.c sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.cpp sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.h Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv/formats: Don't use an RGBX format if it isn't renderableJason Ekstrand2016-08-231-1/+2
| | | | | | | | | | The whole point of using RGBX is so that we can render to it so if it isn't renderable, that kind-of defeats the purpose. Some formats (one example is R32G32B32X32_SFLOAT) exist in the format table but aren't actually renderable. Eventually, we'd like to get away from RGBX entirely, but this fixes hangs on BDW today. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: GetDeviceImageFormatProperties: fix TRANSFER formatsLionel Landwerlin2016-08-221-16/+6
| | | | | | | | | | | | | We let the user believe we support some transfer formats which we don't. This can lead to crashes when actually trying to use those formats for example on dEQP-VK.api.copy_and_blit.image_to_image.* tests. Let all formats we can render to or sample from as meta implements transfers using attachments. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* isl: Use bpb in a few places where it's more natural than bsJason Ekstrand2016-07-131-2/+2
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv/formats: Exit early for unsupported formatsJason Ekstrand2016-05-271-2/+3
|
* anv/formats: Map VK_FORMAT_UNDEFINED to ISL_FORMAT_UNSUPPORTEDJason Ekstrand2016-05-271-1/+1
| | | | | | At one point in time, we may have used the mapping to ISL_FORMAT_RAW for certain buffer surfaces but that time has long since passed. This fixes a bug where doing format queries on VK_FORMAT_UNDEFINED would assert-fail.
* anv/formats: Use isl_format_supports* for format introspectionJason Ekstrand2016-05-231-22/+19
|
* anv/formats: Make alpha blending a property of render targetsNanley Chery2016-05-231-4/+2
| | | | | | | | In agreement with the SNB PRM, alpha blending is a property that render targets may or may not support. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Enable textureCompressionASTC_LDR on Gen9+Nanley Chery2016-05-201-28/+28
| | | | | Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/format: Reorder ASTC mappings to match ISL enum orderingNanley Chery2016-05-201-14/+14
| | | | | | | Keep the lists consistent for ease of use. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/formats: Add support for VK_FORMAT_B4G4R4A4_UNORM pre-gen8Jason Ekstrand2016-05-171-0/+10
|
* anv: Add a devinfo argument to the get_format functionsJason Ekstrand2016-05-171-4/+6
|
* anv/formats: Set the swizzle to RGB1 when using an RGBA format to fake RGBJason Ekstrand2016-05-171-2/+5
| | | | | | | | | This way we get correct sampling from RGB formats that are faked as RGBA. This should also cause it to disable rendering and blending on those formats. We should be able to render to them and, on Broadwell and above, we can blend on them with work-arounds. However, we'll add support for that more properly later when it's deemed useful. For now, disabling rendering and blending should be safe.
* anv/formats: Refactor anv_get_formatJason Ekstrand2016-05-171-30/+27
| | | | | | The new code removes the switch statement and instead handles depth/stencil as up-front special cases. This allows for potentially more complicated color format handling in the future.
* anv/formats: Use the isl_channel_select enum for the swizzleJason Ekstrand2016-05-171-4/+14
|
* anv/formats: Add an anv_get_format helperJason Ekstrand2016-05-171-44/+36
| | | | | | | | | 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/format: Simplify anv_formatJason Ekstrand2016-05-171-37/+38
| | | | | | Now that we have VkFormat introspection and we've removed everything that tried to use anv_format for introspection, we no longer need most of what was in anv_format.
* anv/formats: Delete validate_GetPhysicalDeviceFormatPropertiesJason Ekstrand2016-05-171-10/+0
| | | | | All it ever did was some extra logging that was useful when initially bringing up Dota2. We don't need it anymore.
* anv/formats: Return proper error code for unsupported formatsNanley Chery2016-04-271-1/+1
| | | | | | | | | Fixes some failures in dEQP-VK.api.info.image_format_properties.* and enables the test group to execute without assert failing. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94896 Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/formats: Advertise blit support for stencilJason Ekstrand2016-04-081-6/+4
| | | | | | Thanks to advances in the blit code, we can do this now. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv: Don't allow D16_UNORM to be combined with stencilJason Ekstrand2016-03-051-1/+1
| | | | | Among other things, this can cause the depth or stencil test to spurriously fail when the fragment shader uses discard.
* anv/formats: Don't use a compound literal to initialize a const arrayJason Ekstrand2016-02-181-2/+2
| | | | | Doing so makes older versions of GCC rather grumpy. Newere GCC fixes this, but using a compound literal isn't really gaining us anything anyway.
* Move the intel vulkan driver to src/intel/vulkanJason Ekstrand2016-02-181-0/+603