<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>stephan mantler &#187; Post Tags &#187; programming</title>
	<atom:link href="http://www.stephanmantler.com/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stephanmantler.com/blog</link>
	<description>stephan mantler: photography, sports, computer graphics.</description>
	<lastBuildDate>Fri, 20 Aug 2010 06:49:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>More on the shader</title>
		<link>http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/</link>
		<comments>http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/#comments</comments>
		<pubDate>Tue, 29 Nov 2005 12:32:06 +0000</pubDate>
		<dc:creator>stephan mantler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[computer graphics]]></category>
		<category><![CDATA[crashes]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shaders]]></category>

		<guid isPermaLink="false">http://www.stephanmantler.com/wordpress/?p=557</guid>
		<description><![CDATA[I&#8217;ve just taken a look at the FX Shader Compiler&#8217;s output for the broken shader, and what changes when I comment a few lines so that it doesn&#8217;t crash my machine any more&#8230; and figured out what the problem is. Here&#8217;s a fairly minimal shader that crashes my machine: PixelShader = asm { ps_3_0 defi [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just taken a look at the FX Shader Compiler&#8217;s output for the broken shader, and what changes when I comment a few lines so that it doesn&#8217;t crash my machine any more&#8230; and figured out what the problem is.</p>
<p>Here&#8217;s a fairly minimal shader that crashes my machine:<br />
<code>		PixelShader  = asm<br />
		{<br />
			ps_3_0<br />
			defi i0, 100,0,0,0<br />
			def c0, 0.01, 0.5, 0, 0<br />
			mov r0, c0.zzzz<br />
			rep i0<br />
				add r0.x, r0.x, c0.x<br />
				if_ge r0.x, c0.y<br />
 					add r0.y, r0.y, c0.x<br />
					break<br />
				endif<br />
			endrep<br />
			mov oC0, r0<br />
		};</code></p>
<p><lang_de>Und hier ist einer, der funktioniert:</lang_de><br />
<lang_en>And here is one that works:</lang_en><br />
<code>		PixelShader  = asm<br />
		{<br />
			ps_3_0<br />
			defi i0, 100,0,0,0<br />
			def c0, 0.01, 0.5, 0, 0<br />
			mov r0, c0.zzzz<br />
			rep i0<br />
				add r0.x, r0.x, c0.x<br />
				if_ge r0.x, c0.y<br />
 					add r0.y, r0.y, c0.x<br />
				endif<br />
			endrep<br />
			mov oC0, r0<br />
		};</code></p>
<p>So, <code>break</code> is broken (sic!) if used inside an if construct.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/&amp;n=More+on+the+shader&amp;pli=1" rel="nofollow" class="external" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/&amp;title=More+on+the+shader" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/&amp;t=More+on+the+shader" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.google.com/reader/link?url=http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/&amp;title=More+on+the+shader&amp;srcUrl=http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/&amp;srcTitle=More+on+the+shader&amp;snippet=I%27ve%20just%20taken%20a%20look%20at%20the%20FX%20Shader%20Compiler%27s%20output%20for%20the%20broken%20shader%2C%20and%20what%20changes%20when%20I%20comment%20a%20few%20lines%20so%20that%20it%20doesn%27t%20crash%20my%20machine%20any%20more...%20and%20figured%20out%20what%20the%20problem%20is.%0D%0A%0D%0AHere%27s%20a%20fairly%20minimal%20shader%20that%20crashes%20my%20machine%3A%0D%0A%09%09PixelShader%20%20%3D%20asm%0D%0A%09%09%7B%0D%0A%09%09%09" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/&amp;title=More+on+the+shader" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.stephanmantler.com%2Fblog%2F2005%2F11%2F29%2Fmore-on-the-shader%2F&amp;t=More+on+the+shader" rel="nofollow" class="external" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=More+on+the+shader+-+http://bit.ly/ccgfuy&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.stephanmantler.com/blog/2005/11/29/more-on-the-shader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
