Code Monkey home page Code Monkey logo

bc7e's People

Contributors

richgel999 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar

bc7e's Issues

Max Quality Suggestion

This isn't an issue just a minor suggestion for improving image quality in the future.

The encoder takes data that has already been rounded to u8, but if instead it took data as u16 or float, as most game source images these days are u16, it would be possible for the encoder to more accurately match the original image.

I think this would be particularly useful for normal maps, rounding to u8 and then having the BC7 encoder round a 2nd time can be pretty destructive to quality.

Results can be SIMD-width dependent due to all() usage in estimate_partition_list

Mostly for learning purposes I'm playing around with porting bc7e to a GPU compute shader (it's a world of pain due to shader compilers, drivers, etc. -- nothing to do with bc7e itself, just the whole compute shader ecosystem leaves a lot to be desired), and noticed that in some cases the produced results are different depending on compute shader threadgroup size.

Seems that across whole bc7e code there's exactly one place that does anything "between the SIMD lanes" (everything else is just per-lane code without interaction with other lanes). It's this piece in estimate_partition_list() -

if ((total_subsets == 2) && (partition == BC7E_2SUBSET_CHECKERBOARD_PARTITION_INDEX))
{
    if (all(i >= HIGH_FREQUENCY_SORTED_PARTITION_THRESHOLD))
        break;
}

if I disable that part in ISPC code, then I can get the GPU results to match CPU.

If I understand this code correctly, it's a heuristic optimization, along the lines of "if we got this far into partitions, skip checking later ones since they likely won't matter".

But not exactly sure why there's an all(i >= threshold) which makes it potentially produce different results depending on SIMD width (e.g. SSE4 vs AVX2 vs AVX512). Just using a regular i >= threshold would make the results not be dependent on SIMD width.

Able to be embedded in a single executable?

Is bc7e able to be embedded in a single executable and without openmp / ucrt / crt?

I remember ispc not being able to do this 3-4 years ago.

This is for use in Godot Engine.

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.