Ejemplo n.º 1
0
from mako.template import Template
from os import path
from zink_extensions import Extension,Layer
import sys

EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_get_physical_device_properties2"),
    Extension("VK_KHR_external_memory_capabilities"),
]

LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
    Layer("VK_LAYER_KHRONOS_validation",
      conditions=["have_EXT_debug_utils"]),
    Layer("VK_LAYER_LUNARG_standard_validation",
      conditions=["have_EXT_debug_utils", "!have_layer_KHRONOS_validation"]),
]

REPLACEMENTS = {
    "VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES2_EXTENSION_NAME" : "VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME"
}

header_code = """
#ifndef ZINK_INSTANCE_H
#define ZINK_INSTANCE_H

#include "os/os_process.h"

#include <vulkan/vulkan.h>
Ejemplo n.º 2
0
from zink_extensions import Extension, Layer, ExtensionRegistry, Version
import sys

# constructor: Extension(name, core_since=None, functions=[])
# The attributes:
#  - core_since: the Vulkan version where this extension is promoted to core.
#                When instance_info->loader_version is greater than or equal to this
#                instance_info.have_{name} is set to true unconditionally. This
#                is done because loading extensions that are promoted to core is
#                considered to be an error.
#
#  - functions: functions which are added by the extension. The function names
#               should not include the "vk" prefix and the vendor suffix - these
#               will be added by the codegen accordingly.
EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_get_physical_device_properties2",
              functions=[
                  "GetPhysicalDeviceFeatures2", "GetPhysicalDeviceProperties2"
              ]),
    Extension("VK_KHR_external_memory_capabilities"),
    Extension("VK_MVK_moltenvk", nonstandard=True),
]

# constructor: Layer(name, conditions=[])
LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
    Layer("VK_LAYER_KHRONOS_validation", conditions=["have_EXT_debug_utils"]),
    Layer(
        "VK_LAYER_LUNARG_standard_validation",
        conditions=["have_EXT_debug_utils", "!have_layer_KHRONOS_validation"]),
Ejemplo n.º 3
0
from zink_extensions import Extension, Layer, Version
import sys

# constructor: Extension(name, core_since=None, functions=[])
# The attributes:
#  - core_since: the Vulkan version where this extension is promoted to core.
#                When screen->loader_version is greater than or equal to this
#                instance_info.have_{name} is set to true unconditionally. This
#                is done because loading extensions that are promoted to core is
#                considered to be an error.
#
#  - functions: functions which are added by the extension. The function names
#               should not include the "vk" prefix and the vendor suffix - these
#               will be added by the codegen accordingly.
EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_maintenance2"),
    Extension("VK_KHR_get_physical_device_properties2",
              functions=[
                  "GetPhysicalDeviceFeatures2", "GetPhysicalDeviceProperties2"
              ]),
    Extension(
        "VK_KHR_draw_indirect_count",
        functions=["CmdDrawIndexedIndirectCount", "CmdDrawIndirectCount"]),
    Extension("VK_KHR_external_memory_capabilities"),
    Extension("VK_MVK_moltenvk"),
]

# constructor: Layer(name, conditions=[])
LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
Ejemplo n.º 4
0
#    Hoe Hao Cheng <*****@*****.**>
#

from mako.template import Template
from os import path
from xml.etree import ElementTree
from zink_extensions import Extension, Layer, ExtensionRegistry, Version
import sys

# constructor: Extension(name, conditions=[], nonstandard=False)
# The attributes:
#  - conditions: If the extension is provided by the Vulkan implementation, then
#                these are the extra conditions needed to enable the extension.
#  - nonstandard: Disables validation (cross-checking with vk.xml) if True.
EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_get_physical_device_properties2"),
    Extension("VK_KHR_external_memory_capabilities"),
    Extension("VK_MVK_moltenvk", nonstandard=True),
    Extension("VK_KHR_surface"),
    Extension("VK_EXT_headless_surface"),
    Extension("VK_KHR_wayland_surface"),
    Extension("VK_KHR_xcb_surface"),
]

# constructor: Layer(name, conditions=[])
# - conditions: See documentation of EXTENSIONS.
LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
    Layer("VK_LAYER_KHRONOS_validation",
          conditions=["zink_debug & ZINK_DEBUG_VALIDATION"]),
Ejemplo n.º 5
0
#              struct inside `zink_device_info.{alias}_feats`.
#
#  - conditions: criteria for enabling an extension. This is an array of strings,
#                where each string is a condition, and all conditions have to be true
#                for `zink_device_info.have_{name}` to be true.
#
#                The code generator will replace "$feats" and "$props" with the
#                respective variables, e.g. "$feats.nullDescriptor" becomes
#                "info->rb2_feats.nullDescriptor" in the final code for VK_EXT_robustness2.
#
#                When empty or None, the extension is enabled when the extensions
#                given by vkEnumerateDeviceExtensionProperties() include the extension.
#
#  - guard: adds a #if defined(`extension_name`)/#endif guard around the code generated for this Extension.
EXTENSIONS = [
    Extension("VK_KHR_maintenance1", required=True),
    Extension("VK_KHR_maintenance2"),
    Extension("VK_KHR_maintenance3"),
    Extension("VK_KHR_external_memory"),
    Extension("VK_KHR_external_memory_fd"),
    Extension("VK_KHR_vulkan_memory_model"),
    Extension("VK_KHR_external_semaphore_fd"),
    Extension("VK_KHR_create_renderpass2", required=True),
    Extension("VK_KHR_synchronization2", alias="sync2", features=True),
    Extension("VK_EXT_external_memory_dma_buf"),
    Extension("VK_EXT_queue_family_foreign"),
    Extension("VK_KHR_swapchain_mutable_format"),
    Extension("VK_EXT_provoking_vertex",
              alias="pv",
              features=True,
              properties=True,
Ejemplo n.º 6
0
#              struct inside `zink_device_info.{alias}_feats`.
#
#  - conditions: criteria for enabling an extension. This is an array of strings,
#                where each string is a condition, and all conditions have to be true
#                for `zink_device_info.have_{name}` to be true.
#
#                The code generator will replace "$feats" and "$props" with the
#                respective variables, e.g. "$feats.nullDescriptor" becomes 
#                "info->rb2_feats.nullDescriptor" in the final code for VK_EXT_robustness2.
#
#                When empty or None, the extension is enabled when the extensions
#                given by vkEnumerateDeviceExtensionProperties() include the extension.
#
#  - guard: adds a #if defined(`extension_name`)/#endif guard around the code generated for this Extension.
EXTENSIONS = [
    Extension("VK_KHR_maintenance1",
        required=True),
    Extension("VK_KHR_maintenance2"),
    Extension("VK_KHR_external_memory"),
    Extension("VK_KHR_external_memory_fd"),
    Extension("VK_KHR_vulkan_memory_model"),
    Extension("VK_EXT_shader_viewport_index_layer"),
    Extension("VK_EXT_post_depth_coverage"),
    Extension("VK_KHR_driver_properties",
        alias="driver",
        properties=True),
    Extension("VK_KHR_draw_indirect_count"),
    Extension("VK_EXT_fragment_shader_interlock",
       alias="interlock",
       features=True,
       conditions=["$feats.fragmentShaderSampleInterlock", "$feats.fragmentShaderPixelInterlock"]),
    Extension("VK_KHR_shader_draw_parameters"),
Ejemplo n.º 7
0
#    Hoe Hao Cheng <*****@*****.**>
#

from mako.template import Template
from os import path
from xml.etree import ElementTree
from zink_extensions import Extension, Layer, ExtensionRegistry, Version
import sys

# constructor: Extension(name, conditions=[], nonstandard=False)
# The attributes:
#  - conditions: If the extension is provided by the Vulkan implementation, then
#                these are the extra conditions needed to enable the extension.
#  - nonstandard: Disables validation (cross-checking with vk.xml) if True.
EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_get_physical_device_properties2"),
    Extension("VK_KHR_external_memory_capabilities"),
    Extension("VK_MVK_moltenvk", nonstandard=True),
    Extension("VK_KHR_surface"),
    Extension("VK_EXT_headless_surface"),
    Extension("VK_KHR_wayland_surface"),
    Extension("VK_KHR_xcb_surface",
              conditions=["!instance_info->disable_xcb_surface"]),
    Extension("VK_KHR_win32_surface"),
]

# constructor: Layer(name, conditions=[])
# - conditions: See documentation of EXTENSIONS.
LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
Ejemplo n.º 8
0
from mako.template import Template
from os import path
from zink_extensions import Extension,Layer
import sys

EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_maintenance2"),
    Extension("VK_KHR_get_physical_device_properties2"),
    Extension("VK_KHR_draw_indirect_count"),
    Extension("VK_KHR_external_memory_capabilities"),
    Extension("VK_MVK_moltenvk"),
]

LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
    Layer("VK_LAYER_KHRONOS_validation",
      conditions=["have_EXT_debug_utils"]),
    Layer("VK_LAYER_LUNARG_standard_validation",
      conditions=["have_EXT_debug_utils", "!have_layer_KHRONOS_validation"]),
]

REPLACEMENTS = {
    "VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES2_EXTENSION_NAME" : "VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME"
}

header_code = """
#ifndef ZINK_INSTANCE_H
#define ZINK_INSTANCE_H

#include "os/os_process.h"
Ejemplo n.º 9
0
#              struct inside `zink_device_info.{alias}_feats`.
#
#  - conditions: criteria for enabling an extension. This is an array of strings,
#                where each string is a condition, and all conditions have to be true
#                for `zink_device_info.have_{name}` to be true.
#
#                The code generator will replace "$feats" and "$props" with the
#                respective variables, e.g. "$feats.nullDescriptor" becomes
#                "info->rb2_feats.nullDescriptor" in the final code for VK_EXT_robustness2.
#
#                When empty or None, the extension is enabled when the extensions
#                given by vkEnumerateDeviceExtensionProperties() include the extension.
#
#  - guard: adds a #if defined(`extension_name`)/#endif guard around the code generated for this Extension.
EXTENSIONS = [
    Extension("VK_KHR_maintenance1", required=True),
    Extension("VK_KHR_external_memory"),
    Extension("VK_KHR_external_memory_fd"),
    Extension("VK_KHR_vulkan_memory_model"),
    Extension("VK_EXT_conditional_rendering",
              alias="cond_render",
              features=True,
              conditions=["$feats.conditionalRendering"]),
    Extension("VK_EXT_transform_feedback",
              alias="tf",
              properties=True,
              features=True,
              conditions=["$feats.transformFeedback"]),
    Extension("VK_EXT_index_type_uint8",
              alias="index_uint8",
              features=True,
Ejemplo n.º 10
0
from zink_extensions import Extension, Layer, ExtensionRegistry, Version
import sys

# constructor: Extension(name, core_since=None, functions=[])
# The attributes:
#  - core_since: the Vulkan version where this extension is promoted to core.
#                When instance_info->loader_version is greater than or equal to this
#                instance_info.have_{name} is set to true unconditionally. This
#                is done because loading extensions that are promoted to core is
#                considered to be an error.
#
#  - functions: functions which are added by the extension. The function names
#               should not include the "vk" prefix and the vendor suffix - these
#               will be added by the codegen accordingly.
EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_get_physical_device_properties2",
              functions=[
                  "GetPhysicalDeviceFeatures2", "GetPhysicalDeviceProperties2",
                  "GetPhysicalDeviceFormatProperties2",
                  "GetPhysicalDeviceImageFormatProperties2"
              ]),
    Extension("VK_MVK_moltenvk", nonstandard=True),
]

# constructor: Layer(name, conditions=[])
LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
    Layer("VK_LAYER_KHRONOS_validation", conditions=["have_EXT_debug_utils"]),
    Layer(
        "VK_LAYER_LUNARG_standard_validation",
Ejemplo n.º 11
0
#    Hoe Hao Cheng <*****@*****.**>
#

from mako.template import Template
from os import path
from xml.etree import ElementTree
from zink_extensions import Extension, Layer, ExtensionRegistry, Version
import sys

# constructor: Extension(name, conditions=[], nonstandard=False)
# The attributes:
#  - conditions: If the extension is provided by the Vulkan implementation, then
#                these are the extra conditions needed to enable the extension.
#  - nonstandard: Disables validation (cross-checking with vk.xml) if True.
EXTENSIONS = [
    Extension("VK_EXT_debug_utils"),
    Extension("VK_KHR_get_physical_device_properties2"),
    Extension("VK_MVK_moltenvk", nonstandard=True),
    Extension("VK_KHR_surface"),
]

# constructor: Layer(name, conditions=[])
# - conditions: See documentation of EXTENSIONS.
LAYERS = [
    # if we have debug_util, allow a validation layer to be added.
    Layer("VK_LAYER_KHRONOS_validation",
          conditions=["zink_debug & ZINK_DEBUG_VALIDATION"]),
    Layer("VK_LAYER_LUNARG_standard_validation",
          conditions=[
              "zink_debug & ZINK_DEBUG_VALIDATION",
              "!have_layer_KHRONOS_validation"