Sign in to follow this  
qventura

D3DImage D3D10 && Multisampling

Recommended Posts

Hi everyone,

I'm trying to implement a renderengine using Direct3D 10 (SlimDX) and WPF.

I create my device and rendertargetview with the right MultiSample parameters ( 1,0 / 2,0 and 4,0 are working)

[code]

this.multiSamplingDescription = new SampleDescription(sampleCount, qualityLevel - 1); // 4,1

Texture2DDescription colordesc = new Texture2DDescription();
colordesc.BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource;
colordesc.Format = this.renderTargetViewFormat; // Format.B8G8R8A8_UNorm
colordesc.Width = width;
colordesc.Height = height;
colordesc.MipLevels = 1;
colordesc.SampleDescription = multiSamplingDescription;
colordesc.Usage = ResourceUsage.Default;
colordesc.OptionFlags = ResourceOptionFlags.Shared;
colordesc.CpuAccessFlags = CpuAccessFlags.None;
colordesc.ArraySize = 4;[/code]


Then I've got a problem while trying to create the shared texture for D3DImage ...

[code] this.Direct3D9Context = new Direct3DEx();
this.presentParams = new PresentParameters();
this.presentParams.Windowed = true;
this.presentParams.SwapEffect = SwapEffect.Discard;
this.presentParams.DeviceWindowHandle = GetDesktopWindow();
this.presentParams.PresentationInterval = PresentInterval.Immediate;
this.presentParams.Multisample = MultisampleType.None;
this.presentParams.MultisampleQuality = 0;

this.Device = new DeviceEx(this.Direct3D9Context, 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.HardwareVertexProcessing | CreateFlags.Multithreaded | CreateFlags.FpuPreserve, this.presentParams);

...



this.presentParams.Multisample = sampleCount; // = 4
this.presentParams.MultisampleQuality = 0;
this.Device.Reset(this.presentParams);

...

this.SharedTexture = new Texture(this.Device, texture.Description.Width, texture.Description.Height, 1, Usage.RenderTarget, format, Pool.Default, ref Handle);

// format = Format.A8R8G8B8
// Width = 1244 , same as colordesc
// height = 699, same as colordesc

[/code]

I'm missing something ?

Share this post


Link to post
Share on other sites
[color=#000000]


[url="http://msdn.microsoft.com/en-us/library/cc663104.aspx"]http://msdn.microsoft.com/en-us/library/cc663104.aspx[/url]

"Multisampling is allowed on [b]IDirect3DSurface9Ex[/b] surfaces only."

But this interface [b]IDirect3DSurface9Ex[/b] doesnt seem to exist ![/color]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this