Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SyncEffectState()

void Microsoft.Xna.Framework.Graphics.EffectPass.SyncEffectState ( )
inlineprivate

Definition at line 141 of file EffectPass.cs.

142 {
143 GraphicsDevice graphicsDevice = _technique._parent.GraphicsDevice;
144 if (graphicsDevice == null)
145 {
146 throw new ArgumentNullException("graphicsDevice", FrameworkResources.DeviceCannotBeNullOnResourceCreate);
147 }
148 if ((_stateFlags & EffectStateFlags.Blend) != 0)
149 {
150 graphicsDevice.ClearBlendState();
151 }
152 if ((_stateFlags & EffectStateFlags.DepthStencil) != 0)
153 {
154 graphicsDevice.ClearDepthStencilState();
155 }
156 if ((_stateFlags & EffectStateFlags.Rasterizer) != 0)
157 {
158 graphicsDevice.ClearRasterizerState();
159 }
160 if ((_stateFlags & EffectStateFlags.AllSamplers) != 0)
161 {
162 int num = 0;
163 do
164 {
165 if (((uint)_stateFlags & (uint)(8 << num)) != 0)
166 {
167 graphicsDevice.SamplerStates.ClearState(num);
168 }
169 num++;
170 }
171 while (num < 16);
172 }
173 if ((_stateFlags & EffectStateFlags.AllVertexSamplers) == 0)
174 {
175 return;
176 }
177 int num2 = 0;
178 do
179 {
180 if (((uint)_stateFlags & (uint)(524288 << num2)) != 0)
181 {
182 graphicsDevice.VertexSamplerStates.ClearState(num2);
183 }
184 num2++;
185 }
186 while (num2 < 4);
187 }

References Microsoft.Xna.Framework.Graphics.EffectTechnique._parent, Microsoft.Xna.Framework.Graphics.EffectPass._stateFlags, Microsoft.Xna.Framework.Graphics.EffectPass._technique, Microsoft.Xna.Framework.Graphics.GraphicsDevice.ClearBlendState(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.ClearDepthStencilState(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.ClearRasterizerState(), Microsoft.Xna.Framework.Graphics.SamplerStateCollection.ClearState(), Microsoft.Xna.Framework.FrameworkResources.DeviceCannotBeNullOnResourceCreate, Microsoft.Xna.Framework.Graphics.GraphicsResource.GraphicsDevice, Microsoft.Xna.Framework.Graphics.GraphicsDevice.SamplerStates, and Microsoft.Xna.Framework.Graphics.GraphicsDevice.VertexSamplerStates.

Referenced by Microsoft.Xna.Framework.Graphics.EffectPass.Apply().