Skip to content

Commit

Permalink
Change log for May 5, 2024 Vulkan 1.3.284 spec update:
Browse files Browse the repository at this point in the history
Public Issues

  * Refactor "`proposals`" into a separate Antora component "`features`" and
    refer to published proposals more consistently as "`feature
    descriptions`" (public PR 2361).

Internal Issues

  * Partial synchronization with OpenXR scripts (internal MR 6419).
  * Refactor extensionmetadocgenerator.py to simplify adding new sections
    (internal MR 6624).
  * Restore structextends="VkPhysicalDeviceProperties2" back for
    VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT (internal MR 6631).

New Extensions

  * VK_EXT_legacy_vertex_attributes
  • Loading branch information
oddhack committed May 6, 2024
1 parent 8a8a32f commit ff188a8
Show file tree
Hide file tree
Showing 32 changed files with 609 additions and 233 deletions.
22 changes: 22 additions & 0 deletions ChangeLog.adoc
Expand Up @@ -14,6 +14,28 @@ appears frequently in the change log.

'''

Change log for May 5, 2024 Vulkan 1.3.284 spec update:

Public Issues

* Refactor "`proposals`" into a separate Antora component "`features`" and
refer to published proposals more consistently as "`feature
descriptions`" (public PR 2361).

Internal Issues

* Partial synchronization with OpenXR scripts (internal MR 6419).
* Refactor extensionmetadocgenerator.py to simplify adding new sections
(internal MR 6624).
* Restore structextends="VkPhysicalDeviceProperties2" back for
VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT (internal MR 6631).

New Extensions

* VK_EXT_legacy_vertex_attributes

'''

Change log for April 19, 2024 Vulkan 1.3.283 spec update:

Public Issues
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -138,7 +138,7 @@ VERBOSE =
# ADOCOPTS options for asciidoc->HTML5 output

NOTEOPTS = -a editing-notes -a implementation-guide
PATCHVERSION = 283
PATCHVERSION = 284
BASEOPTS =

ifneq (,$(findstring VKSC_VERSION_1_0,$(VERSIONS)))
Expand Down
47 changes: 47 additions & 0 deletions appendices/VK_EXT_legacy_vertex_attributes.adoc
@@ -0,0 +1,47 @@
// Copyright 2023-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}VK_EXT_legacy_vertex_attributes.adoc[]

=== Other Extension Metadata

*Last Modified Date*::
2024-02-23
*IP Status*::
No known IP claims.
*Contributors*::
- Mike Blumenkrantz, Valve
- Piers Daniell, NVIDIA
- Spencer Fricke, LunarG
- Alyssa Rosenzweig, Valve

=== Description

This extension adds support for legacy features of (non-64-bit) vertex
attributes as found in OpenGL:

- Vertex attributes loaded from arbitrary buffer alignments
- Vertex attributes using arbitrary strides
- Vertex attributes where the component data type of the binding does not
match the component numeric type of the shader input

These features are only usable with dynamic vertex input.
Unaligned loads of vertex attributes may incur performance penalties,
indicated with a property.

include::{generated}/interfaces/VK_EXT_legacy_vertex_attributes.adoc[]

=== Issues

1.) Should implementations convert float/integer values?

*RESOLVED*: No.
When fetching an integer data type from float values or float data types
from integer values, the resulting shader values are
implementation-dependent.

=== Version History

* Revision 1, 2024-02-16 (Mike Blumenkrantz)
** Initial revision
7 changes: 7 additions & 0 deletions chapters/commonvalidity/draw_vertex_binding.adoc
Expand Up @@ -102,6 +102,13 @@ ifdef::VK_EXT_vertex_input_dynamic_state[]
the bound graphics pipeline state was created with the
ename:VK_DYNAMIC_STATE_VERTEX_INPUT_EXT dynamic state enabled
endif::VK_EXT_vertex_input_dynamic_state[]
ifdef::VK_EXT_legacy_vertex_attributes[]
and either <<features-legacyVertexAttributes,
pname:legacyVertexAttributes>> is not enabled or the SPIR-V Type
associated with a given code:Input variable of the corresponding
code:Location in the code:Vertex {ExecutionModel} code:OpEntryPoint is
64-bit,
endif::VK_EXT_legacy_vertex_attributes[]
then the numeric type associated with all code:Input variables of the
corresponding code:Location in the code:Vertex {ExecutionModel}
code:OpEntryPoint must: be the same as
Expand Down
28 changes: 28 additions & 0 deletions chapters/features.adoc
Expand Up @@ -3804,6 +3804,30 @@ include::{generated}/validity/structs/VkPhysicalDeviceAttachmentFeedbackLoopDyna
--
endif::VK_EXT_attachment_feedback_loop_dynamic_state[]

ifdef::VK_EXT_legacy_vertex_attributes[]
[open,refpage='VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT',desc='Structure describing compatibility features for vertex attributes',type='structs']
--
The sname:VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT structure is
defined as:

include::{generated}/api/structs/VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT.adoc[]

This structure describes the following features:

* pname:sType is a elink:VkStructureType value identifying this structure.
* pname:pNext is `NULL` or a pointer to a structure extending this
structure.
* [[features-legacyVertexAttributes]] pname:legacyVertexAttributes
specifies whether compatibility features for vertex attributes are
supported when using dynamic vertex input state.

:refpage: VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT
include::{chapters}/features.adoc[tag=features]

include::{generated}/validity/structs/VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT.adoc[]
--
endif::VK_EXT_legacy_vertex_attributes[]

ifdef::VK_VERSION_1_3,VK_EXT_texture_compression_astc_hdr[]
[open,refpage='VkPhysicalDeviceTextureCompressionASTCHDRFeatures',desc='Structure describing ASTC HDR features that can be supported by an implementation',type='structs',alias='VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT']
--
Expand Down Expand Up @@ -8449,6 +8473,10 @@ ifdef::VK_EXT_attachment_feedback_loop_dynamic_state[]
`apiext:VK_EXT_attachment_feedback_loop_dynamic_state` extension is
supported.
endif::VK_EXT_attachment_feedback_loop_dynamic_state[]
ifdef::VK_EXT_legacy_vertex_attributes[]
* <<features-legacyVertexAttributes, pname:legacyVertexAttributes>>, if
the `apiext:VK_EXT_legacy_vertex_attributes` extension is supported.
endif::VK_EXT_legacy_vertex_attributes[]
ifdef::VK_KHR_ray_tracing_position_fetch[]
* <<features-rayTracingPositionFetch, pname:rayTracingPositionFetch>>, if
the `apiext:VK_KHR_ray_tracing_position_fetch` extension is supported.
Expand Down
19 changes: 15 additions & 4 deletions chapters/fxvertex.adoc
Expand Up @@ -978,11 +978,22 @@ The numeric type of pname:format must: match the numeric type of the input
variable in the shader.
The input variable in the shader must: be declared as a 64-bit data type if
and only if pname:format is a 64-bit data type.
If pname:format is a packed format, `attribAddress` must: be a multiple of
the size in bytes of the whole attribute data type as described in
If
ifdef::VK_EXT_legacy_vertex_attributes[]
either pname:format is a 64-bit format or <<features-legacyVertexAttributes,
pname:legacyVertexAttributes>> is not enabled, and
endif::VK_EXT_legacy_vertex_attributes[]
pname:format is a packed format, `attribAddress` must: be a multiple of the
size in bytes of the whole attribute data type as described in
<<formats-packed,Packed Formats>>.
Otherwise, `attribAddress` must: be a multiple of the size in bytes of the
component type indicated by pname:format (see <<formats,Formats>>).
Otherwise,
ifdef::VK_EXT_legacy_vertex_attributes[]
if either pname:format is a 64-bit format or
<<features-legacyVertexAttributes, pname:legacyVertexAttributes>> is not
enabled,
endif::VK_EXT_legacy_vertex_attributes[]
`attribAddress` must: be a multiple of the size in bytes of the component
type indicated by pname:format (see <<formats,Formats>>).
For attributes that are not 64-bit data types, each component is converted
to the format of the input variable based on its type and size (as defined
in the <<formats-definition,Format Definition>> section for each
Expand Down
27 changes: 27 additions & 0 deletions chapters/limits.adoc
Expand Up @@ -1166,6 +1166,30 @@ include::{generated}/validity/structs/VkPhysicalDeviceSampleLocationsPropertiesE
--
endif::VK_EXT_sample_locations[]

ifdef::VK_EXT_legacy_vertex_attributes[]
[open,refpage='VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT',desc='Structure describing properties for legacy vertex attributes',type='structs']
--
The sname:VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT structure is
defined as:

include::{generated}/api/structs/VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT.adoc[]

This structure describes the following features:

* pname:sType is a elink:VkStructureType value identifying this structure.
* pname:pNext is `NULL` or a pointer to a structure extending this
structure.
* [[limits-nativeUnalignedPerformance]] pname:nativeUnalignedPerformance
specifies whether unaligned vertex fetches do not incur significant
performance penalties as compared to aligned fetches.

:refpage: VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT
include::{chapters}/features.adoc[tag=features]

include::{generated}/validity/structs/VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT.adoc[]
--
endif::VK_EXT_legacy_vertex_attributes[]

ifdef::VK_EXT_external_memory_host[]
[open,refpage='VkPhysicalDeviceExternalMemoryHostPropertiesEXT',desc='Structure describing external memory host pointer limits that can be supported by an implementation',type='structs']
--
Expand Down Expand Up @@ -5163,6 +5187,9 @@ ifdef::VK_EXT_sample_locations[]
| pname:sampleLocationSubPixelBits | - | 4 | min
| pname:variableSampleLocations | - |false| implementation-dependent
endif::VK_EXT_sample_locations[]
ifdef::VK_EXT_legacy_vertex_attributes[]
| pname:nativeUnalignedPerformance | - |false| implementation-dependent
endif::VK_EXT_legacy_vertex_attributes[]
ifdef::VK_EXT_external_memory_host[]
| pname:minImportedHostPointerAlignment | - | 65536 | max
endif::VK_EXT_external_memory_host[]
Expand Down
73 changes: 73 additions & 0 deletions proposals/VK_EXT_legacy_vertex_attributes.adoc
@@ -0,0 +1,73 @@
// Copyright 2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

# VK_EXT_legacy_vertex_attributes
:toc: left
:refpage: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/
:sectnums:

This document proposes adding legacy features for vertex attributes as found in OpenGL.

## Problem Statement

OpenGL allows three features that Vulkan explicitly prohibits:

- Vertex attributes loaded from arbitrary buffer alignments
- Vertex attributes using arbitrary strides
- Vertex attributes where the component data type of the binding does not match the component numeric type of the shader input

This proposal aims to provide this legacy functionality for non-64-bit attributes.


## Solution Space

These legacy features can be emulated by rewriting vertex buffers and generating shader variants. Neither option
is as optimal as having the underlying driver handle the functionality, where it may be a no-op.

## Proposal

### API Features

The following features are exposed by this extension:

[source,c]
----
typedef struct VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT {
VkStructureType sType;
void* pNext;
VkBool32 legacyVertexAttributes;
} VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT;
----

`legacyVertexAttributes` is the core feature enabling this extension's functionality.

The following properties are exposed by this extension:

[source,c]
----
typedef struct VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT {
VkStructureType sType;
void* pNext;
VkBool32 nativeUnalignedPerformance;
} VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT;
----

`nativeUnalignedPerformance` indicates that using unaligned vertex fetches on this implementation will not incur significant performance penalties.

## Examples

Enabling this feature allows the following example scenarios for a user with dynamic vertex input active:

- Binding a vertex buffer at offset=7
- Binding a VK_FORMAT_R32_UINT attribute with stride=1
- Binding a VK_FORMAT_R8_UINT attribute and reading it as signed `int` in a shader

## Issues


### RESOLVED: Should implementations convert float/integer values?

No. When fetching an integer data type from float values or float
data types from integer values, the resulting shader values are
implementation-dependent.
6 changes: 3 additions & 3 deletions scripts/cgenerator.py
Expand Up @@ -243,7 +243,7 @@ def endFeature(self):
if self.genOpts.conventions is None:
raise MissingGeneratorOptionsConventionsError()
is_core = self.featureName and self.featureName.startswith(self.conventions.api_prefix + 'VERSION_')
if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
if self.genOpts.conventions.writeFeature(self.featureName, self.featureExtraProtect, self.genOpts.filename):
self.newline()
if self.genOpts.protectFeature:
write('#ifndef', self.featureName, file=self.outFile)
Expand Down Expand Up @@ -507,7 +507,7 @@ def genCmd(self, cmdinfo, name, alias):
self.appendSection('commandPointer', decls[1])

def misracstyle(self):
return self.genOpts.misracstyle;
return self.genOpts.misracstyle

def misracppstyle(self):
return self.genOpts.misracppstyle;
return self.genOpts.misracppstyle
38 changes: 35 additions & 3 deletions scripts/check_spec_links.py
Expand Up @@ -19,6 +19,7 @@
from spec_tools.main import checkerMain
from spec_tools.shared import (AUTO_FIX_STRING, EXTENSION_CATEGORY, MessageId,
MessageType)
from apiconventions import APIConventions

###
# "Configuration" constants
Expand Down Expand Up @@ -50,6 +51,33 @@
'int32_t', 'uint32_t',
'int64_t', 'uint64_t'))

# Exceptions to:
# error: Definition of link target {} with macro etext (used for category enums) does not exist. (-Wwrong_macro)
# typically caused by using Vulkan-only enums in Vulkan SC blocks with "etext", or because they
# are suffixed differently.
CHECK_UNRECOGNIZED_ETEXT_EXCEPTIONS = (
"VK_COLORSPACE_SRGB_NONLINEAR_KHR",
"VK_COLOR_SPACE_DCI_P3_LINEAR_EXT",
"VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT",
"VK_STENCIL_FRONT_AND_BACK",
"VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES",
"VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES",
"VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT",
)

# Exceptions to:
# warning: Definition of link target {} with macro ename (used for category enums) does not exist. (-Wbad_enumerant)
# typically caused by Vulkan SC enums not being recognized in Vulkan build
CHECK_UNRECOGNIZED_ENAME_EXCEPTIONS = (
"VK_ERROR_INVALID_PIPELINE_CACHE_DATA",
"VK_ERROR_NO_PIPELINE_MATCH",
"VK_ERROR_VALIDATION_FAILED",
"VK_MEMORY_HEAP_SEU_SAFE_BIT",
"VK_PIPELINE_CACHE_CREATE_READ_ONLY_BIT",
"VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT",
"VK_PIPELINE_CACHE_HEADER_VERSION_SAFETY_CRITICAL_ONE",
)

ROOT = Path(__file__).resolve().parent.parent
DEFAULT_DISABLED_MESSAGES = set((
MessageId.LEGACY,
Expand Down Expand Up @@ -121,6 +149,12 @@ def perform_entity_check(self, type):

return type != 'builtins' and type != 'spirv'

def shouldSkipUnrecognizedEntity(self, macro, entity_name):
"""Return True if we should not warn about not recognizing a macro invocation for entity_name."""
if macro == "ename":
return entity_name in CHECK_UNRECOGNIZED_ENAME_EXCEPTIONS
return entity_name in CHECK_UNRECOGNIZED_ETEXT_EXCEPTIONS

def handleWrongMacro(self, msg, data):
"""Report an appropriate message when we found that the macro used is incorrect.
Expand Down Expand Up @@ -157,15 +191,13 @@ def handleWrongMacro(self, msg, data):
def allowEnumXrefs(self):
"""Returns True if enums can be specified in the 'xrefs' attribute
of a refpage.
Overrides base class behavior. OpenXR does not allow this.
"""
return True

def makeMacroChecker(enabled_messages):
"""Create a correctly-configured MacroChecker instance."""
entity_db = VulkanEntityDatabase()
return MacroChecker(enabled_messages, entity_db, VulkanMacroCheckerFile, ROOT)
return MacroChecker(enabled_messages, entity_db, VulkanMacroCheckerFile, ROOT, APIConventions)


if __name__ == '__main__':
Expand Down

0 comments on commit ff188a8

Please sign in to comment.