mes, model railroading, birds, photography)
-Original Message-
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma
Sent: Monday, May 17, 2004 4:19 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures
> Taken
>
> But
Right, Srihari. If you go back and read the thread from the top (it's very
long, now, you can be forgiven :) you'll see this has been our driving
assumption -- that the JIT compiler would have to do some static analysis
on the call-tree, to ensure that the struct's members are accessed in a
read-o
Of Srihari Angaluri
Sent: Friday, May 21, 2004 10:53 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures
Doesn't it alter the whole semantics of value types if the implementation is
allowed to do "hidden" optimizations like these? For example, if the
compiler pa
04:53
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
>
> Doesn't it alter the whole semantics of value types if the
> implementation is allowed to do "hidden" optimizations like
> these? For example, if the compiler passes the struct by
>
Doesn't it alter the whole semantics of value types if the implementation
is allowed to do "hidden" optimizations like these? For example, if the
compiler passes the struct by reference after a threshold size (let's say
more than 1MB), any modifications I make to the structure inside the method
wil
e.
> However, nothing horrible can happen.
>
> -- arlie
>
>
> -Original Message-
> From: Unmoderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Jeroen Frijters
> Sent: Monday, May 17, 2004 6:17 AM
> To: [EMAIL PROTECTED]
&
In the interest of putting this to sleep, I think the only people who can
answer why they made the design decision to go by-val instead of by-ref is
the DirectX managed wrapper team. Perhaps you can find a direct channel to
them. Do any of them have a weblog? I think what we're most likely going to
: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Jeroen Frijters
Sent: Monday, May 17, 2004 6:17 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures
John Elliot wrote:
> Is there any safeguard in place that could catch this type of th
John Elliot writes:
> I guess I meant 'strange' as in 'closed source, poorly
> documented, "I didn't write it", etc.' (don't know much
> about DirectX doco, so that's not a sledge as such).
The DirectX docs are actually fairly decent.
> Say for example I'm targeting the managed DirectX API, and
to:[EMAIL PROTECTED] On Behalf Of Frans Bouma
> Sent: Monday, May 17, 2004 4:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
>
> > Taken
> >
> > But in this particular case, being heavy matrix opreations
> in 3d, this
> > kill
ion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma
Sent: Monday, May 17, 2004 4:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures
> Frans Bouma wrote:
> > > > Because the DX api is a COM api,
> > >
> > > We
bject: Re: [ADVANCED-DOTNET] Large structures
> Taken
>
> But in this particular case, being heavy matrix opreations in 3d, this
> kills your performance.
If you want performance, write a shader and do your matrix
manipulations on the GPU or call into a C++ matrix lib. I a
by
reference) and the JIT implementation should do something sensible in the
real world.
-- arlie
-Original Message-
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Shawn A. Van Ness
Sent: Monday, May 17, 2004 1:29 AM
To: [EMAIL PROTECTED]
Subject: Re
nmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma
Sent: Monday, May 17, 2004 4:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures
> I think the main issue here is that teh DirectX API (which this was
> about in the beginning) d
John Elliot wrote:
> Is there any safeguard in place that could catch this type of
> thing?
As long as you don't use "unsafe" code, there is no way to get in
trouble with a ref to a struct (they are always local to one thread).
Except, of course, by calling a native method that hangs on the point
>> Just thinking out loud, but might it have something to do
>> with threading concerns? If I hand out a reference to
>> something on my stack to a strange API how do I know that
>> it will finish with it before my stack changes..
>
>But it isn't a strange API. After all, presumably the Managed Dir
John Elliot wrote:
> >Now the question is, since SomeRandomBoxApi takes a pointer to a
> >_D3DBOX (which is equivalent to a pointer to a Box), why pass in
> >the Box by value?
>
> Just thinking out loud, but might it have something to do
> with threading concerns? If I hand out a reference to som
Frans Bouma wrote:
> Ok, I see your point.
>
> It is indeed weird, I didn't notice that, my appologies.
> If you look at Volume.LockBox() for example you see this:
>
> public GraphicsStream LockBox(Box box, LockFlags flags)
> {
> return this.LockBoxInternal(ref box, flags, 0);
> }
>
> Indeed w
>Now the question is, since SomeRandomBoxApi takes a pointer to a
>_D3DBOX (which is equivalent to a pointer to a Box), why pass in
>the Box by value?
Just thinking out loud, but might it have something to do with threading
concerns? If I hand out a reference to something on my stack to a
strange
Ok, I see your point.
It is indeed weird, I didn't notice that, my appologies.
If you look at Volume.LockBox() for example you see this:
public GraphicsStream LockBox(Box box, LockFlags flags)
{
return this.LockBoxInternal(ref box, flags, 0);
}
Indeed weird why the box has to be passed by valu
Frans Bouma wrote:
> Why is it irrelevant, if I may ask?
It's irrelevant to the question that we were discussing (which was "why
did MS design the Managed DirectX API like this?").
> Well, perhaps the answer lies somewhere in the reason why
> D3DMATRIX is defined as:
> [StructLayo
Frans Bouma wrote:
> Although there is one weird thing:
> (and you know more on this than I do I think): the D3D structs are
> redefined in these formats:
>
> [StructLayout(LayoutKind.Sequential, Size=24, Pack=1),
> CLSCompliant(false), MiscellaneousBits(65), DebugInfoInPDB]
> public struc
> Frans Bouma wrote:
> > > > Because the DX api is a COM api,
> > >
> > > We're talking about the *Managed* DirectX API. So your entire
> > > message doesn't make any sense.
> >
> > Erm, that api is a wrapper around DX COM.
>
> I know, but that's irrelevant.
Why is it irrelevan
> Frans Bouma wrote:
> > Because the DX api is a COM api,
>
> We're talking about the *Managed* DirectX API. So your entire
> message doesn't make any sense.
Although there is one weird thing:
(and you know more on this than I do I think): the D3D structs are
redefined in these formats:
Frans Bouma wrote:
> > > Because the DX api is a COM api,
> >
> > We're talking about the *Managed* DirectX API. So your entire
> > message doesn't make any sense.
>
> Erm, that api is a wrapper around DX COM.
I know, but that's irrelevant.
> For the main logic it calls into the COM ob
> Frans Bouma wrote:
> > Because the DX api is a COM api,
>
> We're talking about the *Managed* DirectX API. So your entire
> message doesn't make any sense.
Erm, that api is a wrapper around DX COM. For the main logic it
calls into the COM objects. Try f.e. to decompile the Direct3D
Bas
Frans Bouma wrote:
> Because the DX api is a COM api,
We're talking about the *Managed* DirectX API. So your entire message
doesn't make any sense.
Regards,
Jeroen
===
This list is hosted by DevelopMentor® http://www.develop.com
Some .NET courses you may be inter
> > -Original Message-
> > From: Unmoderated discussion of advanced .NET topics.
> > [mailto:[EMAIL PROTECTED] On Behalf Of
> Frans Bouma
> > Sent: Montag, 17. Mai 2004 10:00
> > To: [EMAIL PROTECTED]
> > Subject: Re: [ADVANCED-DOTNET] Large structu
> From: Unmoderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Frans Bouma
> Sent: Montag, 17. Mai 2004 10:00
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
>
> > I think the main issue here is that teh DirectX API (whic
> I think the main issue here is that teh DirectX API (which
> this was about in the beginning) does not pass the structy by ref.
>
> Looks like a tremendous oversight to me.
>
> The rest then is basically a logical extension of standard
> .NET semantics (structs copied onto stack) and not per
mailto:[EMAIL PROTECTED] On Behalf Of
> Reali Patrik René Celeste
> Sent: Montag, 17. Mai 2004 09:35
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
>
> Jeroen Frijters wrote:
> > Arlie Davis wrote:
> > > Or does it ever simply pass a pointe
Jeroen Frijters wrote:
> Arlie Davis wrote:
> > Or does it ever simply pass a pointer to the structure?
>
> In theory it could do this optimization in some cases, but I
> don't think
> it is likely that they'll do it in practice. If you want to pass large
> structures, you can always pass them by r
Arlie Davis wrote:
> I have a few questions for the advanced CLR people here. I
> haven't been able to find any satisfactory answers elsewhere.
>
> Consider value types / structures in CLR, and passing them as
> arguments to methods. Does the MS CLR *always* copy the entire
> structure onto th
cussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Shawn A. Van Ness
> Sent: Montag, 17. Mai 2004 07:29
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Large structures
>
> > This seems like a big waste of time
>
> Arlie, are you conce
> This seems like a big waste of time
Arlie, are you concerned more about the time (ie, the memcpy operation) or
excess growth of the stack (eg, in recursive scenarios)? Or both?
I don't have the managed dx sdk handy -- is their Matrix really a valuetype?
In System.Drawing.Drawing2D, it's a clas
Vince P
Sent: Sunday, May 16, 2004 2:57 PM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Large structures
I'm not an expert... BUT.. I think I'm right..
If you're using C#, you can take advantage of boxing which takes a value
type and implicitly turns it into a reference type.
Davis
> Sent: Sonntag, 16. Mai 2004 20:51
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Large structures
>
> I have a few questions for the advanced CLR people here. I
> haven't been able to find any satisfactory answers elsewhere.
>
> Consider value type
> From: Unmoderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Arlie Davis
> Sent: Sunday, 16 May, 2004 13:51
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Large structures
>
> I have a few questions for the advanced CLR people here. I
>
I have a few questions for the advanced CLR people here. I haven't been
able to find any satisfactory answers elsewhere.
Consider value types / structures in CLR, and passing them as arguments to
methods. Does the MS CLR *always* copy the entire structure onto the stack?
Or does it ever simply p
39 matches
Mail list logo