<?xml version="1.0" encoding="iso-8859-1"?>
	<rss version="2.0" 
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		xmlns:admin="http://webns.net/mvcb/"
		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
		xmlns:content="http://purl.org/rss/1.0/modules/content/">

	<channel>
		<title>VirtualBlog</title>
		<link>http://virtualdub.org/blog/index.php</link>
		<description>Life as the author of VirtualDub</description>
		<dc:language>en-us</dc:language>
		<dc:creator></dc:creator>
		<dc:rights>Copyright 2008</dc:rights>
		<dc:date>2008-11-07T00:39:13-05:00</dc:date>
		<admin:generatorAgent rdf:resource="http://www.pivotlog.net/?ver=Pivot+-+1.15%3A+%27Soundwave%27" />
		<admin:errorReportsTo rdf:resource="mailto:rsserrors@pivotlog.net"/>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
		<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
	<item>
		<title>VS2010 CTP, first impressions</title>
		<link>http://virtualdub.org/blog/pivot/entry.php?id=232</link>
		<comments>http://virtualdub.org/blog/pivot/entry.php?id=232#comm</comments>
		<description>I downloaded and tried out the Visual Studio 2010 CTP a couple of days ago. My experience from the VS2005 and VS2008 betas is that there's a narrow window in time where you can actually get anything fixed, since the CTPs are already released so late in the cycle and a project like Visual Studio has a ton of inertia. The new mantra for VS2010 is apparently &quot;10 is the new 6,&quot; which is a reference to the fact that a lot of people still consider Visual C++ 6.0 to be superior to the subsequent releases, including me.
How is it, then?
VS2010 CTP comes as a rather large virtual hard drive (VHD) for Virtual PC 2007 SP1, approximately 26GB. This is because it includes a full Windows Server 2008 evaluation installation as well as a full VS2010 Team Edition CTP install. I ran it on a laptop with 2GB of memory and gave&amp;nbsp;the VM&amp;nbsp;1GB, which I thought would be sufficient just to try it out. Oh no. The VM absolutely crawled, even before I launched VS2010. I ended up having to disable a bunch of unnecessary services, most notably SQL Server, just to stop the swap death. That got the memory usage of the system down by about 200-300MB, which helped things considerably. It's safe to say, though, that any performance conclusions drawn from this CTP should be taken with a grain of salt... or perhaps a salt lick.</description>
		<guid isPermaLink="false">232@http://virtualdub.org/blog/</guid>
		<content:encoded><![CDATA[ <p>I downloaded and tried out the Visual Studio 2010 CTP a couple of days ago. My experience from the VS2005 and VS2008 betas is that there's a narrow window in time where you can actually get anything fixed, since the CTPs are already released so late in the cycle and a project like Visual Studio has a ton of inertia. The new mantra for VS2010 is apparently "10 is the new 6," which is a reference to the fact that a lot of people still consider Visual C++ 6.0 to be superior to the subsequent releases, including me.</p>
<p>How is it, then?</p>
<p>VS2010 CTP comes as a rather large virtual hard drive (VHD) for Virtual PC 2007 SP1, approximately 26GB. This is because it includes a full Windows Server 2008 evaluation installation as well as a full VS2010 Team Edition CTP install. I ran it on a laptop with 2GB of memory and gave the VM 1GB, which I thought would be sufficient just to try it out. Oh no. The VM absolutely <em>crawled</em>, even before I launched VS2010. I ended up having to disable a bunch of unnecessary services, most notably SQL Server, just to stop the swap death. That got the memory usage of the system down by about 200-300MB, which helped things considerably. It's safe to say, though, that any performance conclusions drawn from this CTP should be taken with a grain of salt... or perhaps a salt lick.</p><p>Once I launched VS2010, I landed in fairly familiar territory. VS2010... looks just like VS2005/08. In fact, the only visual difference I noticed in my admittedly spartan use of the IDE was the fancy gradients now used for selected text. After my initial gagging at the VS2005 interface, I've learned not to worry too much about visual changes unless they look like usability or performance nightmares. What bothers me, though, is the inconsistency. For some reason, in VS2008, the menus were changed from a reasonable looking translucent highlight to a garish flat dark blue rounded rect that looks like someone broke the drawing code. This clashes with the new editor, which it looks like all of the visual components are drawn with different toolkits, which I guess they probably are. Personally, I'd like a little more emphasis on consistency and usability, and a little less on just trying to make things look different.</p>
<p>As you might expect, my main test was to build VirtualDub 1.8.6. Well, already I could see that Intellisense is still a problem. It took a couple of minutes to run over the code base, during which of course it slowed things down and didn't have a readily available disable function. I then located a member function called init() and selected Go To Declaration... upon which it brought up a list of about five dozen random unrelated init() functions throughout my app, like VS2005 often does. Also, I don't know if it's Intellisense or not, but there's a weird performance problem where VS2010 intermittently takes 100% CPU for several seconds at a time. I know the VC++ team has put a lot of work into the new Intellisense... but I'm sad to say that, at least from my perspective, it acts a lot like the old Intellisense.</p>
<p>I have to say some good things about VS2010, though, and IMO, there are two big firsts in this version. First, the VC++ project format seems to be unchanged -- yes, for the first time in a long time, VC++ isn't using a new and incompatible project format, still keeping version 9.0 instead. Second, with only a minor Platform SDK incompatibility that also affects VS2008, VirtualDub 1.8.6 builds out of the box on the VS2010 CTP. There didn't seem to be any breaking compiler changes, or for that matter, any "helpful" settings changes during the project conversion that I had to undo. This went as smoothly as it did partly because I already migrated from MASM to YASM and am thus insulated from the MASM-regression-of-the-release, but I still think that if your code is already ported to VS2005 or VS2008, you can likely expect far fewer porting headaches than what we saw in the VC6 to VS2005 time frame.</p>
<p>There are a bunch of exciting features in this CTP which I haven't dug into yet, such as the ability to use downlevel compilers and several C++0x features (most notably "var"). From what I've seen so far, VS2010 already looks to be a better value upgrade than VS2008 was, which barely had any new features at all for C++ programmers. I hope to get some more time to dig into the new toys. I haven't dug into any of the new C# features yet as I don't do a whole lot of C#, but for those of you that do I'm sure there are a ton of goodies there, too.</p>
<p>So... is 10 really the new 6? Well, with apologies to Yahtzee....</p>
<p>NOOOOOOOOOOOOOOO oooooooooooooooooo oooooooooooooooooo ooooooooooooooooooooo oooooooooooooo oooooooooooooo oooooooooooooo oooooooooooooooo oooooooooooooooooo ooooo.</p>
<p>There's definitely a rose colored glasses effect with regard to VC6 nostalgia. Several months ago I backported one of the 1.8.x releases of VirtualDub to VC6, and there were definitely some parts of VC6 that sucked, chief of which was the compiler. The VC6 compiler was <em>awful</em> compared to newer versions -- about half of the template code you tried to write was either miscompiled or didn't compile, and the lack of correct for scoping sucked. The STL was also in just as bad a shape, with terrible hacks like _Charalloc(), and if you made any mistakes the compiler spewed more word-wrapped angle brackets than a reply email from Microsoft Outlook. Intellisense, for all its warts in VS2005, is in much worse shape in VC6, with half the features not working at all unless you generate browse information, and major omissions like no autocomplete for enums. And let's not forget the non-resizable dialogs with teeny edit boxes. And the debugger that leaked astounding amounts of memory if you hooked up system symbols. And so on.</p>
<p>What were the good parts of VC6, then? Well, the main difference is that the IDE was <em>fast</em>. And it took less memory. And it didn't have long random pauses in the <em>seconds</em> to <em>minutes</em> range that started with VS2002 and still continue through VS2008. And its resource editor didn't use goofy property grids with properties in random order and with combo boxes for boolean parameters. And its project system was smart enough to realize that if a static library fails to build that it's useless to try linking it into an .exe. And so on. And I'm sorry to say that VS2010 just doesn't cut it just yet to be called the New 6. The UI is still miles away, and although it's very hard to gauge the performance through a VM with unaccelerated video, it still doesn't feel as snappy. Even though I've used VC6 for years, the last time I fired it up, I was still wowed by how fast it runs on modern hardware. I just don't have that feeling with VS2010, nor do I feel like the feature set is improved up to make up for the performance delta.</p>
<p>I know that the VS2010 team has made a lot of improvements internally to improve performance, but I guess what I'm trying to say is: this still ain't VC6. I will say that I don't think VS2010 has to attain the split-second speed of VC6's UI in order to be a substantial improvement, but all of the long delays and background churn have got to go, and the UI team still needs to tighten up the interface. I do think that VS2010 has a decent chance to be a significant improvement over VS2008, but "10 is the new 6"? No, sorry. There's still a long way to go.</p> ]]></content:encoded>
		<dc:subject>default</dc:subject>
		<dc:date>2008-11-04T00:03:00-05:00</dc:date>
    </item>

	<item>
		<title>A shader compiler for VirtualDub, part 3</title>
		<link>http://virtualdub.org/blog/pivot/entry.php?id=231</link>
		<comments>http://virtualdub.org/blog/pivot/entry.php?id=231#comm</comments>
		<description>Okay, back to something VirtualDub related. :)
I went ahead and did some more work on the vdshader filter, and thus I present version 1.2:
http://www.virtualdub.org/downloads/vdshader-1.2.ziphttp://www.virtualdub.org/downloads/vdshader-1.2-src.zip
This version has two major enhancements:

The compiler now understands annotations, and I ported over the UI code from my GPU filter, so you can now add tunable parameters to your .fx file and the filter will automatically create UI for it.
The filter now scans for an FXFilters subdirectory on startup and creates new video filter entries for each .fx file that it finds.
The combined effect of these two changes is that you can now make new VirtualDub filters entirely in vdshader, without writing any C++ code. The individual .fx files show up in the VirtualDub filter list, have their own config dialog, work in batch mode, and can be used just like any other VirtualDub filter written as a regular DLL.
Now, the performance of such a video&amp;nbsp;filter won't be quite as good as a well-optimized C++/asm filter, but I've made some changes on that front, as well. First, vdshader now has an SSE2 JIT which transforms shaders into SoA form and does register allocations,&amp;nbsp;thus running shaders&amp;nbsp;much faster than the scalar x87 JIT. Second, the optimizer has been beefed up substantially and performs more optimizations, such as:

constant folding
unused interpolator elimination
loop invariant hoisting
As an example, in the expression tex2D(src, float2(uv.x, pos*4-1)), the optimizer will identify that (pos*4-1) is an invariant, and hoist both it and the texture V axis clamp/wrap checks out of the loop. These optimizations are particularly useful for tunable parameters, where you can perform complex preconditioning on the parameters and the optimizer will ensure that the calculations are done only once&amp;nbsp;before entering the pixel loop.
There are several other improvements:

Several bugs in the text editor have been fixed and&amp;nbsp;the syntax highlighting has been expanded.
Sampler states are now supported, so you can switch between point/bilinear filtering and wrapping or clamping on each axis. The default is bilinear for compatibility reasons, but point is faster.
The compiler now understands many more intrinsics, including asin(), acos(), atan(), reflect(), saturate(). Several of the existing intrinsics have also been expanded to support vectors.
The shader IL now supports the _sat prefix for saturation to 0-1. I think that's the last PS2.0 feature that was missing, and in theory the engine should now be able to support hoisting D3D PS2.0&amp;nbsp;bytecode to vdshader IL.
Constant registers c0 and c1 are now auto-bound to float4(width, height, counter, clock) and float4(1/width, 1/height, 0, 0) if they are not otherwise used, and sampler s0 is similarly auto-bound to the source.
A rudimentary preprocessor has been added that understands parameterless #defines.
VDShader can now run all of the stock Media Player Classic pixel shaders without modification.
Example of a custom shader after the jump.</description>
		<guid isPermaLink="false">231@http://virtualdub.org/blog/</guid>
		<content:encoded><![CDATA[ <p>Okay, back to something VirtualDub related. :)</p>
<p>I went ahead and did some more work on the vdshader filter, and thus I present version 1.2:</p>
<p><a href="http://www.virtualdub.org/downloads/vdshader-1.2.zip">http://www.virtualdub.org/downloads/vdshader-1.2.zip</a><br  /><a href="http://www.virtualdub.org/downloads/vdshader-1.2-src.zip">http://www.virtualdub.org/downloads/vdshader-1.2-src.zip</a></p>
<p>This version has two major enhancements:</p>
<ul>
<li>The compiler now understands annotations, and I ported over the UI code from my GPU filter, so you can now add tunable parameters to your .fx file and the filter will automatically create UI for it.</li>
<li>The filter now scans for an FXFilters subdirectory on startup and creates new video filter entries for each .fx file that it finds.</li></ul>
<p>The combined effect of these two changes is that you can now make new VirtualDub filters entirely in vdshader, without writing any C++ code. The individual .fx files show up in the VirtualDub filter list, have their own config dialog, work in batch mode, and can be used just like any other VirtualDub filter written as a regular DLL.</p>
<p>Now, the performance of such a video filter won't be quite as good as a well-optimized C++/asm filter, but I've made some changes on that front, as well. First, vdshader now has an SSE2 JIT which transforms shaders into SoA form and does register allocations, thus running shaders much faster than the scalar x87 JIT. Second, the optimizer has been beefed up substantially and performs more optimizations, such as:</p>
<ul>
<li>constant folding</li>
<li>unused interpolator elimination</li>
<li>loop invariant hoisting</li></ul>
<p>As an example, in the expression tex2D(src, float2(uv.x, pos*4-1)), the optimizer will identify that (pos*4-1) is an invariant, and hoist both it and the texture V axis clamp/wrap checks out of the loop. These optimizations are particularly useful for tunable parameters, where you can perform complex preconditioning on the parameters and the optimizer will ensure that the calculations are done only once before entering the pixel loop.</p>
<p>There are several other improvements:</p>
<ul>
<li>Several bugs in the text editor have been fixed and the syntax highlighting has been expanded.</li>
<li>Sampler states are now supported, so you can switch between point/bilinear filtering and wrapping or clamping on each axis. The default is bilinear for compatibility reasons, but point is faster.</li>
<li>The compiler now understands many more intrinsics, including asin(), acos(), atan(), reflect(), saturate(). Several of the existing intrinsics have also been expanded to support vectors.</li>
<li>The shader IL now supports the _sat prefix for saturation to 0-1. I think that's the last PS2.0 feature that was missing, and in theory the engine should now be able to support hoisting D3D PS2.0 bytecode to vdshader IL.</li>
<li>Constant registers c0 and c1 are now auto-bound to float4(width, height, counter, clock) and float4(1/width, 1/height, 0, 0) if they are not otherwise used, and sampler s0 is similarly auto-bound to the source.</li>
<li>A rudimentary preprocessor has been added that understands parameterless #defines.</li>
<li>VDShader can now run all of the stock Media Player Classic pixel shaders without modification.</li></ul>
<p>Example of a custom shader after the jump.</p><p>We'll use this file as an example:</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px"><pre>// Name: RGB Scale<br  />// Author: Avery Lee<br  />// Description: Scales individual RGB channels.</pre><pre>float red &lt;<br  /> bool vd_tunable = true;<br  /> float vd_tunablemin = 0;<br  /> float vd_tunablemax = 2;<br  /> float vd_tunablesteps = 200;<br  />&gt; = 1;</pre><pre>float green &lt;<br  /> bool vd_tunable = true;<br  /> float vd_tunablemin = 0;<br  /> float vd_tunablemax = 2;<br  /> float vd_tunablesteps = 200;<br  />&gt; = 1;</pre><pre>float blue &lt;<br  /> bool vd_tunable = true;<br  /> float vd_tunablemin = 0;<br  /> float vd_tunablemax = 2;<br  /> float vd_tunablesteps = 200;<br  />&gt; = 1;</pre><pre>extern sampler src : register(s0);</pre><pre>float4 main(float2 uv : TEXCOORD0) : COLOR0 {<br  /> return tex2D(src, uv) * float4(red, green, blue, 0);<br  />}<br  /></pre></blockquote>
<p>With vdshader.vdf in the plugins or plugins32 subdirectory under VirtualDub.exe, and with this file saved as FXFilters\test.fx underneath that, this filter will then show up in the filter list:</p>
<p style="text-align:center;"><img src="http://virtualdub.org/blog/images/customfilterfs8.png" border="0" title="[Video filter dialog with RGB Scale (VDFX)]" alt="[Video filter dialog with RGB Scale (VDFX)]" /></p>
<p>Add this filter to the list and hit Configure, and vdshader automatically creates a configuration dialog based on the tunable parameters:</p>
<p style="text-align:center;"><img src="http://virtualdub.org/blog/images/customfilter2fs8.png" border="0" title="[Filter configuration dialog]" alt="[Filter configuration dialog]" /></p>
<p>The configuration dialog exposes each tunable float parameter as a slider, and supports live preview functionality as well. (As I write this, I notice that I forgot to add code to change the dialog caption from "Dialog." Whoops.)</p>
<p>And finally, choosing the base vdshader filter brings up the IDE as usual, where you can interactively edit shader .fx files.</p>
<p style="text-align:center;"><img src="http://virtualdub.org/blog/images/customfilter3fs8.png" border="0" title="[VirtualDub shader editor]" alt="[VirtualDub shader editor]" /></p> ]]></content:encoded>
		<dc:subject>default</dc:subject>
		<dc:date>2008-11-02T15:17:00-05:00</dc:date>
    </item>

</channel>
</rss>