Jump to content
  • Advertisement
Steven Ford

DX11 Geometry Shader only working on subset of 10.0 capable hardware

This topic is 478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I've got a problem with one of my geometry shaders with my game. It works on most hardware, but on a subset of machines, typically laptops with integrated graphics (although I do have a laptop with integrated graphics where it works), my shader doesn't work (that is, nothing is displayed on screen, but the calls themselves don't appear to be failing).  My code is set up to require feature level 10.0 and on the machines where it's not working they're reporting as supporting this level. Everything else is working on these machines (I also have a pure 9.3 feature level fallback renderer which works perfectly on these machines).

Usually, I'd run the code through the debugger however these machines are either not mine or struggle to run visual studio (it's an old netbook - Acer Aspire) hence that's not an easy option.

So 2 questions:

1. Can anyone think of why one might see such issues between feature level 10.0 compatible hardware and if there are issues, then how would one programmatically identify this?
2. Suggestions on how to diagnose these problems without the use of VS

Background:
The shaders are designed to render a fluid in the game. The fluid is stored in a single large byte array where each droplet of fluid is represented by 4 bits (2 for colour, 2 for movement, ie. each byte represents 2 droplets). The location of the fluid is determined by its psition in the array. The geometry shader takes in an int and then, using bit masks, potentially outputs a set of vertices for every valid droplet. The rendering code then copies the original array to a buffer:

 

	D3D11_INPUT_ELEMENT_DESC waterLayout[1];
	waterLayout[0].AlignedByteOffset = 0;
	waterLayout[0].Format = DXGI_FORMAT::DXGI_FORMAT_R32_UINT;
	waterLayout[0].InputSlot = 0;
	waterLayout[0].InputSlotClass = D3D11_INPUT_CLASSIFICATION::D3D11_INPUT_PER_VERTEX_DATA;
	waterLayout[0].InstanceDataStepRate = 0;
	waterLayout[0].SemanticIndex = 0;
	waterLayout[0].SemanticName = "BITMASK";
	auto hr = dxDevice->CreateInputLayout(waterLayout, 1, _vertexShader->shaderByteCode.get(), _vertexShader->shaderByteCodeLength, &_inputLayout);

 

I've attached the files in case there's anything obvious

 

Thanks

DataStructures.hlsl

GeometryShader.hlsl

PixelShader.hlsl

VertexShader.hlsl

 

 

 

 

Edited by Steven Ford
Poor grammar

Share this post


Link to post
Share on other sites
Advertisement

I get two of these warning:

warning X3576: semantics in type overridden by variable/function or enclosing type

because you nest structs with semantics. I'd start eliminating these. This is a lucky guess, but warnings are there for a reason.

 

Share this post


Link to post
Share on other sites

Yeah renderdoc is my go to tool for debugging. Also turn on the d3d debug runtime (D3D11_CREATE_DEVICE_DEBUG at device creation time), and you can also get a pointer to the debug layer with something like:

        m_device->QueryInterface(IID_ID3D11Debug, (void**)&m_debug);
        m_device->QueryInterface(IID_ID3D11InfoQueue, (void**)&m_debugInfoQueue);

Which lets you access the debug message queue programmatically, and also has some features that are useful when you are doing VS debugging, e.g.:

        m_debugInfoQueue->SetBreakOnSeverity( D3D11_MESSAGE_SEVERITY_ERROR, TRUE );
        m_debugInfoQueue->SetBreakOnSeverity( D3D11_MESSAGE_SEVERITY_WARNING, TRUE );

At a guess, perhaps you're using a DXGI_FORMAT that is only optionally supported by FL10, and your problematic GPUs do not possess support?

Share this post


Link to post
Share on other sites

Thanks Hodgman / unbird,

These were the first set of shaders that I'd ever written (as part of a learning process to learn DX) so it's quite likely that I was attribute happy! :)

I'll make the suggested changes and go through the debugging info. I wasn't aware that different formats were optional (I had assumed that maybe it's an int thing). Time to start debugging.

Cheers

Steve

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!