diff options
author | Jason Ekstrand <[email protected]> | 2017-07-13 22:50:30 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-08-01 11:12:41 -0700 |
commit | d62063ce316a86e3e091a392b42261138524a1a0 (patch) | |
tree | c570506616c45afaa909c489c62fe66f5620f16f /src/intel/Android.vulkan.mk | |
parent | ddc86c1d0e56e2f16bf37cd378656f459fd15622 (diff) |
anv: Autogenerate extension query and lookup
As time goes on, extension advertising is going to get more complex.
Today, we either implement an extension or we don't. However, in the
future, whether or not we advertise an extension will depend on kernel
or hardware features. This commit introduces a python codegen framework
that generates the anv_EnumerateFooExtensionProperties functions as well
as a pair of anv_foo_extension_supported functions for querying for the
support of a given extension string. Each extension has an "enable"
predicate that is any valid C expression. For device extensions, the
physical device is available as "device" so the expression could be
something such as "device->has_kernel_feature". For instance
extensions, the only option is VK_USE_PLATFORM defines.
This mechanism also means that we have a single one-line-per-entry table
for all extension declarations instead of the two tables we had in
anv_device.c and the one we had in anv_entrypoints_gen.py. The Python
code is smart and uses the XML to determine whether an extension is an
instance extension or device extension.
Reviewed-by: Emil Velikov <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/Android.vulkan.mk')
-rw-r--r-- | src/intel/Android.vulkan.mk | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk index 398f2e7cd07..449d1fc83a8 100644 --- a/src/intel/Android.vulkan.mk +++ b/src/intel/Android.vulkan.mk @@ -25,6 +25,8 @@ include $(LOCAL_PATH)/Makefile.sources VK_ENTRYPOINTS_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/vulkan/anv_entrypoints_gen.py +VK_EXTENSIONS_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/vulkan/anv_extensions.py + VULKAN_COMMON_INCLUDES := \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/gallium/auxiliary \ @@ -53,6 +55,7 @@ LOCAL_C_INCLUDES := \ $(VULKAN_COMMON_INCLUDES) LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_entrypoints.h +LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_extensions.c LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/dummy.c $(intermediates)/vulkan/dummy.c: @@ -213,6 +216,12 @@ $(intermediates)/vulkan/anv_entrypoints.c: --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \ --outdir $(dir $@) +$(intermediates)/vulkan/anv_extensions.c: + @mkdir -p $(dir $@) + $(VK_EXTENSIONS_SCRIPT) \ + --xml $(MESA_TOP)/src/vulkan/registry/vk.xml \ + --out $@ + LOCAL_SHARED_LIBRARIES := libdrm include $(MESA_COMMON_MK) |