Commit graph

7 commits

Author SHA1 Message Date
Pavel Krajcevski
53fe825e49 Add first pass of atomic implementation.
This is a first pass of what I believe to be a not too terrible
implementation of a cooperative thread-based compressor. The idea is
simple... If a compressor is invoked with the same parameters on multiple
threads, then the threads cooperate via an atomic counter to compress the
texture. Each thread can take as long as possible until the texture is finished.

If a caller calls a compression routine that has different parameters, then
it will help the current compression finish before starting on its own compression. In this
way, we can split the textures up among the threads and guarantee that we maximize the
resource usage between them. I.e. this becomes more efficient:

Thread 1:    Thread 2:   Thread N:
  tex0         texN        tex(N-1)N
  tex1         texN+1      tex(N-1)(N+1)
  ..           ..          ..
  texN-1       tex2N       tex(N-1)N

I have not tested this for bugs, so I'm still not completely convinced that it is deadlock-free
although it should be...
2013-03-06 18:47:15 -05:00
Pavel Krajcevski
8cad373e8e Small refactoring changes. 2013-02-05 21:54:06 -05:00
Pavel Krajcevski
5eba3ba6f7 Add license 2012-11-15 11:51:55 -05:00
Pavel Krajcevski
1e6a2d4c7b Add new compression function that collects preliminary stats. 2012-10-31 17:48:52 -04:00
Pavel Krajcevski
341842d725 Make sure to not even compile the definition for the SIMD function. 2012-09-13 17:43:58 -04:00
Pavel Krajcevski
87375f4c14 Change signed to unsigned in order to match the function pointer typedef prototype.
Changed the function prototype to match that of the typedef in the rest of the library, and fixed a bug where we would iterate too far with the initial buffer.
2012-08-28 19:40:00 -04:00
Pavel Krajcevski
efdca4b5bb Initial commit with a few modifications 2012-08-24 15:56:45 -04:00