Commit Graph

57 Commits

Author SHA1 Message Date
Pavel Krajcevski
ae2324153d Repurpose the rest of our scaffolding to use Compression Jobs 2013-03-09 13:36:39 -05:00
Pavel Krajcevski
435f935de3 Update atomics compression algorithm
In general, we want to use this algorithm only with self-contained compression
lists. As such, we've added all of the proper synchronization primitives in
the list object itself. That way, different threads that are working on the
same list will be able to communicate. Ideally, this should eliminate the
number of user-space context switches that happen. Whether or not this is
faster than the other synchronization algorithms that we've tried remains
to be seen...
2013-03-09 13:34:10 -05:00
Pavel Krajcevski
1aa62003b9 Apparently rand() returns zero too. Avoid that. 2013-03-07 02:43:08 -05:00
Pavel Krajcevski
42e75a5e4c Fix debug image comparison to make sure that the difference in our images takes into account alpha. 2013-03-07 02:35:40 -05:00
Pavel Krajcevski
3d1d1e359f Actually, it turns out the min/max thing was an MSVC issue. 2013-03-06 20:57:05 -05:00
Pavel Krajcevski
599ded49d1 Remove global scope min/max 2013-03-06 20:38:00 -05:00
Pavel Krajcevski
bacf327246 Fix MSVC compiler errors with the atomics 2013-03-06 19:57:20 -05:00
Pavel Krajcevski
342614a6ec Fix the horribly wrong check for atomic support with MSVC 2013-03-06 19:56:38 -05:00
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
4d6e75ab97 Fix whitespace issues
Why do I do this so much?
2013-03-06 18:27:34 -05:00
Pavel Krajcevski
2deb71eec9 Generalize the ALIGN macro 2013-03-06 17:23:17 -05:00
Pavel Krajcevski
ca85a663a1 Add detection for atomics
Atomic operations are both supported by the platform and the compiler. If we want
to provide a threadsafe implementation of our compression function, we need to make sure
that the proper settings are available.
2013-03-06 17:16:36 -05:00
Pavel Krajcevski
771b91b795 Fix a bunch of memory leaks. 2013-02-07 17:01:38 -05:00
Pavel Krajcevski
8cad373e8e Small refactoring changes. 2013-02-05 21:54:06 -05:00
Pavel Krajcevski
8ca5d7ac44 Add interface between buffers and parallel stages. 2013-01-30 23:37:18 -05:00
Pavel Krajcevski
5e970c3122 Make compiler happy. 2013-01-30 22:53:35 -05:00
Pavel Krajcevski
f704fc55af Flesh out the first few functions for our parallel stages. 2013-01-30 22:43:19 -05:00
Pavel Krajcevski
ea16d1af44 Add beginnings of our scaffolding for parallel compression. 2013-01-30 22:43:18 -05:00
Pavel Krajcevski
af25b83356 Fix some more compiler warnings. 2013-01-29 17:37:20 -05:00
Pavel Krajcevski
0afff4188e Fix warnings on Windows and support the treat warnings as errors option. 2013-01-29 13:39:45 -05:00
Pavel Krajcevski
fa5d5e865c Fix some more compiler warnings. This time some were actually very useful\! 2013-01-28 20:20:52 -05:00
Pavel Krajcevski
8c666bcd3f Fix more compiler warnings 2013-01-28 17:37:43 -05:00
Pavel Krajcevski
c7a2e24b07 Fix some more compiler errors 2013-01-28 17:16:36 -05:00
Pavel Krajcevski
08c919d965 Fix some linker errors... 2013-01-28 17:04:58 -05:00
Pavel Krajcevski
aaf16eacc8 Remove SIMD path at the moment. It needs to be reworked. 2013-01-28 16:37:20 -05:00
Pavel Krajcevski
5dd1fbbd48 Fix a lot of compiler warnings. 2013-01-28 16:30:04 -05:00
Pavel Krajcevski
cdbf72b6c0 Merge MSVC support into master. 2013-01-28 11:49:03 -05:00
Pavel Krajcevski
5eba3ba6f7 Add license 2012-11-15 11:51:55 -05:00
Pavel Krajcevski
8761821220 More compiler fixes. 2012-11-07 18:01:02 -05:00
Pavel Krajcevski
680625d03e Fix a bunch of compiler warnings. 2012-11-07 17:10:26 -05:00
Pavel Krajcevski
b43373c0aa Fix some indentation and signedness mismatch 2012-11-07 15:23:07 -05:00
Pavel Krajcevski
790df0736f Make stats collection threadsafe. 2012-11-01 18:56:13 -04:00
Pavel Krajcevski
82e51a49cf Fix a few issues that we had with dealing with alpha in the textures. 2012-10-31 17:50:40 -04:00
Pavel Krajcevski
cc0d75400a Fix two bugs that took a surprisingly long time to find. 2012-10-31 17:50:40 -04:00
Pavel Krajcevski
20c504056f - Add flag to specify whether or not we'd like to collect stats
- Fix amount of interpolation points to use during shape estimation
2012-10-31 17:48:53 -04:00
Pavel Krajcevski
1bd1a79065 Add specific function to collect stats for BPTC so that we have one that preserves accurate running time measurements. 2012-10-31 17:48:53 -04:00
Pavel Krajcevski
4c359f42a7 - Added a parameter to the PCA computation that returns the first and second
eigenvalues of the covariance matrix associated with the cluster.

- Compared results of testing the ratio of eigenvalues as a measurement of
  'linearity' for the different shapes, and output statistics.

- Added a #define that controls whether or not we do shape estimation using
  quantized AABB error or eigenvalue ratios. The former seems to be better.
2012-10-31 17:48:53 -04:00
Pavel Krajcevski
71fbbca1ee Fix a few issues and make sure that when we write out to a file, only the intended values are reported. We still have to fix the accumulated stat reporting and make it thread-safe. 2012-10-31 17:48:53 -04:00
Pavel Krajcevski
fdcd7c2edc Fix crash because I forgot to add stat names 2012-10-31 17:48:53 -04:00
Pavel Krajcevski
93a3b3b92c Add some more stats to BC7 compressor. NOT THREAD SAFE 2012-10-31 17:48:53 -04:00
Pavel Krajcevski
99534bc5d0 Add stats function to serial encoder. Otherwise, continue to use non-stats function in threaded mode. 2012-10-31 17:48:52 -04:00
Pavel Krajcevski
1e6a2d4c7b Add new compression function that collects preliminary stats. 2012-10-31 17:48:52 -04:00
Pavel Krajcevski
2fa4da80ed Fix some inconsistencies with different versions of libpng. 2012-10-31 17:46:12 -04:00
Pavel Krajcevski
78da9499ec Add output for error metric 2012-09-18 19:00:20 -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
ef2a370fc6 Move error metric to regular BC7Compressor so that we can use it even if we can't use SIMD. 2012-09-13 16:57:36 -04:00
Pavel Krajcevski
acd20ea8ac Add flag for when we don't have SSE 2012-09-13 16:56:18 -04:00
Pavel Krajcevski
31f6233da2 Add minor performance enhancements 2012-09-13 16:31:48 -04:00
Pavel Krajcevski
2ad2e94584 Move type defines into core library... all modules should have a standard set of types. 2012-08-30 13:28:28 -04:00
Pavel Krajcevski
8f748ce070 Fix uint to be uint8 since otherwise it's undefined on a lot of platforms. 2012-08-29 11:55:01 -04:00