Code Monkey home page Code Monkey logo

texpresso's People

Contributors

arturoc avatar jansol avatar localthomas avatar w-flo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aerocatia

texpresso's Issues

Need better control for parallelism

It appears that, currently, if I want to contol the parallel compressions of multiple textures, the choice is either enable rayon or reimplement fn compress() myself. I think it could be done better. For example, compress could be implemented on top of a helper like this:

fn compress_block_iter() ->impl Iterator<Item = BlockIndex>;

This way, if I want rayon, I will just convert the regular iterator into sequential with something like into_par_iter().

The advantage here is the following:

  1. no dependency on Rayon needed
  2. can support other ways of parallel execution, such as Choir, without too much boilerplate on the user side

Use by `image` crate

There's some talk in image-rs/image#1495 of using this crate to implement DDS encoding/decoding for image. The two main things we'd be looking for are support for BC4/BC5 (most of the code already exists for BC3 handling so it would just be a matter of exposing it), and to get a new version published on crates.io. Would you be open to this?

Optimize memory use

The current implementation works purely on RGBA buffers, and also creates an extra copy of each 4x4 chunk as it is being processed. This is not very ideal and it would be nice to refactor things to allow passing in buffers that don't have extra channels as padding, especially now that one- and two-channel formats are supported.

Documentation on `docs.rs` is incomplete

At the moment, https://docs.rs/texpresso/2.0.1/texpresso/ describes only a handful of API items, but nothing that would tell me how to actually use this crate.
Could you please try brushing up on it a little - at least make the generator also include undocumented items?
The CLI example application included in the repo is also nice of course - but it was not the first place I went to looking for info on how to make use of Texpresso.

API and Error

This is sort of a question/discussion issue:
The current function declarations for compressing and decompressing are missing Error return types or do not specify when they panic in the documentation.

Take the function definition of decompress as an example:

pub fn decompress(self, data: &[u8], width: usize, height: usize, output: &mut [u8])

It is possible to call this function with invalid parameter combinations, e.g. width and height do not match the data length. With the current definition, only panics are supported without any further detail about what's wrong.

I think the ergonomics could be improved by either adding a return value or at least specifying the situations under which a panic occurs in the documentation. I would prefer the first idea, but I am not sure how exactly the return type should look like. Maybe taking inspiration from image could help.

Context: I am currently trying to fuzz the decompress function and get panics everywhere.

Support BC6 and BC7

It would be great to implement support for these. I know it's very involved, and also already planned (based on the README). Current alternatives are scarce - basically bind to the monster of Intel Compressonator, which is it's own language and compiler, as well as a giant non-Rust dependency to carry. Has there be any attempt to implement a BC6/BC7 compressor? Even something bare-bones, to iterate on later, would be good.

For the context, I'm happily using texpresso to cook textures from user facing formats to BCn in Blade. The output of texpresso is cached on disk, so that loading can be instantaneous - just read from disk into GPU memory without any further processing. Now I need support for environment textures (coming in as EXR), and BC7 is the target. Thank you for the awesome work, and I hope to see texpresso grow!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.