rusticl: enable proper fp16 support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34053>
This commit is contained in:
Karol Herbst 2025-03-13 17:49:15 +01:00 committed by Marge Bot
parent 33fb1eca3e
commit cf3ec8d3b9
6 changed files with 5 additions and 10 deletions

View file

@ -1186,7 +1186,6 @@ Rusticl environment variables
a comma-separated list of features to enable. Those are disabled by default a comma-separated list of features to enable. Those are disabled by default
as they might not be stable enough or break OpenCL conformance. as they might not be stable enough or break OpenCL conformance.
- ``fp16`` enables OpenCL half support
- ``fp64`` enables OpenCL double support - ``fp64`` enables OpenCL double support
- ``intel`` enables various Intel OpenCL extensions - ``intel`` enables various Intel OpenCL extensions

View file

@ -819,7 +819,7 @@ Rusticl extensions that are not part of any OpenCL version:
cl_khr_expect_assume in progress (hints are ignored) cl_khr_expect_assume in progress (hints are ignored)
cl_khr_extended_async_copies not started cl_khr_extended_async_copies not started
cl_khr_extended_bit_ops in progress cl_khr_extended_bit_ops in progress
cl_khr_fp16 in progress (llvmpipe, radeonsi, zink, Available with environment variable RUSTICL_FEATURES=fp16) cl_khr_fp16 DONE (asahi, freedreno, llvmpipe, panfrost, radeonsi, zink)
cl_khr_gl_depth_images not started cl_khr_gl_depth_images not started
cl_khr_gl_msaa_sharing not started cl_khr_gl_msaa_sharing not started
cl_khr_gl_sharing DONE (iris, radeonsi, zink) cl_khr_gl_sharing DONE (iris, radeonsi, zink)

View file

@ -36,3 +36,4 @@ VK_KHR_load_store_op_none on panvk
VK_EXT_load_store_op_none on panvk VK_EXT_load_store_op_none on panvk
VK_EXT_scalar_block_layout on radv/gfx6 VK_EXT_scalar_block_layout on radv/gfx6
VK_EXT_inline_uniform_block on panvk VK_EXT_inline_uniform_block on panvk
cl_khr_fp16 on asahi, freedreno, llvmpipe, panfrost, radeonsi and zink

View file

@ -888,10 +888,6 @@ impl Device {
} }
pub fn fp16_supported(&self) -> bool { pub fn fp16_supported(&self) -> bool {
if !Platform::features().fp16 {
return false;
}
self.shader_caps().fp16 self.shader_caps().fp16
} }

View file

@ -67,7 +67,6 @@ pub struct PlatformDebug {
} }
pub struct PlatformFeatures { pub struct PlatformFeatures {
pub fp16: bool,
pub fp64: bool, pub fp64: bool,
pub intel: bool, pub intel: bool,
} }
@ -96,7 +95,6 @@ static mut PLATFORM_DBG: PlatformDebug = PlatformDebug {
validate_spirv: false, validate_spirv: false,
}; };
static mut PLATFORM_FEATURES: PlatformFeatures = PlatformFeatures { static mut PLATFORM_FEATURES: PlatformFeatures = PlatformFeatures {
fp16: false,
fp64: false, fp64: false,
intel: false, intel: false,
}; };
@ -134,7 +132,6 @@ fn load_env() {
if let Ok(feature_flags) = env::var("RUSTICL_FEATURES") { if let Ok(feature_flags) = env::var("RUSTICL_FEATURES") {
for flag in feature_flags.split(',') { for flag in feature_flags.split(',') {
match flag { match flag {
"fp16" => features.fp16 = true,
"fp64" => features.fp64 = true, "fp64" => features.fp64 = true,
"intel" => features.intel = true, "intel" => features.intel = true,
"" => (), "" => (),

View file

@ -518,7 +518,9 @@ impl CLCSpecConstantType for clc_spec_constant_type {
Self::CLC_SPEC_CONSTANT_INT32 Self::CLC_SPEC_CONSTANT_INT32
| Self::CLC_SPEC_CONSTANT_UINT32 | Self::CLC_SPEC_CONSTANT_UINT32
| Self::CLC_SPEC_CONSTANT_FLOAT => 4, | Self::CLC_SPEC_CONSTANT_FLOAT => 4,
Self::CLC_SPEC_CONSTANT_INT16 | Self::CLC_SPEC_CONSTANT_UINT16 => 2, Self::CLC_SPEC_CONSTANT_INT16
| Self::CLC_SPEC_CONSTANT_UINT16
| Self::CLC_SPEC_CONSTANT_HALF => 2,
Self::CLC_SPEC_CONSTANT_INT8 Self::CLC_SPEC_CONSTANT_INT8
| Self::CLC_SPEC_CONSTANT_UINT8 | Self::CLC_SPEC_CONSTANT_UINT8
| Self::CLC_SPEC_CONSTANT_BOOL => 1, | Self::CLC_SPEC_CONSTANT_BOOL => 1,