Skip to content

Commit

Permalink
feat(Vulkan): update to 1.2.172
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Mar 15, 2021
1 parent f56b5ce commit d9a4498
Show file tree
Hide file tree
Showing 229 changed files with 20,696 additions and 7,836 deletions.
2 changes: 2 additions & 0 deletions .idea/modules/lwjgl/lwjgl.vulkan.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<package name="org.lwjgl.util.simd"/>
</packages>
</test>
<test name="vulkan">
<packages>
<package name="org.lwjgl.vulkan"/>
</packages>
</test>
<test name="yoga">
<packages>
<package name="org.lwjgl.util.yoga"/>
Expand Down
7 changes: 4 additions & 3 deletions doc/notes/3.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This build includes the following changes:
* Updated `stb_vorbis` to 1.20 (up from 1.17)
- tinyfiledialogs: Updated to 3.7.2 (up from 3.3.9)
- vma: Updated to 2.3.0 (up from 2.2.0)
- Vulkan: Updated to 1.2.131 (up from 1.0.121)
- Vulkan: Updated to 1.2.172 (up from 1.1.121)
* Includes MoltenVK 1.1.2 (up from 1.0.36)
- xxhash: Updated to 0.8.0 (up from 0.7.1)
- Zstd: Updated to 1.4.5 (up from 1.4.3)
Expand Down Expand Up @@ -89,9 +89,10 @@ This build includes the following changes:

#### Breaking Changes

- Removed deprecated methods that were marked for removal in LWJGL 3.3.
- Removed deprecated methods that were marked for removal in LWJGL 3.3. (S)
- Core: Users of the dyncall bindings must migrate to libffi. (S)
- Shaderc: The shaderc_spvc library has been removed since Shaderc 2020.4. Users may migrate to the new SPIRV-Cross bindings. (S)
- Shaderc: The shaderc_spvc library has been removed since Shaderc 2020.4. Users may migrate to the new SPIRV-Cross bindings. (S)
- Vulkan: All header boilerplate constants have been moved to `VK10`. (S)

```
(B): binary incompatible change
Expand Down
12 changes: 10 additions & 2 deletions modules/generator/src/main/kotlin/org/lwjgl/generator/Structs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@ open class StructMember(
override fun validate(modifier: StructMemberModifier) = modifier.validate(this)

internal var getter: String? = null
fun getter(expression: String) {
fun getter(expression: String): StructMember {
this.getter = expression
return this
}

internal var setter: String? = null
fun setter(expression: String) {
fun setter(expression: String): StructMember {
this.setter = expression
return this
}

fun copyAccessors(member: StructMember): StructMember {
this.getter = member.getter
this.setter = member.setter
return this
}

internal val offsetField
Expand Down
62 changes: 31 additions & 31 deletions modules/lwjgl/vulkan/src/templates/kotlin/vulkan/Custom.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun templateCustomization() {

IntConstant(
"The Vulkan registry version used to generate the LWJGL bindings.",
"HEADER_VERSION".."131"
"HEADER_VERSION".."172"
)

LongConstant(
Expand Down Expand Up @@ -105,6 +105,7 @@ fun templateCustomization() {

"MAX_PHYSICAL_DEVICE_NAME_SIZE".."256",
"UUID_SIZE".."16",
"LUID_SIZE".."8",
"MAX_EXTENSION_NAME_SIZE".."256",
"MAX_DESCRIPTION_SIZE".."256",
"MAX_MEMORY_TYPES".."32",
Expand All @@ -115,7 +116,11 @@ fun templateCustomization() {
"TRUE".."1",
"FALSE".."0",
"QUEUE_FAMILY_IGNORED".."(~0)",
"SUBPASS_EXTERNAL".."(~0)"
"QUEUE_FAMILY_EXTERNAL".."(~0-1)",
"SUBPASS_EXTERNAL".."(~0)",
"MAX_DEVICE_GROUP_SIZE".."32",
"MAX_DRIVER_NAME_SIZE".."256",
"MAX_DRIVER_INFO_SIZE".."256"
)

FloatConstant(
Expand Down Expand Up @@ -213,15 +218,7 @@ fun templateCustomization() {

IntConstant(
"The API version number for Vulkan 1.1.",
"API_VERSION_1_1".."VK10.VK_MAKE_VERSION(1, 1, 0)"
)

IntConstant(
"API Constants",

"LUID_SIZE".."8",
"QUEUE_FAMILY_EXTERNAL".."(~0-1)",
"MAX_DEVICE_GROUP_SIZE".."32"
"API_VERSION_1_1".."VK_MAKE_VERSION(1, 1, 0)"
)
}

Expand Down Expand Up @@ -350,31 +347,34 @@ fun templateCustomization() {

IntConstant(
"The API version number for Vulkan 1.2.",
"API_VERSION_1_2".."VK10.VK_MAKE_VERSION(1, 2, 0)"
)

IntConstant(
"API Constants",

"MAX_DRIVER_NAME_SIZE".."256",
"MAX_DRIVER_INFO_SIZE".."256"
"API_VERSION_1_2".."VK_MAKE_VERSION(1, 2, 0)"
)
}

VkDeviceGroupPresentCapabilitiesKHR.definition.apply {
javaImport("static org.lwjgl.vulkan.VK11.*")
NV_ray_tracing.apply {
MultiType(PointerMapping.DATA_LONG)..this["GetAccelerationStructureHandleNV"].getParam("pData")
}

VkPhysicalDeviceGroupProperties.definition.apply {
javaImport("static org.lwjgl.vulkan.VK11.*")
}
val VkAccelerationStructureInstanceKHR = VkAccelerationStructureInstanceKHR.definition

VkPhysicalDeviceIDProperties.definition.apply {
javaImport("static org.lwjgl.vulkan.VK10.*")
javaImport("static org.lwjgl.vulkan.VK11.*")
}
VkAccelerationStructureInstanceKHR["instanceCustomIndex"]
.getter("(nbitfield0(struct) >>> 8) & 0xFFFFFF")
.setter("nbitfield0(struct, ((value & 0xFFFFFF) << 8) | (nbitfield0(struct) & 0xFF))")
VkAccelerationStructureInstanceKHR["mask"]
.getter("nbitfield0(struct) & 0xFF")
.setter("nbitfield0(struct, (nbitfield0(struct) & 0xFFFFFF00) | (value & 0xFF))")

NV_ray_tracing.apply {
MultiType(PointerMapping.DATA_LONG)..this["GetAccelerationStructureHandleNV"].getParam("pData")
}
VkAccelerationStructureInstanceKHR["instanceShaderBindingTableRecordOffset"]
.getter("(nbitfield1(struct) >>> 8) & 0xFFFFFF")
.setter("nbitfield1(struct, ((value & 0xFFFFFF) << 8) | (nbitfield1(struct) & 0xFF))")
VkAccelerationStructureInstanceKHR["flags"]
.getter("nbitfield1(struct) & 0xFF")
.setter("nbitfield1(struct, (nbitfield1(struct) & 0xFFFFFF00) | (value & 0xFF))")

val VkAccelerationStructureInstanceNV = VkAccelerationStructureInstanceNV.definition

VkAccelerationStructureInstanceNV["instanceCustomIndex"].copyAccessors(VkAccelerationStructureInstanceKHR["instanceCustomIndex"])
VkAccelerationStructureInstanceNV["mask"].copyAccessors(VkAccelerationStructureInstanceKHR["mask"])
VkAccelerationStructureInstanceNV["instanceShaderBindingTableRecordOffset"].copyAccessors(VkAccelerationStructureInstanceKHR["instanceShaderBindingTableRecordOffset"])
VkAccelerationStructureInstanceNV["flags"].copyAccessors(VkAccelerationStructureInstanceKHR["flags"])
}
Loading

0 comments on commit d9a4498

Please sign in to comment.