summaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* anv: fix descriptor pool internal size allocationLionel Landwerlin2017-01-261-4/+4
| | | | | | | | | | | | | | | The size of the pool is slightly smaller than the size of the structure containing the whole pool. We need to take that into account on when setting up the internals. Fixes a crash due to out of bound memory access in: dEQP-VK.api.descriptor_pool.out_of_pool_memory v2: Drop debug traces (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv/lower_input_attachments: honor sample index parameter to subpassLoad()Iago Toral Quiroga2017-01-261-4/+1
| | | | | | | | | | | | | | | | | According to GL_KHR_vulkan_glsl, the signature of subpassLoad() is: gvec4 subpassLoad(gsubpassInput subpass); gvec4 subpassLoad(gsubpassInputMS subpass, int sample); So the multisampled case always receives an explicit sample index that we should use. The current implementation was ignoring this parameter and using gl_SampleID value instead. Fixes: dEQP-VK.pipeline.multisample_shader_builtin.sample_id.* Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0" <[email protected]>
* anv: Implement VK_KHR_get_physical_device_properties2Chad Versace2017-01-253-0/+161
| | | | | Reviewed-by: Jason Ekstranad <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Refactor anv_GetPhysicalDeviceQueueFamilyProperties()Chad Versace2017-01-251-9/+17
| | | | | | | | | Add a helper function, anv_get_queue_family_properties(), which fills the struct. This patch reduces churn in the following patch that implements vkGetPhysicalDeviceQueueFamilyProperties2KHR. Reviewed-by: Jason Ekstranad <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Refactor anv_GetPhysicalDeviceFormatProperties()Chad Versace2017-01-251-28/+49
| | | | | | | | | | Add a helper function, anv_get_image_format_properties(), which does all the work and has a VkPhysicalDeviceImageFormatInfo2KHR parameter. This patch reduces churn in the following patch that implements vkGetPhysicalDeviceImageFormatProperties2KHR. Reviewed-by: Jason Ekstranad <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Revive struct anv_commonChad Versace2017-01-251-0/+5
| | | | | | | | | | | | | | | | | The struct was deleted by: commit efe9d1cde3340d3a9d17e5560b609a4fb839d43d Author: Edward O'Callaghan <[email protected]> Subject: anv: Clean up some unused variables Unlike the original anv_common, the new one has a non-const pNext pointer because we will use it for the output structs of VK_KHR_get_physical_device_properties2. v2: - Retype pNext from void* to struct anv_common*. Reviewed-by: Jason Ekstranad <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Define macro anv_debug()Chad Versace2017-01-251-0/+2
| | | | | | | | This is a printf-like macro that prints a debug message to stderr when built with DEBUG. If no DEBUG, then do nothing. Reviewed-by: Jason Ekstranad <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: set command buffer to NULL when allocations failLionel Landwerlin2017-01-251-1/+4
| | | | | | | | | | | | | | | | | | The spec section 5.2 says: "vkAllocateCommandBuffers can be used to create multiple command buffers. If the creation of any of those command buffers fails, the implementation must destroy all successfully created command buffer objects from this command, set all entries of the pCommandBuffers array to VK_NULL_HANDLE and return the error." Fixes: dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_primary dEQP-VK.api.object_management.alloc_callback_fail_multiple.command_buffer_secondary Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "13.0 17.0" <[email protected]>
* anv: Expose VK_KHR_maintenance1Jason Ekstrand2017-01-241-1/+5
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Return better errors from AllocateDescriptorSetsJason Ekstrand2017-01-241-2/+7
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Allow selecting the slice of a 3D imageJason Ekstrand2017-01-241-1/+1
| | | | | | | | As per VK_KHR_maintenance1, clients can render to a slice of a 3D image by creating a VK_IMAGE_VIEW_TYPE_2D view of it. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Report FORMAT_FEATURE_TRANSFER_SRC/DST_BIT_KHRJason Ekstrand2017-01-241-1/+13
| | | | | | | | | As of VK_KHR_maintenance1, these are supposed to be reported for any formats on which we support transfer operations. For us, this is anything that we can texture from. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Add trivial support for TrimCommandPoolKHRJason Ekstrand2017-01-241-0/+8
| | | | | | | | Our command buffers already efficiently use a global pool so trimming doesn't really need to do anything. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Set viewport extents correctly when height is negativeJason Ekstrand2017-01-241-2/+2
| | | | | | | | | | As per VK_KHR_maintenance1, setting a negative height in the viewport can be used to get flipped coordinates. This is, aparently, very useful when porting D3D apps to Vulkan. All we need to do to support this is to make sure we actually set the min and max correctly. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan: Don't install vk_platform.h or vulkan.h.Matt Turner2017-01-241-3/+5
| | | | | | These files belong to the vulkan loader. Reviewed-by: Emil Velikov <[email protected]>
* anv: descriptors: don't update immutables samplers with anything but their ↵Lionel Landwerlin2017-01-211-12/+19
| | | | | | | immutable value Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/blorp/copy: Properly handle clear colors for CCS_E imagesJason Ekstrand2017-01-211-0/+82
| | | | | | | | | | | | | | In order to handle CCS_E, we stomp the image format to a UINT format and then do some bitcasting logic in the shader. This works fine since SKL render compression only considers the channel layout of the format and not the format itself. In order for this to work on images that have been fast-cleared, we need to also convert the clear color so that, when interpreted as UINT, it provides the same bit value as it would have in the original format. This fixes a bunch of OpenGL ES CTS tests for copy_image when we start using CCS more aggressively. Reviewed-by: Topi Pohjolainen <[email protected]> Cc: "17.0" <[email protected]>
* anv: don't require render target isl bit for depth/stencil surfacesLionel Landwerlin2017-01-201-2/+5
| | | | | | | | | | | | | | | | Blorp can deal with depth/stencil surfaces blits/copies without the render target requirement. Also having both render target and depth/stencil requirement is incompatible from isl's point of view. This fixes an image creation issue in the high level quality settings of the Unity3D player, which requires a depth texture with src/dst transfer & 4x multisampling. v2: Simply aspect checking condition (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: 13.0 17.0 <[email protected]>
* anv: fix comment typoLionel Landwerlin2017-01-201-1/+1
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* blorp: remove unnecessary struct declarationLionel Landwerlin2017-01-201-1/+0
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: set UAV coherence required bit when neededIago Toral Quiroga2017-01-171-0/+51
| | | | | | | | | | | | | | | | The same we do in the OpenGL driver (comment copied from there). This is required to ensure that we execute the fragment shader stage when side-effects (such as image or ssbo stores) are present but there are no color writes. I found this while writing a test to check rendering to a framebuffer without attachments where the fragment shader does not produce any color outputs but writes to an image via imageStore(). Without this patch the fragment shader does not execute and the image is not written, which is not correct. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: increase ANV_MAX_STATE_SIZE_LOG2 limit to 1 MBSamuel Iglesias Gonsálvez2017-01-172-2/+2
| | | | | | | | | | | | | | | Fixes crash in dEQP-VK.ubo.random.all_shared_buffer.48 due to a fragment shader code bigger than 128 kB. This patch increases the allocation size limit to 1 MB. v2: - Increase it to 1 MB (Jason) - Increase device->instruction_block_pool allocation size in anv_device.c (Jason) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: generate entry points from vk.xmlLionel Landwerlin2017-01-142-65/+71
| | | | | | | | | | | v2: rework entry point iteration (Jason) cleanup unused imports v3: don't drop header installation (Emil) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: remove some unused macros and functionsGrazvydas Ignotas2017-01-132-34/+0
| | | | | | VK_ICD_WSI_PLATFORM_MAX is used, but a duplicate from wsi_common.h . Acked-by: Jason Ekstrand <[email protected]>
* anv: Default PointSize to 1.0 if not written by the shaderJason Ekstrand2017-01-131-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Vulkan rules for point size are a bit whacky. If you only have a vertex shader and you use points, then you must write PointSize in your vertex shader. If you have a geometry or tessellation shader, then it's dependent on the shaderTessellationAndGeometryPointSize device feature. From the Vulkan 1.0.38 specification: "shaderTessellationAndGeometryPointSize indicates whether the PointSize built-in decoration is available in the tessellation control, tessellation evaluation, and geometry shader stages. If this feature is not enabled, members decorated with the PointSize built-in decoration must not be read from or written to and all points written from a tessellation or geometry shader will have a size of 1.0. This also indicates whether shader modules can declare the TessellationPointSize capability for tessellation control and evaluation shaders, or if the shader modules can declare the GeometryPointSize capability for geometry shaders. An implementation supporting this feature must also support one or both of the tessellationShader or geometryShader features." In other words, if the feature is disbled (the client can disable features!) then they don't write PointSize and we provide a 1.0 default but if the feature is enabled, they do write PointSize and we use the one they wrote in the shader. There are at least two valid ways we can implement this: 1) Track whether or not shaderTessellationAndGeometryPointSize is enabled and set the 3DSTATE_SF bits based on that and what stages are enabled, ignoring the shader source. 2) Just look at the last geometry stage VUE map and see if they wrote PointSize and set the 3DSTATE_SF accordingly. The second solution is the easiest and the most robust against invalid usage of the Vulkan API, so we choose to go with that one. This fixes all of the dEQP-VK.tessellation.primitive_discard.*point_mode tests. The tests are also broken because they unconditionally enable shaderTessellationAndGeometryPointSize if it's supported by the implementation and then don't write PointSize in the evaluation shader. However, since this is the "robust against invalid API usage" solution, the tests happily pass. :-) Reviewed-by: Kenneth Graunke <[email protected]>
* anv/pipeline: Replace get_fs_input_map with get_last_vue_prog_dataJason Ekstrand2017-01-133-22/+10
| | | | | | This lets us delete a helper from genX_pipeline.c Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Move nir_lower_wpos_center after dead variable elimination.Kenneth Graunke2017-01-131-3/+3
| | | | | | | | | | | | | | | | When multiple shader stages exist in the same SPIR-V module, we compile all entry points and their inputs/outputs, then dead code eliminate the ones not related to the specific entry point later. nir_lower_wpos_center was being run prior to eliminating those random other variables, which made it trip up, thinking it found gl_FragCoord when it actually found something else like gl_PerVertex[3]. Fixes dEQP-VK.spirv_assembly.instruction.graphics.module.same_module. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Avoid some resolves for samplable HiZ buffersNanley Chery2017-01-121-18/+49
| | | | | | | v2: Simplify nested ifs (Jason Ekstrand) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Enable sampling from HiZNanley Chery2017-01-122-4/+17
| | | | | | | v2: Restrict ISL_AUX_USAGE_HIZ to depth aspects Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/blorp: Don't fast depth clear samplable HiZ buffers on BDWNanley Chery2017-01-121-0/+9
| | | | | | | | Avoid the resolves that would be required if fast depth clears were allowed for such buffers. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Add a helper to determine sampling with HiZNanley Chery2017-01-121-0/+7
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* isl/surface_state: Handle ISL_AUX_USAGE_HIZNanley Chery2017-01-121-0/+29
| | | | | | | v2: Remove redundant x/y offset asserts (Jason Ekstrand) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Perform HiZ resolves only on layout transitionsNanley Chery2017-01-122-56/+42
| | | | | | | | | | This is a better mapping to the Vulkan API and improves performance in all tested workloads. v2: Remove unnecessary image view aspect checks (Jason Ekstrand) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Disable HiZ for input attachmentsNanley Chery2017-01-122-16/+24
| | | | | | | | | v2 (Jason Ekstrand): - Add spec citation - Drop conditional Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Avoid resolves incurred by fast depth clearsNanley Chery2017-01-123-6/+23
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Prepare for transitioning to the requested final layoutNanley Chery2017-01-122-0/+6
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Store depth stencil layoutsNanley Chery2017-01-123-0/+17
| | | | | | | | | Store the current and requested depth stencil layouts so that we can perform the appropriate HiZ resolves for a given transition while recording a render pass. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Add helpers to handle depth buffer layout transitionsNanley Chery2017-01-121-0/+50
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Delete anv's HiZ op emit functionNanley Chery2017-01-123-233/+0
| | | | | | | This is no longer used. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Use the gen8 BLORP HiZ resolving functionNanley Chery2017-01-121-3/+24
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/blorp: Add a gen8 HiZ op resolve functionNanley Chery2017-01-122-0/+88
| | | | | | | | | Add an entry point for resolving using BLORP's gen8 HiZ op function. v2: Manually add the aux info Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Use gen8 BLORP HiZ clearing functionsNanley Chery2017-01-122-5/+50
| | | | | Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/blorp_clear: Add gen8 HiZ clearing functionsNanley Chery2017-01-122-0/+93
| | | | | | | | | | | | | Add an entry point for the optimized gen8 BLORP HiZ sequence. commit c9eaf12de20ac4143fe79d42018bdbb5a391356f fixed a bug that was unknowingly worked around by forcing additional clear rectangle alignment restrictions not specified in the PRMs. Now that the bug is no longer present, omit the additional alignment restrictions. v2: Adjust code comment about padding Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Enable HiZ support for multiple subpassesNanley Chery2017-01-123-13/+8
| | | | | | | | | We'll be using layout transitions later on in the series which can occur within and between subpasses. Turn this on now to simplify the change later. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Use ::anv_attachment_state for toggling HiZ per subpassNanley Chery2017-01-121-2/+4
| | | | | | | | | We're about to enable HiZ support for multiple subpasses. Use this field to keep track of whether or not subpass operations should treat the depth buffer as having an auxiliary HiZ buffer. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Replace anv_image_has_hiz() with ISL_AUX_USAGE_HIZNanley Chery2017-01-125-16/+18
| | | | | | | | | | | The helper doesn't provide additional functionality over the current infrastructure. v2: Add comment to anv_image::aux_usage (Jason Ekstrand) v3: Clarify comment for aux_usage (Jason Ekstrand) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/blorp: Handle ISL_AUX_USAGE_HIZNanley Chery2017-01-121-1/+2
| | | | | | | | | Prevent assert failures that would occur in the next patch. v2: Don't remove asserts from blorp/blit (Jason Ekstrand) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/blorp: Add the BDW+ optimized HZ_OP sequence to BLORPNanley Chery2017-01-121-0/+87
| | | | | | | | | | | We'll be switching to layout-transition based resolves which can occur outside of a render pass. Add this sequence to BLORP, as using BLORP will enable emitting depth stencil state outside of a render pass (among other benefits). The depth buffer extent is ignored to enable eventual usage in VkCmdClearAttachments(). Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Support loader interface version 3 (patch v2)Chad Versace2017-01-121-0/+44
| | | | | | | | | | | | | | | This patch implements vk_icdNegotiateLoaderICDInterfaceVersion(), which brings us to loader interface v3. v2: - Drop the pragmas. [emil] - Advertise v3 instead of v2. Anvil supported more than I thought. [jason] - s/Surface/SurfaceKHR/ in comments. [emil] Reviewed-by: Emil Velikov <[email protected]> Cc: [email protected] Cc: Jason Ekstrand <[email protected]>
* vulkan: Add new cast macros for VkIcd typesChad Versace2017-01-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't import the latest vk_icd.h because the new header breaks the Mesa build. This patch defines new casting macros, ICD_DEFINE_NONDISP_HANDLE_CASTS() and ICD_FROM_HANDLE(), which can handle both the old and new vk_icd.h, and will prevent the build from breaking when we update the header. In the old vk_icd.h, types were defined as: typedef struct _VkIcdFoo { ... } VkIcdFoo; Commit 6ebba1f6 in the Vulkan loader changed the above to typedef { ... } VkIcdFoo; because the old definitions violated the C and C++ specs. According to the specs, identifiers that begins with an underscore followed by an uppercase letter are reserved. (It's pedantic, I know), See the Github issue referenced below. References: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/7 References: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/commit/6ebba1f630015af7a78767a15c1e74ba9b23601c Reviewed-by: Emil Velikov <[email protected]> Cc: [email protected]