Need help to exapnd texture compression format

114 views
Skip to first unread message

neil yang

unread,
Jun 30, 2023, 9:00:57 AM6/30/23
to skia-discuss
I programed some code for skia to support more compressed texture formats, including ETC2, BC2, BC3 formats.I found a related issue, https://bugs.chromium.org/p/skia/issues/detail?id=14354.I think it might be able to merge into skia.There are still unit test parts left to be done and there are some issues to be solved.
The existing unit test for compressed textures is generate compressed texture data in solid color and then convert it to SkImage, which includes the process of encoding.It is difficult to encode without relying on third party libraries. But if I introduce the third-party library in skia, it will involve compiling the file to make my commit too complicated. And the encoding and decoding would only involve unit testing and would not affect the compressed textures upload to GPU and use. Is there a simpler way to implement unit tests? or is it possible to read the local compressed texture file directly?
Looking forward to members of the skia project team or anyone interested in discuss with me about this issue and helping me to be able to submit patches successfully.
Anyone who wants to know more about the code can contact me by email.

Brian Salomon

unread,
Jun 30, 2023, 9:36:05 AM6/30/23
to skia-d...@googlegroups.com
Skia has a resources/ directory. Many tests use files under that directory. It seems like you could put pre-compressed textures and load them with GetResourceAsData in declared in tools/Resources.h

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/01d207d6-2381-4036-bd42-83054585fd1cn%40googlegroups.com.

craste...@gmail.com

unread,
Jun 30, 2023, 2:45:01 PM6/30/23
to skia-discuss
Is there a good example of how to make a custom raster file format reader?  Lets say I know how to read a Targa  (.TGA) file format.  I have never done it, but plan to one day. (not a TGA, but other things) and it would be nice to follow an example.

Brian Salomon

unread,
Jun 30, 2023, 3:50:34 PM6/30/23
to skia-d...@googlegroups.com
I think Neil is talking about actually upstreaming support to Skia's GPU backend for additional compressed texture formats, not supporting them externally. The latter isn't really possible without forking Skia.

But adding support for additional image codecs is possible. I don't know of any third party examples but you can look at the subclasses of SkCodec within Skia. Once you have a subclass you register it using SkCodecs::Register() so that Skia will invoke it if an image is made from a data object with that encoding.

craste...@gmail.com

unread,
Jun 30, 2023, 4:08:16 PM6/30/23
to skia-discuss
Okay, thanks. I misunderstood the topic.

neil yang

unread,
Jul 4, 2023, 10:17:42 AM7/4/23
to skia-discuss
Thank you.I Seems like the easiest way to load compression texture.
Reply all
Reply to author
Forward
0 new messages