Jump to content
  • Advertisement
Sign in to follow this  
L. Spiro

Modify Inputs to Functions in Metal

This topic is 649 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Perhaps a bit ironic for an Apple Inc. employee whose job is to optimize Metal to be asking about Metal, but I don’t actually start for another week (can’t just lean over and ask) and for some reason I can’t post on the Apple Developer Forums.
I need to know how to pass “output” values to a function in Metal.  These would be examples of what I want to do:
 
HLSL:
void Func( out float4 ModMe ) {
   ModMe = float4( 1, 2, 3, 4 );
}
C++:
void Func( float4 &ModMe ) {
   ModMe = float4( 1, 2, 3, 4 );
}
Metal does not seem to have a way to do this as far as I can tell.
Anyone know?


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites
Advertisement
The actual solution is:

void Func( thread float4 &ModMe ) {
   ModMe = float4( 1, 2, 3, 4 );
}



L. Spiro

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!