Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions backends/vulkan/runtime/vk_api/Adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ class Adapter final {
// Physical Device Features

inline bool supports_16bit_storage_buffers() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
#ifdef VK_KHR_16bit_storage
return physical_device_.shader_16bit_storage.storageBuffer16BitAccess ==
VK_TRUE;
Expand All @@ -188,6 +191,9 @@ class Adapter final {
}

inline bool supports_8bit_storage_buffers() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
#ifdef VK_KHR_8bit_storage
return physical_device_.shader_8bit_storage.storageBuffer8BitAccess ==
VK_TRUE;
Expand All @@ -197,6 +203,9 @@ class Adapter final {
}

inline bool supports_float16_shader_types() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
#ifdef VK_KHR_shader_float16_int8
return physical_device_.shader_float16_int8_types.shaderFloat16 == VK_TRUE;
#else
Expand All @@ -205,6 +214,9 @@ class Adapter final {
}

inline bool supports_int8_shader_types() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
#ifdef VK_KHR_shader_float16_int8
return physical_device_.shader_float16_int8_types.shaderInt8 == VK_TRUE;
#else
Expand All @@ -213,6 +225,9 @@ class Adapter final {
}

inline bool supports_int8_dot_product() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
#ifdef VK_KHR_shader_integer_dot_product
return physical_device_.shader_int_dot_product_features
.shaderIntegerDotProduct == VK_TRUE;
Expand All @@ -222,6 +237,9 @@ class Adapter final {
}

inline bool supports_nv_cooperative_matrix2() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
#ifdef VK_NV_cooperative_matrix2
return physical_device_.cooperative_matrix2_features
.cooperativeMatrixWorkgroupScope == VK_TRUE &&
Expand All @@ -235,14 +253,23 @@ class Adapter final {
}

inline bool supports_int16_shader_types() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
return physical_device_.supports_int16_shader_types;
}

inline bool supports_int64_shader_types() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
return physical_device_.supports_int64_shader_types;
}

inline bool supports_float64_shader_types() {
#ifdef ETVK_FORCE_NO_EXTENSIONS
return false;
#endif
return physical_device_.supports_float64_shader_types;
}

Expand Down
4 changes: 4 additions & 0 deletions backends/vulkan/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def get_vulkan_preprocessor_flags(no_volk, is_fbcode):
android_flags = []

debug_mode = read_config("etvk", "debug", "0") == "1"
force_no_extensions = read_config("etvk", "force_no_extensions", "0") == "1"

if not no_volk:
for flags in [default_flags, android_flags]:
Expand Down Expand Up @@ -68,6 +69,9 @@ def get_vulkan_preprocessor_flags(no_volk, is_fbcode):
if debug_mode:
VK_API_PREPROCESSOR_FLAGS += ["-DVULKAN_DEBUG"]

if force_no_extensions:
VK_API_PREPROCESSOR_FLAGS += ["-DETVK_FORCE_NO_EXTENSIONS"]

return VK_API_PREPROCESSOR_FLAGS

def get_labels(no_volk):
Expand Down
Loading