creatInputLayout returns a NULL pointer

Started by
17 comments, last by theScore 10 years, 10 months ago

void D3D11Rendering::initD3DDevice()
{

	D3D_FEATURE_LEVEL  FeatureLevelsRequested = D3D_FEATURE_LEVEL_11_0;
	UINT               numLevelsRequested = 1;


	HRESULT hr = E_FAIL;
	D3D_FEATURE_LEVEL FeatureLevel;

	hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_DEBUG, NULL, 0,
		D3D11_SDK_VERSION, &swapChainDesc, &swapChain,  &deviceDX11, &FeatureLevel, &deviceContext );

	if(FAILED(hr))
	{
		return ;
	}
}

I guess it was it ?

Advertisement

It still doesn't work

You're missing an awful lot of code, where is swapChainDesc defined and set?

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

It is ever created i initialized it in the constructor, there is no problems with that.

vertexGBufferLayout has no value (null pointer), I tried with DXGI_FORMAT_R8G8B8A8_UNORM and vertexGBufferLayout has still no value, I tried also by removing all lines concerning colors in the vertex shader and this code from C++ code :


layout[3].SemanticName = "COLOR";
layout[3].SemanticIndex = 0;
layout[3].Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
layout[3].InputSlot = 0;
layout[3].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
layout[3].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
layout[3].InstanceDataStepRate = 0;

And it still doesn't work sad.png

I tried to put D3D11_CREATE_DEVICE_DEBUG and my program crashes sooner in my code at a place where it usually doesn't crash. And I have no more messages in the output than before. sad.png

If you are using vs2010, a recent update caused a crash (on device creation if I remember correctly?). You can fix that by installing the remote vs2012 debugging tools (free). see here: http://blogs.msdn.com/b/chuckw/archive/2013/02/26/directx-11-1-and-windows-7-update.aspx
You really should make sure you get the debug runtimes working, it's really helpful, definitely worth the (minimal) effort to setup.

well then how do you define your screen width and height if you don't touch the swap chain.

Hehe, you're a bit lazy aren't you happy.png

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

I get screen dimensions and affect it then.

For vs2012 tools, thanks i'm downloading it, I come back then to tell you if it works or not.

Wait, so you do touch the swapchain description?

Show us if you do.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

It works, I forgot the semantics which were in output from the vertex shader.

And I can now use the directx debug runtime.

Thanks

This topic is closed to new replies.

Advertisement