logs archiveBotHelp.net / Freenode / #3dsdev / 2015 / July / 24 / 2
Lectem
Subv : if only
yuriks
actually, GSP won't even see it
mullar
Yeah I'm not sure it even reaches the GSP
yuriks
it'll just append the GSP command to the GPU command buffer, and then ping GSP about it
GSP will look at its buffer, most likely see nothing there, "huh?" and return
it's been buggy like that since the start, too
(Action) runs it through the other #3dsdev
mullar
gxBuf is a fixed location in shared memory to write a pointer to the GSP Command buffer (itself containing the GPU Command buffer)
but the pointer to the GSP Command buffer is written wrongly to the beginning of the GPU command buffer (in linear heap)
yuriks
more accurately, gxBuf points *to* the GSP command buffer in memory
in the shared memory*
the GSP command buffer contains a *pointer* to the GPU command buffer (allocated by the application)
(GSP takes that pointer and translates it to an address the GPU can use, there's no copying of the GPU cmdbuf involved)
mullar
isn't the GSP buffer a local variable in GX_SetCommandList_First ?
I talk about gxCommand
yuriks
that just a small temp buffer, it gets copied to the shared memory buffer (gxBuf)
that needs to be done atomically though so it's why it's nto just written directly
(see SubmitGxCommand https://github.com/smealum/ctrulib/blob/e7ea04e532b1954debd2b73a3d5d6a0580f4005f/libctru/source/services/gsp.c#L361 )
mullar
I just have troubles to understand if gxBuf (the shared memory location) is actually just a pointer to a buffer or a buffer itself
yuriks
well, it's just a pointer, so it can't be a buffer itself
oh
you mean *gxBuf
it's the buffer itself
mullar
I mean what is in shared memory is a pointer or a buffer ?
yuriks
a buffer
http://3dbrew.org/wiki/GSP_Shared_Memory#Command_Buffer_Header
this is the in-shmem structure
mullar
ok thx, I'll read this part again later to understand it better
yuriks
the application and GSP both have the same memory mapped in their address space
so writes/reads communicate across
but GSP can't otherwise access the application memory
however, the GPU directly reads memory, which is why the GPU command list needs to be on the linear heap, and why GSP can send it to the GPU
mullar
nice!
yuriks
(send a pointer to it to the GPU*)
« prev 1 2 next »