<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Direct3D</title><link>http://forums.xna.com/forums/27.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: AccessViolationException when trying to vary Pixelshader in Techniques.</title><link>http://forums.xna.com/forums/thread/195242.aspx</link><pubDate>Wed, 01 Jul 2009 07:21:53 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:195242</guid><dc:creator>Gooni</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/195242.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=27&amp;PostID=195242</wfw:commentRss><description>hi legalize,&lt;br /&gt;
&lt;br /&gt;
thanks for your reply. I didn&amp;#39;t try logging the problem via connect.microsoft.com. I didn&amp;#39;t even know such a thing existed. For the moment, my problem is solved: I was able to split the shader up and with less code in it the problem vanished. However thanks for the advice, I will give it a try next time.&lt;br /&gt;
&lt;br /&gt;
Regards, Gooni.&lt;br /&gt;</description></item><item><title>Re: AccessViolationException when trying to vary Pixelshader in Techniques.</title><link>http://forums.xna.com/forums/thread/194547.aspx</link><pubDate>Mon, 29 Jun 2009 14:56:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:194547</guid><dc:creator>legalize</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/194547.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=27&amp;PostID=194547</wfw:commentRss><description>Sounds like it could be a problem with the ps_3_0 compiler for xbox.  Have you tried logging the problem through connect.microsoft.com for the xna game studio?</description></item><item><title>AccessViolationException when trying to vary Pixelshader in Techniques.</title><link>http://forums.xna.com/forums/thread/191241.aspx</link><pubDate>Thu, 18 Jun 2009 20:44:30 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:191241</guid><dc:creator>Gooni</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/191241.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=27&amp;PostID=191241</wfw:commentRss><description>I am using the file InstancedModel.fx from the instancing sample and I am trying to use different variations for differnet objects, so I am trying to add the choice of a pixelshader in the techniques:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="border:1px solid #7f9db9;overflow:auto;background-color:white;width:1000px;height:276px;font-family:courier new;font-size:11px;"&gt;
&lt;table cellspacing="0" cellpadding="0" style="border-width:0px;border-bottom:0px solid #eeeeee;margin:2px 0px;width:99%;border-collapse:collapse;background-color:#ffffff;"&gt;
    
    
        &lt;tr&gt;
            &lt;td&gt;&lt;span style="font-size:11px;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&lt;span style="font-size:11px;"&gt;&amp;nbsp;ShaderIndex&amp;nbsp;=&amp;nbsp;0;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;PixelShader&amp;nbsp;PSArray[2]&amp;nbsp;=&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;{&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compile&amp;nbsp;ps_3_0&amp;nbsp;PSOne(),&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;compile&amp;nbsp;ps_3_0&amp;nbsp;PSTwo(),&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;};&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;span style="color:green;"&gt;//&amp;nbsp;Xbox&amp;nbsp;instancing&amp;nbsp;technique.&lt;/span&gt;&lt;span style="font-size:11px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;technique&amp;nbsp;VFetchInstancing&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;{&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pass&amp;nbsp;Pass1&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;br /&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VertexShader&amp;nbsp;=&amp;nbsp;compile&amp;nbsp;vs_3_0&amp;nbsp;VFetchInstancingVertexShader();&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PixelShader&amp;nbsp;=&amp;nbsp;compile&amp;nbsp;ps_3_0 PSOne();&lt;span style="color:green;"&gt;//(PSArray[ShaderIndex]);&lt;/span&gt;&lt;span style="font-size:11px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;}&amp;nbsp;&lt;/td&gt;
        &lt;/tr&gt;
    
&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
You are looking at the version that is working fine. But as soon as I delete &amp;quot;compile...&amp;quot; and use the &lt;span style="color:green;"&gt;(PSArray[ShaderIndex]);&lt;/span&gt; which is now commented out, I get the following error:&lt;br /&gt;
&lt;br /&gt;
Building content threw AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at CompileEffectFromSourceForXBox(String effectSource, CompilerMacro[] preprocessorDefines, CompilerIncludeHandler includeHandler, CompilerOptions options)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Graphics.Effect.CompileEffectFromSource(String effectFileSource, CompilerMacro[] preprocessorDefines, CompilerIncludeHandler includeHandler, CompilerOptions options, TargetPlatform platform)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Content.Pipeline.Processors.EffectProcessor.Process(EffectContent input, ContentProcessorContext context)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2.Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process(Object input, ContentProcessorContext context)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()&lt;br /&gt;
&amp;nbsp;&amp;nbsp; at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, TimestampCache timestampCache, ITaskItem[] sourceAssets, String[]&amp;amp; outputContent, String[]&amp;amp; rebuiltContent, String[]&amp;amp; intermediates, Dictionary`2&amp;amp; dependencyTimestamps, KeyValuePair`2[]&amp;amp; warnings)&lt;br /&gt;
&lt;br /&gt;
The code should just work because I simply copied it from BasicEffect-sample?! Any help greatly appreciated...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EDIT: Exception occurs only when building for Xbox. On Windows everything works just fine...&lt;br /&gt;
&lt;br /&gt;</description></item></channel></rss>