1
0
Fork 0
forked from suyu/suyu

vk_device: Shrink formatless capability name size

This commit is contained in:
ReinUsesLisp 2020-03-06 05:06:02 -03:00
parent ae6189d7c2
commit c320702092
3 changed files with 23 additions and 26 deletions

View file

@ -107,8 +107,7 @@ bool VKDevice::Create(const vk::DispatchLoaderDynamic& dldi, vk::Instance instan
features.occlusionQueryPrecise = true; features.occlusionQueryPrecise = true;
features.fragmentStoresAndAtomics = true; features.fragmentStoresAndAtomics = true;
features.shaderImageGatherExtended = true; features.shaderImageGatherExtended = true;
features.shaderStorageImageReadWithoutFormat = features.shaderStorageImageReadWithoutFormat = is_formatless_image_load_supported;
is_shader_storage_img_read_without_format_supported;
features.shaderStorageImageWriteWithoutFormat = true; features.shaderStorageImageWriteWithoutFormat = true;
features.textureCompressionASTC_LDR = is_optimal_astc_supported; features.textureCompressionASTC_LDR = is_optimal_astc_supported;
@ -467,8 +466,7 @@ void VKDevice::SetupFamilies(const vk::DispatchLoaderDynamic& dldi, vk::SurfaceK
void VKDevice::SetupFeatures(const vk::DispatchLoaderDynamic& dldi) { void VKDevice::SetupFeatures(const vk::DispatchLoaderDynamic& dldi) {
const auto supported_features{physical.getFeatures(dldi)}; const auto supported_features{physical.getFeatures(dldi)};
is_shader_storage_img_read_without_format_supported = is_formatless_image_load_supported = supported_features.shaderStorageImageReadWithoutFormat;
supported_features.shaderStorageImageReadWithoutFormat;
is_optimal_astc_supported = IsOptimalAstcSupported(supported_features, dldi); is_optimal_astc_supported = IsOptimalAstcSupported(supported_features, dldi);
} }

View file

@ -122,11 +122,6 @@ public:
return properties.limits.maxPushConstantsSize; return properties.limits.maxPushConstantsSize;
} }
/// Returns true if Shader storage Image Read Without Format supported.
bool IsShaderStorageImageReadWithoutFormatSupported() const {
return is_shader_storage_img_read_without_format_supported;
}
/// Returns true if ASTC is natively supported. /// Returns true if ASTC is natively supported.
bool IsOptimalAstcSupported() const { bool IsOptimalAstcSupported() const {
return is_optimal_astc_supported; return is_optimal_astc_supported;
@ -147,6 +142,11 @@ public:
return (guest_warp_stages & stage) != vk::ShaderStageFlags{}; return (guest_warp_stages & stage) != vk::ShaderStageFlags{};
} }
/// Returns true if formatless image load is supported.
bool IsFormatlessImageLoadSupported() const {
return is_formatless_image_load_supported;
}
/// Returns true if the device supports VK_EXT_scalar_block_layout. /// Returns true if the device supports VK_EXT_scalar_block_layout.
bool IsKhrUniformBufferStandardLayoutSupported() const { bool IsKhrUniformBufferStandardLayoutSupported() const {
return khr_uniform_buffer_standard_layout; return khr_uniform_buffer_standard_layout;
@ -223,17 +223,16 @@ private:
u32 graphics_family{}; ///< Main graphics queue family index. u32 graphics_family{}; ///< Main graphics queue family index.
u32 present_family{}; ///< Main present queue family index. u32 present_family{}; ///< Main present queue family index.
vk::DriverIdKHR driver_id{}; ///< Driver ID. vk::DriverIdKHR driver_id{}; ///< Driver ID.
vk::ShaderStageFlags guest_warp_stages{}; ///< Stages where the guest warp size can be forced. vk::ShaderStageFlags guest_warp_stages{}; ///< Stages where the guest warp size can be forced.ed
bool is_optimal_astc_supported{}; ///< Support for native ASTC. bool is_optimal_astc_supported{}; ///< Support for native ASTC.
bool is_float16_supported{}; ///< Support for float16 arithmetics. bool is_float16_supported{}; ///< Support for float16 arithmetics.
bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest.
bool is_formatless_image_load_supported{}; ///< Support for shader image read without format.
bool khr_uniform_buffer_standard_layout{}; ///< Support for std430 on UBOs. bool khr_uniform_buffer_standard_layout{}; ///< Support for std430 on UBOs.
bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8.
bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted.
bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer. bool ext_shader_viewport_index_layer{}; ///< Support for VK_EXT_shader_viewport_index_layer.
bool nv_device_diagnostic_checkpoints{}; ///< Support for VK_NV_device_diagnostic_checkpoints. bool nv_device_diagnostic_checkpoints{}; ///< Support for VK_NV_device_diagnostic_checkpoints.
bool is_shader_storage_img_read_without_format_supported{}; ///< Support for shader storage
///< image read without format
// Telemetry parameters // Telemetry parameters
std::string vendor_name; ///< Device's driver name. std::string vendor_name; ///< Device's driver name.

View file

@ -298,7 +298,7 @@ public:
} }
} }
if (device.IsShaderStorageImageReadWithoutFormatSupported()) { if (device.IsFormatlessImageLoadSupported()) {
AddCapability(spv::Capability::StorageImageReadWithoutFormat); AddCapability(spv::Capability::StorageImageReadWithoutFormat);
} }
@ -1800,7 +1800,7 @@ private:
} }
Expression ImageLoad(Operation operation) { Expression ImageLoad(Operation operation) {
if (!device.IsShaderStorageImageReadWithoutFormatSupported()) { if (!device.IsFormatlessImageLoadSupported()) {
return {v_float_zero, Type::Float}; return {v_float_zero, Type::Float};
} }