@@ -143,7 +143,7 @@ void ModuleShaderFlags::updateFunctionFlags(ComputedShaderFlags &CSF,
143143 }
144144
145145 if (CSF.LowPrecisionPresent ) {
146- if (NativeLowPrecisionMode )
146+ if (CanSetNativeLowPrecisionMode )
147147 CSF.NativeLowPrecision = true ;
148148 else
149149 CSF.MinimumPrecision = true ;
@@ -214,20 +214,19 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM,
214214
215215 CanSetResMayNotAlias = MMDI.DXILVersion >= VersionTuple (1 , 7 );
216216 // The command line option -res-may-alias will set the dx.resmayalias module
217- // flag to 1 and disable the ability to set the ResMayNotAlias flag
218- if (auto *RMA = mdconst::extract_or_null<ConstantInt>(
217+ // flag to 1, thereby disabling the ability to set the ResMayNotAlias flag
218+ if (auto *ResMayAlias = mdconst::extract_or_null<ConstantInt>(
219219 M.getModuleFlag (" dx.resmayalias" )))
220- if (RMA->getValue () != 0 )
221- CanSetResMayNotAlias = false ;
220+ CanSetResMayNotAlias = !ResMayAlias->getValue ().getBoolValue ();
222221
223222 // NativeLowPrecisionMode can only be set when the command line option
224223 // -enable-16bit-types is provided. This is indicated by the dx.nativelowprec
225224 // module flag being set
226- NativeLowPrecisionMode = false ;
225+ CanSetNativeLowPrecisionMode = false ;
227226 if (auto *NativeLowPrec = mdconst::extract_or_null<ConstantInt>(
228227 M.getModuleFlag (" dx.nativelowprec" )))
229228 if (MMDI.ShaderModelVersion >= VersionTuple (6 , 2 ))
230- NativeLowPrecisionMode = NativeLowPrec->getValue ().getBoolValue ();
229+ CanSetNativeLowPrecisionMode = NativeLowPrec->getValue ().getBoolValue ();
231230
232231 CallGraph CG (M);
233232
@@ -298,7 +297,7 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM,
298297 // is needed even if the module does not use 16-bit types because a
299298 // corresponding debug module may include 16-bit types, and tools that use the
300299 // debug module may expect it to have the same flags as the original
301- CombinedSFMask.NativeLowPrecisionMode = NativeLowPrecisionMode ;
300+ CombinedSFMask.NativeLowPrecisionMode = CanSetNativeLowPrecisionMode ;
302301
303302 // Set the Max64UAVs flag if the number of UAVs is > 8
304303 uint32_t NumUAVs = 0 ;
0 commit comments