Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 29 Nov 2009
Offline Last Active Feb 21 2013 04:53 PM

Topics I've Started

Shared resources (eg textures) between devices/threads

08 February 2013 - 04:38 PM

In this Microsoft article it states that sharing of resources between different d3d devices is possible on Windows Vista. The description sounds straight forward, so I gave it a try on Windows 7, but only get an D3DERR_INVALIDCALL back, when I call CreateTexture()


pSharedHandle points to a HANDLE that is 0.


D3D debug dumps the following:


Direct3D9: (ERROR) :Device is not capable of sharing resource. CreateTexture fails.
Direct3D9: (ERROR) :Failure trying to create a texture


I am using an ordinary Direct3D 9 device, not Direct3D 9Ex. But according to the docs it should work with both. I am using a Radeon 57xx, and the drivers are pretty recent. According to the docs, WDDM drivers are a requirement. Since mine are a couple of months old, I believe they should be (this is the year 2013...).


Obviously one question comes to mind: is this a Vista only feature?? Maybe they kicked it out with Win7 again?


So my question is, does anyone successfully use the pSharedHandle parameter?

C++ SIMD/SSE optimization

30 January 2012 - 02:42 PM


I would like to optimize a short piece of C++ code using SIMD SSE2 or SSE3 insructions. Could someone get me up to speed, or ideally (if anyone would be so kind) provide the converted code?

The function I need optimized simply reads from a graphics-frame in ARGB format to another frame that is supposed to be in aAAA format (where the actual "a" part is set to 0xff).

unsigned int* f = (unsigned int*)frame;
unsigned int* k = (unsigned int*)alphaKey;

for (unsigned i = mFrameHeight*mFrameWidth; i != 0; i--)
	unsigned int a = *f++;
	a &= 0xff000000;
	unsigned int v = (a >> 8) | (a >> 16) | (a >> 24) | 0xff000000;
	*k++ = v;

Seamless transition between 2D and 3D (Aero Flip)

02 December 2009 - 11:36 AM

I am using a orthogonal projection matrix to set up drawing 2d quads in screen space. Now I want these quads to "tilt" away in a 3-dimensional fashion, and I am struggling with getting a smooth and spotless transition from 2D to 3D. Initially I tried to set up a 3D projection-matrix with a suitable camera position and switch between that and the 2D orthogonal projection as soon as I want my 2D quad to "tilt away". But that is never precise, and I need to work with weird camera offset positions that I am sure only work with the current screen resolution. So there must be a better approach. I started working with transformed vertices, and doing the transformation and projection myself, but don't achieve satisfying results with that yet either. The Desktop Window Manager (starting with Vista) does that all the time: all the windows are properly displayed without any "texture blurring", and it seamlessly transitions between 2D and 3D effects (a perfect exampled is Aero Flip). How do they do that? [Edited by - ori-on on December 2, 2009 5:59:01 PM]