Implement MUBUF instructions for shorts/bytes (#2856)

* implement loads/store instructions for types smaller than dwords

* initialize s16/s8 types

* set profile for int8/16/64

* also need to zero extend u8/u16 to u32 result

* document unrelated bugs with atomic fmin/max

* remove profile checks and simple emit for added opcodes

---------

Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
baggins183
2025-07-18 02:04:50 -07:00
committed by GitHub
parent 76f003d388
commit 3019bfb978
11 changed files with 120 additions and 58 deletions

View File

@@ -94,6 +94,21 @@ public:
return features.shaderFloat64;
}
/// Returns true if 64-bit ints are supported in shaders
bool IsShaderInt64Supported() const {
return features.shaderInt64;
}
/// Returns true if 16-bit ints are supported in shaders
bool IsShaderInt16Supported() const {
return features.shaderInt16;
}
/// Returns true if 8-bit ints are supported in shaders
bool IsShaderInt8Supported() const {
return vk12_features.shaderInt8;
}
/// Returns true when VK_EXT_custom_border_color is supported
bool IsCustomBorderColorSupported() const {
return custom_border_color;

View File

@@ -203,6 +203,9 @@ PipelineCache::PipelineCache(const Instance& instance_, Scheduler& scheduler_,
profile = Shader::Profile{
.supported_spirv = SpirvVersion1_6,
.subgroup_size = instance.SubgroupSize(),
.support_int8 = instance.IsShaderInt8Supported(),
.support_int16 = instance.IsShaderInt16Supported(),
.support_int64 = instance.IsShaderInt64Supported(),
.support_float64 = instance.IsShaderFloat64Supported(),
.support_fp32_denorm_preserve = bool(vk12_props.shaderDenormPreserveFloat32),
.support_fp32_denorm_flush = bool(vk12_props.shaderDenormFlushToZeroFloat32),