Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Jul 2006
Offline Last Active Private

Posts I've Made

In Topic: DX9 Doubling Memory Usage in x64

25 May 2016 - 05:11 PM

I can guess at one possibility. Some time ago Microsoft optimized the address space usage of D3D9 on Vista - see https://support.microsoft.com/en-gb/kb/940105 It's possible that that optimization was only applied to x86 as you're not going to run out of address space on x64.


Is this extra memory usage actually causing a significant, measurable performance issue? If not I wouldn't worry about it.


If you really want to investigate what's going on, I'd suggest creating the simplest possible test program that shows the memory usage difference, and using a tool like https://technet.microsoft.com/en-us/sysinternals/vmmap.aspx to investigate how memory gets allocated differently.

In Topic: Downsampling texture size importance

16 April 2016 - 07:21 PM

To render to part of a render target, what you usually want to do is to adjust the viewport. This allows you to render anything you want - it will handle the scaling and clipping for you.


The only downside is that when sampling from the render target, you can't clamp or wrap at the edge of the viewport, so it's easy to read outside of the viewport that you wrote to.

In Topic: 'External Code' taking up most of my CPU?

14 April 2016 - 05:55 PM

Instructions to show you what's in the external code section: http://stackoverflow.com/questions/33482789/external-code-in-vs2015-profiler


When you have the diagnostic view up, look for a dropdown that says "Filter View". It's in the area below the graph but above the listview. Click the dropdown and check the "Show External Code" checkbox.


Also see https://msdn.microsoft.com/en-us/library/dn971856.aspx

In Topic: D3D alternative for OpenGL gl_BaseInstanceARB

09 April 2016 - 05:31 AM

The standard technique to draw multiple copies of the same thing in D3D is called instancing.


There's a decent explanation of how to do that in D3D9 at: https://msdn.microsoft.com/en-us/library/windows/desktop/bb173349%28v=vs.85%29.aspx


You can do the same thing in D3D11, but the API is a bit different. There's some example code at: http://www.rastertek.com/dx11tut37.html

In Topic: Need help understanding line in code snippet for linked list queue please.

28 March 2016 - 05:49 PM

That code appears to be formatted for fitting in limited vertical space for printing - that is it's deliberately making the code less readable to make it fit on one page. It's also using three xors to swap two variables, instead of using std::swap(), which is much more readable (and probably faster too).


The line of code in question would be easier to read if it was split up into two or three separate statements:

int operandCount = (n/2) - 1;
if ( count > operandCount )

I think the reasoning behind the test is that when there's only binary operators available, there will always be a known ratio of operators to operands, and that is testing for it. It's not a very nice way to detect the end of the expression though.


That is:

- With an input of length 3, you must have one operator and two operands.

- Input of length 4 is invalid.

- Input of length 5 will always have two operators.

- etc.