posila / vivante_swizzle Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rygorous/vivante_swizzle
Texture swizzle with supertiling for Vivante chips
License: Other
This project forked from rygorous/vivante_swizzle
Texture swizzle with supertiling for Vivante chips
License: Other
I wrote the post "Texture tiling and swizzling" (http://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/) almost exactly 3 years ago, but I never did a proper example, simply because all the actual implementations of that technique that I'd written up to that point were for hardware I had signed NDAs for. Well, today I got a question about this relating to the "Supertiling" scheme used by Vivante chips (https://github.com/laanwj/etna_viv/blob/master/doc/hardware.md#texture-tiling). As it happens, that scheme matches the model described in the article exactly, is relatively simple, and most importantly, I've never signed any NDAs with (or gotten hardware docs from) Vivante, so there shouldn't be any legal problems. So here goes: a full implementation of the technique as intended, for a format used by actual existing GPU hardware, plus small test driver. This code is optimized for readability not maximum performance; but I think it shows off the key ideas quite well. In particular, I really want to emphasize that, within the model described in my blog post, the code snippets are *completely generic*. All knowledge about the texture layout is contained in the "swizzle_*" functions and the (small) unrolled inner loop for the aligned center part in "swizzle_32bpp". And none of these functions get called inside the inner loops, so it really is possible to write a generic swizzler, passing in the "swizzle_*" functions as an interface, function pointers or the like. This code only implements RGBA/RGBx formats with 32 bits per pixel, since that's what was described in the docs. However, again, this requirement is fairly superficial. The same approach can be used with different bits per pixel; you'd probably want one set of inner loops for every bit depth used. - Fabian "ryg" Giesen, January 2014
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.