chore: revert removal of DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE (#6534)

This commit is contained in:
Erich Gubler 2024-11-13 07:03:16 -05:00 committed by GitHub
parent b5986a9df1
commit efc15ba03b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,8 @@ use std::ops;
pub type NonUniformResult = Option<Handle<crate::Expression>>;
const DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE: bool = true;
bitflags::bitflags! {
/// Kinds of expressions that require uniform control flow.
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
@ -23,8 +25,8 @@ bitflags::bitflags! {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct UniformityRequirements: u8 {
const WORK_GROUP_BARRIER = 0x1;
const DERIVATIVE = 0x2;
const IMPLICIT_LEVEL = 0x4;
const DERIVATIVE = if DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE { 0 } else { 0x2 };
const IMPLICIT_LEVEL = if DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE { 0 } else { 0x4 };
}
}
@ -1350,6 +1352,9 @@ fn uniform_control_flow() {
&expressions,
&Arena::new(),
);
if DISABLE_UNIFORMITY_REQ_FOR_FRAGMENT_STAGE {
assert_eq!(info[derivative_expr].ref_count, 2);
} else {
assert_eq!(
block_info,
Err(FunctionError::NonUniformControlFlow(
@ -1397,6 +1402,7 @@ fn uniform_control_flow() {
);
assert_eq!(info[derivative_expr].ref_count, 2);
}
}
assert_eq!(info[non_uniform_global], GlobalUse::READ);
let stmt_emit3 = S::Emit(emit_range_globals);