{"action":"created","issue":{"url":"https://api.github.com/repos/MightyPirates/OpenComputers/issues/779","repository_url":"https://api.github.com/repos/MightyPirates/OpenComputers","labels_url":"https://api.github.com/repos/MightyPirates/OpenComputers/issues/779/labels{/name}","comments_url":"https://api.github.com/repos/MightyPirates/OpenComputers/issues/779/comments","events_url":"https://api.github.com/repos/MightyPirates/OpenComputers/issues/779/events","html_url":"https://github.com/MightyPirates/OpenComputers/issues/779","id":53289924,"number":779,"title":"Video RAM for faster drawing","user":{"login":"Inari-Whitebear","id":1077971,"avatar_url":"https://avatars.githubusercontent.com/u/1077971?v=3","gravatar_id":"","url":"https://api.github.com/users/Inari-Whitebear","html_url":"https://github.com/Inari-Whitebear","followers_url":"https://api.github.com/users/Inari-Whitebear/followers","following_url":"https://api.github.com/users/Inari-Whitebear/following{/other_user}","gists_url":"https://api.github.com/users/Inari-Whitebear/gists{/gist_id}","starred_url":"https://api.github.com/users/Inari-Whitebear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Inari-Whitebear/subscriptions","organizations_url":"https://api.github.com/users/Inari-Whitebear/orgs","repos_url":"https://api.github.com/users/Inari-Whitebear/repos","events_url":"https://api.github.com/users/Inari-Whitebear/events{/privacy}","received_events_url":"https://api.github.com/users/Inari-Whitebear/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MightyPirates/OpenComputers/labels/feature-accepted","name":"feature-accepted","color":"009800"},{"url":"https://api.github.com/repos/MightyPirates/OpenComputers/labels/open-for-adoption","name":"open-for-adoption","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2015-01-03T01:27:58Z","updated_at":"2016-06-04T11:39:33Z","closed_at":null,"body":"(might be loosely related to the suggestion about GPU shaders)\r\nSo my issue is that I like drawing pretty pictures, but that takes forever with the current draw calls. Even small pictures take a little longer than they really should.\r\nBut well we can't really speed that up much without causing lots of traffic etc.\r\n\r\nAn idea I had was to allow copying from one screen/gpu to another using the copy command, so one could pre-draw stuff on one screen, then just copy it to the other. Which wouldn't make a lot of sense technically, but would work.\r\n\r\nA better idea would be to give GPUs video ram, which is limited per GPU (probably in bytes) and can be allocated and destroyed. To not break compatibility, per default the GPU allocates some when the resolution is set. The GPU also sets which of the allocated memory's is output to the screen (which per default is the one created when the resolution is set/the screen is bound). And copying between them is instant, but drawing on each still takes the normal time. This way you could pre-draw pictures as \"textures\" on allocated memory and then just blit it to the screen. And the traffic also shouldn't get bigger since its only a single call that has to be sent (the memory should be kept in sync or such maybe just synced the first time its used in blitting).\r\n\r\nThis also makes more sense as afaik IRL pushing data from CPU to the GPU is slower than using the GPU's memory.\r\n\r\nThe defaulting is mostly just to keep compatibility.\r\n\r\nSo like:\r\n`gpu.freeMemory()` -- returns amount of free memory in bytes\r\n`gpu.totalMemory()` -- returns amount of total memory in bytes\r\n\r\n`gpu.allocate(width, height)` -- allocates some memory to be used with the other functions, fails if there isn't enough free memory, returns true, memory_address on success and false, error on error\r\n`gpu.free(memory_address)` -- frees the specified address. returns true on success and false, error on failure. if no address is given, all memory is freed\r\n`gpu.list()` -- lists the alllocated memory_addresses\r\n\r\n`gpu.getResolution(memory_address)` -- returns width, height of the resolution of the memory_address\r\n`gpu.bind(screen_address, memory_address)` -- sets the screen output to the specified memory address (maybe possible to have multiple outputs for higher tier GPU?)\r\n`gpu.copyMemory(source_memory_address, x_pos, y_pos, width, height, target_memory_address, target_x_pos, target_y_pos)` -- copies part of a memory to another\r\n`gpu.setMemory(memory_address, x, y, char)` -- sets the x/y position of the memory_address to the given char (using the currently set background and foreground colors)\r\n\r\nThis would allow for some interesting usage such as making 2 memories of the screen's size, drawing the updates on one and then copying it over to the output-bound memory to show a new something on the screen in one go instead of drawing it over time. Also allows to pre-draw images that can then be just copied over onto the screen and such~"},"comment":{"url":"https://api.github.com/repos/MightyPirates/OpenComputers/issues/comments/223751099","html_url":"https://github.com/MightyPirates/OpenComputers/issues/779#issuecomment-223751099","issue_url":"https://api.github.com/repos/MightyPirates/OpenComputers/issues/779","id":223751099,"user":{"login":"dangranos","id":4279480,"avatar_url":"https://avatars.githubusercontent.com/u/4279480?v=3","gravatar_id":"","url":"https://api.github.com/users/dangranos","html_url":"https://github.com/dangranos","followers_url":"https://api.github.com/users/dangranos/followers","following_url":"https://api.github.com/users/dangranos/following{/other_user}","gists_url":"https://api.github.com/users/dangranos/gists{/gist_id}","starred_url":"https://api.github.com/users/dangranos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangranos/subscriptions","organizations_url":"https://api.github.com/users/dangranos/orgs","repos_url":"https://api.github.com/users/dangranos/repos","events_url":"https://api.github.com/users/dangranos/events{/privacy}","received_events_url":"https://api.github.com/users/dangranos/received_events","type":"User","site_admin":false},"created_at":"2016-06-04T11:39:33Z","updated_at":"2016-06-04T11:39:33Z","body":"Maybe we can fit some custom glyphs in there as well?"}}
{"actor":{"display_login":"dangranos"}}