Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Aug 2007
Offline Last Active Mar 24 2015 06:45 PM

Posts I've Made

In Topic: NVIDIA NSight vs Visual Studio 2013 Graphics Debugger?

05 March 2015 - 02:46 PM

The reason I ask is because I have gotten to the point where Visual Studio won't load my compute shader when trying to debug it.  It doesn't show any error.  It just hangs on "generating shader traces".  So I'm wondering if there's a debugger that would be better for complex compute shaders?

In Topic: Moving Data from CPU to a Structured Buffer

04 March 2015 - 01:21 AM

Hmm.. It appears I misread the error message.  The result is still a little cryptic to me.  Here is the code I'm calling:

HRESULT CreateStructuredBuffer(
		ID3D11Device *device,
		UINT element_size,
		UINT count,
		void *initial_data,
		ID3D11Buffer **out)
		*out = NULL;
		D3D11_BUFFER_DESC desc;
		ZeroMemory(&desc, sizeof(D3D11_BUFFER_DESC));
		desc.ByteWidth = element_size * count;
		desc.StructureByteStride = element_size;
		desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
		desc.Usage = D3D11_USAGE_DYNAMIC;
		if (initial_data)
			D3D11_SUBRESOURCE_DATA subresource_data;
			subresource_data.pSysMem = &initial_data;
			return device->CreateBuffer(&desc, &subresource_data, out);
			return device->CreateBuffer(&desc, NULL, out); 

And here is the error message I get when I try to call CreateBuffer:

D3D11 ERROR: ID3D11Device::CreateBuffer: A D3D11_USAGE_DYNAMIC Resource cannot be bound to certain parts of the graphics pipeline, but must have at least one BindFlags bit set. The BindFlags bits (0x88) have the following settings: D3D11_BIND_STREAM_OUTPUT (0), ...

In Topic: Texture Renders Incorrectly in Application but Perfectly fine in VS2013's...

29 January 2015 - 12:54 AM



As Adam_42 mentions, the Map call looks suspicious. In addition, is there a reason you call Map/Unmap after you've already created an SRV from the texture?


This is for a school project where the goal is to rasterize triangles.  Thus, the contents of the texture "back buffer" could change so I would rather Map/Unmap it than create a new texture every time I need to draw.


It turns out that the Map/Unmap is indeed the culprit.  I was creating the texture as a size that isn't memory aligned (1000*1000) so DirectX pads the texture to make it be aligned.  I wasn't accounting for the extra padding while writing texture data.

In Topic: Texture Renders Incorrectly in Application but Perfectly fine in VS2013's...

27 January 2015 - 05:06 PM

Thanks for the response.  Perhaps I didn't clarify but the Application renders incorrectly while running in debug mode.  However, when a frame is captured inside the graphics debugger, the frame renders as it should.  

In Topic: Help compiling GLFW from source?

22 February 2014 - 06:32 PM

That command didn't work.  I'm in the Ubuntu terminal.