noExpressionOptimizations (HLSL)

Bb313982.note(en-us,XNAGameStudio.31).gifNote
This HLSL attribute is available only when developing for the Xbox 360.

Avoids optimization of expressions.

Syntax

[noExpressionOptimizations]

Parameters

None.

Scope

Applies to statements, functions, or any scope.

Remarks

The noExpressionOptimizations attribute instructs the compiler not to optimize expressions. The resulting microcode assembly is kept as close to the original HLSL as possible.

In general, do not apply the noExpressionOptimizations attribute. Use it only to disable optimizations that are causing problems in your code.

In some situations, the compiler must perform expression optimization even if you apply the noExpressionOptimizations attribute. For example, the compiler must optimize expressions during sampler array indexing.

Also, the compiler may need to optimize expressions within the scope of the attribute when neighboring code is optimized. To avoid this situation, apply the noExpressionOptimizations attribute to the shader entry point.

The noExpressionOptimizations attribute cannot be nested. This attribute implies the isolate attribute.

Community Additions

ADD
Show: