Forums - Adreno Profiler with Windows Phone 8 App(XAML + Direct3D)

6 posts / 0 new
Last post
Adreno Profiler with Windows Phone 8 App(XAML + Direct3D)
70780533@163.com
Join Date: 24 Mar 12
Posts: 3
Posted: Tue, 2013-05-28 20:04

Hello,

I am trying to profile my game on lumia 920 using Adreno Profiler 3.3,  but I have no place to Call "APSet()" or "APSetup()".

The detail is below:

The document said 

#Add "APSet()" before the function call CreateDXGIFactory1().

#If your project does not have the CreateDXGIFactory1() api call, add "APSetup()" before the function call D3D11CreateDevice().

If the Direct3D App is native only, that is OK. but if the App is XAML+Direct3D, then  there is no function call "CreateDXGIFactory1()" or "D3D11CreateDevice()",  therefore no place to call  "APSet()" or "APSetup()". Is there any method to resolve this?

Thanks.

  • Up0
  • Down0
sraut
Join Date: 3 Apr 13
Posts: 11
Posted: Wed, 2013-05-29 12:12

Hi,

Correct me If I'm wrong, but from what I understand, even if your app uses XAML Direct3D interop objects, there would be a windows runtime rendering object that calls CreateDevice(). To verify, I looked at a couple of sample apps from MSDN that use XAML and both seem to call CreateDevice().

It would be helpful if you could please tell us more about your setup.

Do you have a renderer class in your code that manages the Direct3D objects like window, device, context?

What XAML Direct3D interop interfaces is your app using? For example, if the app is using a SurfaceImageSource object, you would have a call to SetDevice(), to associate SurfaceImageSource to a DXGIDevice object(derived from D3DDevice).

Thanks.

  • Up0
  • Down0
70780533@163.com
Join Date: 24 Mar 12
Posts: 3
Posted: Thu, 2013-05-30 03:57

Hi sraut,

First, thanks for your reply.  But I still can not find the place to call "APSet()" or "APSetup()".

My game is similar to this demo http://code.msdn.microsoft.com/wpapps/Direct3D-with-XAML-Marble-1d51a37b, could you take this demo  for example, show where to call function "APSet()" or "APSetup()".

Thank you very much.

  • Up0
  • Down0
sraut
Join Date: 3 Apr 13
Posts: 11
Posted: Thu, 2013-05-30 13:07

Hi,

I looked into the project you mentioned and it seems that the Direct3DContentProviderBase::CreateDeviceResources() calls D3D11CreateDevice().

I couldn't get the phone emulator working on my PC to actually set a breakpoint at CreateDeviceResources() and see if it hits, but I bet it will hit. Here's why:

In, MainPage.xaml.cs, when the Direct3DInterop object's constructor is called, it inturn calls the MarbleMaze object's Initialize() function which calls DirectXBase::Initialize().

If your app's code is based on the something similar, you should have a similar code flow. Hope this helps.

Thanks.

 

 

 

  • Up0
  • Down0
70780533@163.com
Join Date: 24 Mar 12
Posts: 3
Posted: Thu, 2013-05-30 23:26

Hi sraut,

I runed that project on Lumia 920, sadly the function D3D11CreateDevice() does not be called.

I looked up the code, here is the reason:

D3D11CreateDevice()  located in Direct3DContentProviderBase::CreateDeviceResources(), and CreateDeviceResources is called by Direct3DContentProviderBase::Initialize(), but Initialize does not be called. And DirectXBase::Initialize() is an empty function. ID3D11Device1, ID3D11DeviceContext1 and ID3D11RenderTargetView were passed in from C#.

So, is there any method can resolve this?

thank you very much.

  • Up0
  • Down0
sraut
Join Date: 3 Apr 13
Posts: 11
Posted: Fri, 2013-05-31 12:08

Hi,

So, I'm not sure what the design implications are for having DirectXBase, Direct3DContentProviderBase and D3DContentProvider.

Also, one thing to note is DirectXBase is an abstract class and MarbleMaze class that derives from itoverrides Initialize and CreateDeviceResources functions.

My suggestion would be to either derive MarbleMaze class from Direct3DContentProviderBase instead of DirectXBase or move class members from Direct3DContentProviderBase to DirectXBase.

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.