Jump to content


Photo

How To Port Xbox Push Buffer Code To Windows?


  • Please log in to reply
2 replies to this topic

#1 fox suit

fox suit

    X-S Enthusiast

  • Members
  • 1 posts

Posted 08 March 2010 - 01:10 PM

Hi I've got a block of code that was originally written for xbox and I'm trying to make it work on windows. From what I understand these are direct GPU commands for the xbox and directx 9 doesn't have any way to do the same thing. Can someone help me modify the code to come up with a pc equivalent? Or is there any guide for porting between windows and xbox d3d that covers push buffers??

CODE


//BeginPush()

p_push[0]    = D3DPUSH_ENCODE( D3DPUSH_SET_TRANSFORM_CONSTANT_LOAD, 1 );

p_push[1]    = 96 + 16;

p_push[2]    = D3DPUSH_ENCODE( D3DPUSH_SET_TRANSFORM_CONSTANT, 8 );

p_push[3]    = *((DWORD*)&r[0] );
p_push[4]    = *((DWORD*)&r[1] );
p_push[5]    = *((DWORD*)&r[2] );
p_push[6]    = *((DWORD*)&r[3] );

p_push[7]    = *((DWORD*)&t );
p_push[8]    = *((DWORD*)&color_interpolator );
p_push        += 11;

p_push[0]    = D3DPUSH_ENCODE( D3DPUSH_SET_BEGIN_END, 1 );
p_push[1]    = D3DPT_QUADLIST;
p_push        += 2;

p_push[0]    = D3DPUSH_ENCODE( D3DPUSH_NOINCREMENT_FLAG | D3DPUSH_INLINE_ARRAY, 12 );
++p_push;

p_push[0]    = *((DWORD*)&col0 );
p_push[1]    = *((DWORD*)&col1 );
p_push[2]    = 0x00000000UL;

p_push[3]    = *((DWORD*)&col0 );
p_push[4]    = *((DWORD*)&col1 );
p_push[5]    = 0x00010001UL;

p_push[6]    = *((DWORD*)&col0 );
p_push[7]    = *((DWORD*)&col1 );
p_push[8]    = 0x00020002UL;
                
p_push[9]    = *((DWORD*)&col0 );
p_push[10]    = *((DWORD*)&col1 );
p_push[11]    = 0x00030003UL;

p_push        += 12;

p_push[0] = D3DPUSH_ENCODE( D3DPUSH_SET_BEGIN_END, 1 );
p_push[1] = 0;
p_push += 2;


EndPush(p_push)



#2 Pulsemasta

Pulsemasta

    X-S Expert

  • Members
  • PipPipPip
  • 725 posts
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 10 March 2010 - 01:20 PM

You might have better luck posting in the Dev forums with this one.

#3 sirlemonhead

sirlemonhead

    X-S Senior Member

  • Members
  • PipPip
  • 161 posts
  • Location:Ireland
  • Xbox Version:unk

Posted 10 March 2010 - 10:57 PM

Depends.. but you'll likely want to look at dynamic vertex buffers in d3d9.

What does that function draw? If you give me more information I'll try help




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users