xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> How To Port Xbox Push Buffer Code To Windows?
fox suit
post Mar 8 2010, 01:10 PM
Post #1


X-S Enthusiast


Group: Members
Posts: 1
Joined: 8-March 10
Member No.: 434336



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)

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Pulsemasta
post Mar 10 2010, 01:20 PM
Post #2


X-S Expert
***

Group: Members
Posts: 725
Joined: 29-November 08
Member No.: 397380
Xbox Version: v1.1
360 version: unknown



You might have better luck posting in the Dev forums with this one.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
sirlemonhead
post Mar 10 2010, 10:57 PM
Post #3


X-S Senior Member
**

Group: Members
Posts: 161
Joined: 1-June 04
From: Ireland
Member No.: 123165
Xbox Version: unk



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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 21st May 2013 - 08:29 AM