Why CPU-side version SDL_FillRect up to 7 times faster in compare GPU-side version SDL_RenderFillRect?
问题 Here I have asked what is the difference between SDL_FillRect and SDL_RenderFillRect Here is code of my benchmark: my $window = SDL2::Video::SDL_CreateWindow( 'Hello', 100, 100, 800, 600, 0x00000004 ); my $surface = SDL2::Video::SDL_GetWindowSurface( $window ); my $render = SDL2::Render::SDL_GetRenderer( $window ); SDL2::Render::SDL_SetRenderDrawColor( $render, 0, 0, 255, 255 ); use Benchmark ':all'; my $rect1 = SDL2::Rect->new({ x => 10, y => 10, h => 50, w => 50 }); timethese( 1000000, {