Jump to content

  • Log In with Google      Sign In   
  • Create Account


brasslips2

Member Since 27 Sep 2008
Offline Last Active May 26 2013 07:04 PM

Topics I've Started

[DX 11] object names for debugging & warnings using Effects

06 August 2011 - 06:28 PM

When I call release on my effects object like the following:

ID3DX11Effect *effect;
hr = D3DX11CreateEffectFromMemory(effectBlob->GetBufferPointer(),
effectBlob->GetBufferSize(), 0,
pDevice, &effect);
...
effect->Release()
------------------

I get the following output after I step over the release of the effect shown above


D3D11: INFO: Destroy Buffer: Name="unnamed", Addr=0x0049F67C [ STATE_CREATION INFO #2097230: DESTROY_BUFFER ]
D3D11: INFO: Destroy VertexShader: Name="unnamed", Addr=0x0049F8DC [ STATE_CREATION INFO #2097251: DESTROY_VERTEXSHADER ]
D3D11: INFO: Destroy PixelShader: Name="unnamed", Addr=0x0049C23C [ STATE_CREATION INFO #2097263: DESTROY_PIXELSHADER ]

I know I'm supposed to call the following...

DXUT_SetDebugName(object, "object name");

I have also created my device with the correct debug flag as such:

D3D11_CREATE_DEVICE_DEBUG;

However, since I'm using effects what object do i pass into my SetDebugName function to fix the above "unnamed" values and how do I get that object from the effect?

PIX Error on experiment startup

15 June 2011 - 02:36 AM

So, this is weird. When i run my program normally from visual studio it runs perfectly fine and the CreateDeviceAndSwapChain return S_OK. However, if I start my executable through PIX I get the following error:

PIX Logfile created at: 1:08:48 AM

Frame 000001 ....PRE: Frame(1)
Trigger 'Frame 1' fired
Frame 000001 ........PRE: D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8)
D3D11: ERROR: ID3D11Device::CreateTexture2D: The Dimensions are invalid. For feature level D3D_FEATURE_LEVEL_10_0, the Width (value = -842150451) must be between 1 and 8192, inclusively. The Height (value = -842150451) must be between 1 and 8192, inclusively. And, the ArraySize (value = 1) must be between 1 and 512, inclusively. [ STATE_CREATION ERROR #101: CREATETEXTURE2D_INVALIDDIMENSIONS ]
D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN ]
Frame 000001 ........POST: <E_INVALIDARG> D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8)
Frame 000001 ........PRE: D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_WARP, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8)
D3D11: ERROR: ID3D11Device::CreateTexture2D: The Dimensions are invalid. For feature level D3D_FEATURE_LEVEL_10_1, the Width (value = -842150451) must be between 1 and 8192, inclusively. The Height (value = -842150451) must be between 1 and 8192, inclusively. And, the ArraySize (value = 1) must be between 1 and 512, inclusively. [ STATE_CREATION ERROR #101: CREATETEXTURE2D_INVALIDDIMENSIONS ]
D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN ]
Frame 000001 ........POST: <E_INVALIDARG> D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_WARP, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8)
Frame 000001 ........PRE: D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8)
D3D11: ERROR: ID3D11Device::CreateTexture2D: The Dimensions are invalid. For feature level D3D_FEATURE_LEVEL_11_0, the Width (value = -842150451) must be between 1 and 16384, inclusively. The Height (value = -842150451) must be between 1 and 16384, inclusively. And, the ArraySize (value = 1) must be between 1 and 2048, inclusively. [ STATE_CREATION ERROR #101: CREATETEXTURE2D_INVALIDDIMENSIONS ]
D3D11: ERROR: ID3D11Device::CreateTexture2D: Returning E_INVALIDARG, meaning invalid parameters were passed. [ STATE_CREATION ERROR #104: CREATETEXTURE2D_INVALIDARG_RETURN ]
Frame 000001 ........POST: <E_INVALIDARG> D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 2, 0x0042F864, 3, 7, 0x0042F814, 0x03B280D8, 0x03B280D4, 0x03B280E0, 0x03B280E8)
An unhandled exception occurred.
Closing Run File

Any ideas?

DX11 - Shader Reflection - Finding Technique Name

14 June 2011 - 11:25 PM

I'm using the effects system...
As the title says, is there any way to get the name of the technique using something similar to shader reflection? I'm trying to find the name of my shader so I can create a mapping between its name and the D3D11_INPUT_ELEMENT_DESC*


technique11 SuperUberBloomShader ( I want this name )
{
pass P0
{
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetGeometryShader( NULL );
SetPixelShader( CompileShader( ps_4_0, PS() ) );
}
...
}

Thanks!

[DX11] Matching input layout with vertex shader

14 September 2010 - 11:37 AM

Hi all,

I'm trying to figure out a way that isn't hardcoded in which I can match my input layout and my VS. Basically I want to be able to drop in a shader file and do as small amount of work as possible to hook everything up. What would be a good way to go about doing this? I somewhat new to DX but the only thing I can think of is to create a variable in the VS that has the identifier for the appropriate layout to be used with it. This seems like it's not the best solution so I'm all ears. Some example and psuedocode below...

- layout data
<?xml version="1.0" encoding="utf-8"?>
<ShaderManager>
<InputLayout name="PosColor">
<InputElement name="Position" index="0" format="6" slot="0" offset="0" class="0" stepRate="0"/>
<InputElement name="Color" index="0" format="2" slot="0" offset="12" class="0" stepRate="0"/>
</InputLayout>
</ShaderManager>

- *.fx file
string inputLayoutToBeUsed = "PosColor"
...

----------------

//loop through all .fx files in folder
// compile fx file
// create the effect from memory
// get the inputLayoutToBeUsed using GetVariableByName
// call CreateInputLayout using inputLayoutToBeUsed (in this case PosColor)
//

Deploying .exe

30 August 2010 - 01:39 PM

I'm trying to get my .exe to work on my friends computer. However, he keeps getting a side by side error. I'm running 64 windows 7 and he is running 64 vista. He does not have vs installed on his computer. I had him install the 64 and 32 versions of vcredist 2005 and 2008 and it did not fix the issue. The only libraries I'm linking to besides my own ones created in the project is directX 11. Please help!

PARTNERS