Browse Source

[vulkan] Verify UniformAndStorage capabilities on device

lsfg-android
CamilleLaVey 4 weeks ago
parent
commit
27a0010b6e
  1. 2
      src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
  2. 1
      src/shader_recompiler/profile.h
  3. 2
      src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
  4. 5
      src/video_core/vulkan_common/vulkan_device.h

2
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp

@ -1126,7 +1126,7 @@ void EmitContext::DefineConstantBuffers(const Info& info, u32& binding) {
} }
IR::Type types{info.used_constant_buffer_types | info.used_indirect_cbuf_types}; IR::Type types{info.used_constant_buffer_types | info.used_indirect_cbuf_types};
if (True(types & IR::Type::U8)) { if (True(types & IR::Type::U8)) {
if (profile.support_int8) {
if (profile.support_int8 && profile.support_uniform_and_storage_buffer_8bit) {
DefineConstBuffers(*this, info, &UniformDefinitions::U8, binding, U8, 'u', sizeof(u8)); DefineConstBuffers(*this, info, &UniformDefinitions::U8, binding, U8, 'u', sizeof(u8));
DefineConstBuffers(*this, info, &UniformDefinitions::S8, binding, S8, 's', sizeof(s8)); DefineConstBuffers(*this, info, &UniformDefinitions::S8, binding, S8, 's', sizeof(s8));
} else { } else {

1
src/shader_recompiler/profile.h

@ -15,6 +15,7 @@ struct Profile {
bool unified_descriptor_binding{}; bool unified_descriptor_binding{};
bool support_descriptor_aliasing{}; bool support_descriptor_aliasing{};
bool support_int8{}; bool support_int8{};
bool support_uniform_and_storage_buffer_8bit{};
bool support_int16{}; bool support_int16{};
bool support_int64{}; bool support_int64{};
bool support_vertex_instance_id{}; bool support_vertex_instance_id{};

2
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp

@ -383,6 +383,8 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
.unified_descriptor_binding = true, .unified_descriptor_binding = true,
.support_descriptor_aliasing = device.IsDescriptorAliasingSupported(), .support_descriptor_aliasing = device.IsDescriptorAliasingSupported(),
.support_int8 = device.IsInt8Supported(), .support_int8 = device.IsInt8Supported(),
.support_uniform_and_storage_buffer_8bit =
device.IsUniformAndStorageBuffer8BitAccessSupported(),
.support_int16 = device.IsShaderInt16Supported(), .support_int16 = device.IsShaderInt16Supported(),
.support_int64 = device.IsShaderInt64Supported(), .support_int64 = device.IsShaderInt64Supported(),
.support_vertex_instance_id = false, .support_vertex_instance_id = false,

5
src/video_core/vulkan_common/vulkan_device.h

@ -387,6 +387,11 @@ FN_MAX_LIMIT_LIST
return features.shader_float16_int8.shaderInt8; return features.shader_float16_int8.shaderInt8;
} }
/// Returns true if the device allows 8-bit integer members
bool IsUniformAndStorageBuffer8BitAccessSupported() const {
return features.bit8_storage.uniformAndStorageBuffer8BitAccess;
}
/// Returns true if the device supports binding multisample images as storage images. /// Returns true if the device supports binding multisample images as storage images.
bool IsStorageImageMultisampleSupported() const { bool IsStorageImageMultisampleSupported() const {
return features.features.shaderStorageImageMultisample; return features.features.shaderStorageImageMultisample;

Loading…
Cancel
Save