I have two objects, one object has a ShaderViewResource attached to it (texture) and one has none ShaderViewResource bound to it (no texture)

Before I draw the objects Im setting the ShaderViewResource that is bound to that object. Se below :

[source lang="cpp"]m_pContext->PSSetShaderResources( 0, 1, &m_pShaderResourceView); [/source]
so with the object with an attached ShaderViewResource m_pShaderResourceView = something, and m_pShaderResourceView = NULL in the case of no texture.

But Im getting this warning :

D3D11: INFO: ID3D11DeviceContext::DrawIndexed: The Pixel Shader unit expects a Shader Resource View at Slot 0, but none is bound. This is OK, as reads of an unbound Shader Resource View are defined to return 0. It is also possible the developer knows the data will not be used anyway. This is only a problem if the developer actually intended to bind a Shader Resource View here. [ EXECUTION INFO #353: DEVICE_DRAW_SHADERRESOURCEVIEW_NOT_SET ]

From what I understand this is no killer, but i would if anyone has a better way of solving this lite problem instead of setting NULL as the ShaderResource.

If you already have two separate shaders for the two draw passes then just don't bother setting NULL to slot 0 - your second (textureless) shader will just ignore it anyway.

If you don't then you could consider having two separate shaders as an option, in which case you can use the solution I mentioned above. Otherwise you could just create a simple 1x1 texture (depending on your needs this can be all-white or all-black) and set that for the textureless pass.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.