Bläddra i källkod

anv: Implement VK_EXT_texel_buffer_alignment

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
tags/19.2-branchpoint
Jason Ekstrand 6 år sedan
förälder
incheckning
0bc657f2db
2 ändrade filer med 38 tillägg och 0 borttagningar
  1. 37
    0
      src/intel/vulkan/anv_device.c
  2. 1
    0
      src/intel/vulkan/anv_extensions.py

+ 37
- 0
src/intel/vulkan/anv_device.c Visa fil

@@ -1142,6 +1142,13 @@ void anv_GetPhysicalDeviceFeatures2(
break;
}

case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT: {
VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *features =
(VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *)ext;
features->texelBufferAlignment = true;
break;
}

case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES: {
VkPhysicalDeviceVariablePointersFeatures *features = (void *)ext;
features->variablePointersStorageBuffer = true;
@@ -1567,6 +1574,36 @@ void anv_GetPhysicalDeviceProperties2(
break;
}

case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: {
VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *props =
(VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *)ext;

/* From the SKL PRM Vol. 2d, docs for RENDER_SURFACE_STATE::Surface
* Base Address:
*
* "For SURFTYPE_BUFFER non-rendertarget surfaces, this field
* specifies the base address of the first element of the surface,
* computed in software by adding the surface base address to the
* byte offset of the element in the buffer. The base address must
* be aligned to element size."
*
* The typed dataport messages require that things be texel aligned.
* Otherwise, we may just load/store the wrong data or, in the worst
* case, there may be hangs.
*/
props->storageTexelBufferOffsetAlignmentBytes = 16;
props->storageTexelBufferOffsetSingleTexelAlignment = true;

/* The sampler, however, is much more forgiving and it can handle
* arbitrary byte alignment for linear and buffer surfaces. It's
* hard to find a good PRM citation for this but years of empirical
* experience demonstrate that this is true.
*/
props->uniformTexelBufferOffsetAlignmentBytes = 1;
props->uniformTexelBufferOffsetSingleTexelAlignment = false;
break;
}

case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT: {
VkPhysicalDeviceTransformFeedbackPropertiesEXT *props =
(VkPhysicalDeviceTransformFeedbackPropertiesEXT *)ext;

+ 1
- 0
src/intel/vulkan/anv_extensions.py Visa fil

@@ -145,6 +145,7 @@ EXTENSIONS = [
Extension('VK_EXT_separate_stencil_usage', 1, True),
Extension('VK_EXT_shader_stencil_export', 1, 'device->info.gen >= 9'),
Extension('VK_EXT_shader_viewport_index_layer', 1, True),
Extension('VK_EXT_texel_buffer_alignment', 1, True),
Extension('VK_EXT_transform_feedback', 1, True),
Extension('VK_EXT_vertex_attribute_divisor', 3, True),
Extension('VK_EXT_ycbcr_image_arrays', 1, True),

Laddar…
Avbryt
Spara