reswitched / libtransistor

Open source toolchain for Switch development
ISC License
205 stars 46 forks source link

graphic Linear mode init #115

Open ericde45 opened 6 years ago

ericde45 commented 6 years ago

hello

would it be possible to initialize the graphic subsystem in linear double buffer mode, instead of the tiled currently used for example in test_display ?

it's very difficult to find where this can be changed, as my only documentation is switchbrew + TX1 pdf doc.

thanks

roblabla commented 6 years ago

I suppose it'd be somewhere in there : https://github.com/reswitched/libtransistor/blob/1cc62f7963db576021e5edab49f7d5fb7550b371/lib/display/display.c

I'm not very familiar with the graphics subsystem though. Misson could probably tell you more.

misson20000 commented 6 years ago

Not that I know of. It's probably one of the fields in graphic_buffer_t. Why do you want to change it?

ericde45 commented 6 years ago

using tiled graphic memory is a mess it is a lot easier to have linear memory, to draw things a lot faster using CPU of course. ( as i don't think that a documentation for GPU use in Switch is already available ? )

misson20000 commented 6 years ago

Shouldn't be too bad if you use our swizzling function

ericde45 commented 6 years ago

swizzle is taking CPU time the doom port was optimized using tables to replace swizzle the best way is to be in linear mode i checked libnx and it is directly in linear mode but i was not able to figure which init value is different

roblabla commented 6 years ago

I calculated the swizzle and the time it takes is negligeable. According to discord history, it takes 86us.

iOS4all commented 6 years ago

@Alklas as we know the Libnx has JIT support by Plutoo. So can we get vulkan api and enable it in order to enhance ports as doom and emulators? Thanks.

ericde45 commented 6 years ago

i'am from the old school, coding demos at the end of the eighties on Atari ST and Amiga so not optimizing is not my nature :) if you find the information to switch to linear , i am really interested. but i don't think it is a priority.