Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualStarnick

Posted 29 December 2011 - 07:41 PM

Looking at the source (line 79 and 89) its understandable why NullReference is being thrown in the SetResourceArray (array can't be null, and it doesn't check if the element is null, unlike the source for the PixelShaderWrapper). So it looks like an issue that probably should be on the SlimDX issue tracker.

You may not have to unbind all resources - you could always ensure your texture array occupies the first n slots, and query the EffectType on the resource variable (GetVariableType), and use the EffectTypeDescription.Elements value as the count. This is bit of a guess though.

Edit: Another (harder) way of doing it of course is by using ShaderReflection, not only to inspect the # of elements, but also to get the bind point of the resources. :)

#2Starnick

Posted 29 December 2011 - 03:02 PM

Looking at the source (line 79 and 89) its understandable why NullReference is being thrown in the SetResourceArray (array can't be null, and it doesn't check if the element is null, unlike the source for the PixelShaderWrapper). So it looks like an issue that probably should be on the SlimDX issue tracker.

You may not have to unbind all resources - you could always ensure your texture array occupies the first n slots, and query the EffectType on the resource variable (GetVariableType), and use the EffectTypeDescription.Elements value as the count. This is bit of a guess though.

#1Starnick

Posted 29 December 2011 - 03:00 PM

Looking at the source (line 79 and 89) its understandable why NullReference is being thrown in the SetResourceArray (array can't be null, and it doesn't check if the element is null, unlike the source for the PixelShaderWrapper). So it looks like an issue that probably should be on the SlimDX issue tracker.

You may not have to unbind all resources - you could always ensure your texture array occupy the first n slots, and query the EffectType on the resource variable (GetVariableType), and use the EffectTypeDescription.Elements value as the count. This is bit of a guess though.

PARTNERS