Am 27.10.2009 um 20:10 schrieb Rico Schüller:
Hi,
this patch series implements a couple of ID3D10EffectVariable::As*() functions (patches 2-11).
Do we have any tests for the As* behavior?
Most conversions don't make any sense, so if the app wants a constant buffer as a render target view returning a null obj is probably a sane thing. But ::AsString potentially makes sense for all objects, maybe in a similar way Object::ToString is used to obtain a String for debug output in Java.
Also, do we know what happens if the object is "converted" back to its original state? E.g.
constant_buffer = render_target_view::AsConstantBuffer(); render_target_view2 = constantBuffer::AsRenderTargetView?
As far as I understand it, your code would return a null rt view. Is this correct?
2009/10/28 Stefan Dösinger stefandoesinger@gmx.at:
Do we have any tests for the As* behavior?
Most conversions don't make any sense, so if the app wants a constant buffer as a render target view returning a null obj is probably a sane thing. But ::AsString potentially makes sense for all objects, maybe in a similar way Object::ToString is used to obtain a String for debug output in Java.
Also, do we know what happens if the object is "converted" back to its original state? E.g.
constant_buffer = render_target_view::AsConstantBuffer(); render_target_view2 = constantBuffer::AsRenderTargetView?
As far as I understand it, your code would return a null rt view. Is this correct?
The patches are correct, I wrote tests for this for commits 508635ac4c290b00bd2aa97026e627a50d3c4cee, 58fcb06c07cbe4fd9cd94dc138d625cf08b82fb7 and fbbbdc09a591d7e8deae3830400ac7ad1d2fca8e. I didn't submit those though.
Am 28.10.2009 um 11:43 schrieb Henri Verbeet:
The patches are correct, I wrote tests for this for commits 508635ac4c290b00bd2aa97026e627a50d3c4cee, 58fcb06c07cbe4fd9cd94dc138d625cf08b82fb7 and fbbbdc09a591d7e8deae3830400ac7ad1d2fca8e. I didn't submit those though.
Ok
Am 28.10.2009 12:38, schrieb Stefan Dösinger:
Am 28.10.2009 um 11:43 schrieb Henri Verbeet:
The patches are correct, I wrote tests for this for commits 508635ac4c290b00bd2aa97026e627a50d3c4cee, 58fcb06c07cbe4fd9cd94dc138d625cf08b82fb7 and fbbbdc09a591d7e8deae3830400ac7ad1d2fca8e. I didn't submit those though.
Ok
I've also a test for that, it will follow later. I need to fix some other things in the code first.
On 10/28/2009 06:32 AM, Stefan Dösinger wrote:
Am 27.10.2009 um 20:10 schrieb Rico Schüller:
Hi,
this patch series implements a couple of ID3D10EffectVariable::As*() functions (patches 2-11).
Do we have any tests for the As* behavior?
Most conversions don't make any sense, so if the app wants a constant buffer as a render target view returning a null obj is probably a sane thing. But ::AsString potentially makes sense for all objects, maybe in a similar way Object::ToString is used to obtain a String for debug output in Java.
This is a rather odd looking API - it actually looks a lot more like C# "as" operator than Java.ToString(). That's basically a safe cast, which returns NULL if the object is not of the type you're trying to cast.
...except that in C# it's a language operator that works on any pointer type.
Ivan