TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

An Old Problem Meets Its Timely Demise

127 pointsby Fzzrover 11 years ago

5 comments

corysamaover 11 years ago
Way back on the original Xbox and PlayStation2, the framebuffer and the textures were in the same memory space. And coincidentally, because you had complete control over the machine, you could construct a texture using any memory address --including that of the framebuffer! This was very not recommended. Both the internal memory layouts and the order-of-operations of memory reads and writes from different pixel operations were explicitly undefined in every hardware graphics API ever so that different GPUs could be free to have wildly different implementations. Here are some examples: <a href="http://www.youtube.com/watch?v=ZJU_CO6gRfs" rel="nofollow">http:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=ZJU_CO6gRfs</a> and <a href="http://www.g-truc.net/post-0597.html" rel="nofollow">http:&#x2F;&#x2F;www.g-truc.net&#x2F;post-0597.html</a><p>On the consoles, the memory formats and layouts were well defined, but the order of operations were not. And indeed, if you tried to draw anything that wasn&#x27;t a pointless memcpy(src, src, sizeof(src)) while using the framebuffer as a source texture, you would get random, rectangular and z-shaped (morton order) glitches because of out-of-order operations stemming from the aliased source and dest buffers.<p>However... My goal was a blurry, streaky, screen distortion effect in the weapon trails --to look like the blades were so awesome they caused refraction by cutting the air ;) I found that by sampling the framebuffer from four locations along the weapon&#x27;s line of motion, the glitches were blurred and streaked out to the point that they really were not objectionable :D<p>To do the effect according to the spec (and without glitches) I would have had to copy the whole framebuffer to a temp buffer. That would have been simply too expensive for such a small visual difference. What did ship looked great and the framebuffer-feedback feature added effectively zero cost. But, I felt kinda bad for future (now long past) emulator writers who would later try to support my out-of-spec use of the hardware which is simply not allowed by desktop APIs. (AMD&#x27;s Mantle might expose it. We&#x27;ll see...)
评论 #7016300 未加载
Danieruover 11 years ago
One thing I noticed when contributing to PPSSPP was now familiar the programmers were with bits. Bit shifts, masks, bitwise ands against integers, lots of &#x27;em. I saw more complex bit manipulation in the user input handling than I remember seeing in linux&#x27;s task struct handling!<p>I don&#x27;t think the programmers were showing off, just they&#x27;ve become familiar with bits on a level beyond normal. Like how the linux guys are familiar with double star pointers.<p>On that note I would like to encourage you the reader to contribute to an emulator. They are an intertesting problem space similar to a compiler&#x27;s backend, but with fewer unit tests.
评论 #7016151 未加载
Maxiousover 11 years ago
&gt; Another candidate for &quot;why you shouldn&#x27;t pay programmers per line of code&quot;<p>&gt; <a href="https://code.google.com/p/dolphin-emu/source/detail?r=ed67d1ae2f9693ed42867a2e79b7cae4427574e3" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;dolphin-emu&#x2F;source&#x2F;detail?r=ed67d1...</a> #2charsfix<p>&gt; <a href="https://twitter.com/delroth_/status/419782330354380800" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;delroth_&#x2F;status&#x2F;419782330354380800</a>
lukecampbellover 11 years ago
If anyone wants to go digging through the Nintendo GX API, the link is below.<p>[1]: <a href="http://morukutsuland.free.fr/data/GX.pdf" rel="nofollow">http:&#x2F;&#x2F;morukutsuland.free.fr&#x2F;data&#x2F;GX.pdf</a>
gatehouseover 11 years ago
Mental conversion between binary, octal, decimal, and hex is a minefield.