How is ResourcePtr converted to an integer in SetParameterData? o_O

Apr 18, 2013 at 10:23 PM
Edited Apr 18, 2013 at 10:23 PM
When writing to the shader resource parameter you have:
void ShaderResourceParameterWriterDX11::InitializeParameter( )
{
    m_pParameter->InitializeParameterData( &m_Value );
}
Where m_Value is a ResourcePtr, however in InitializeParameter data, ShaderResourceParameter calls SetParameterData, which casts the passed data to an integer.How does it know which member of the ResourceProxy to take and convert to that integer?
Coordinator
Apr 19, 2013 at 10:55 AM
That's a good question... I'll take a closer look at this today, but at first glance it looks like you are right - something isn't correct there. Strangely, I am fairly certain that this code is used somewhere, so it is strange that it would still work in that case... I'll get back to you on this later today!
Coordinator
Apr 22, 2013 at 11:00 AM
This is indeed a bug. The code would theoretically be used in some other methods, but it currently never gets executed (at least that I have been able to find). I have made a simple fix for this (just add the direct dereferencing to the appropriate view type in the call shown above), and I also want to take a look at eliminating the need to have those void* arguments. I think that is where the root of the issue truly lies...

Thanks a bunch for the report! If you would like your contact info added to the readme of contributors, please send me a instant message with the details!
Apr 28, 2013 at 9:40 PM
Edited Apr 28, 2013 at 9:40 PM
Oh no need, for mention, it was just a random notice xD