Commit graph

172 commits

Author SHA1 Message Date
Pavel Krajcevski
cd17ddaa0b Add check for Clang. 2013-03-11 14:51:32 -04:00
Pavel Krajcevski
fa56d37080 Fix a few bugs in our atomic compression algorithm 2013-03-11 14:41:25 -04:00
Pavel Krajcevski
7c3b3d8144 Fix a few bugs in our CompressionJobList's 2013-03-11 14:41:08 -04:00
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
abd3961a09 Add a new interface to compressing files which we will call a 'compression job' 2013-03-09 13:22:42 -05:00
Pavel Krajcevski
8054740900 Don't freak out if the file already exists... overwrite it. 2013-03-07 02:43:33 -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
b1ccdb1359 Added header files for libpng 1.5.13 in order to properly match the compiled libraries. 2013-03-07 02:34:09 -05:00
Pavel Krajcevski
e150d4ee18 Add -a flag to unix command line tool as well 2013-03-07 02:31:21 -05:00
Pavel Krajcevski
9a5e0d197d Fixed a lot of untested bugs with our windows filestream 2013-03-07 02:31:01 -05:00
Pavel Krajcevski
da0d2be695 Small cosmetic and newline change 2013-03-06 21:02:33 -05:00
Pavel Krajcevski
dbabd5e399 Add command line option to choose atomics path for compression. 2013-03-06 20:58:01 -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
da010a465f Formatting fixes 2013-03-06 20:52:15 -05:00
Pavel Krajcevski
2a41e873fa Add function for compressing a texture using atomics... 2013-03-06 20:44:25 -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
2127c04987 Add flag to compression settings to use atomics. 2013-03-06 19:01:31 -05:00
Pavel Krajcevski
c475ee1dec Use standard library min/max 2013-03-06 19:01:19 -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
8ebdc30394 Add Yield function to global namespace
In order to develop a threadsafe texture compression function, we will need
to preempt threads in order to not kill performance while we initialzie everything...
2013-03-06 17:29:22 -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
aebeb38ad0 Reformat usage string. 2013-02-07 17:01:21 -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
ff1c3658fb Always set all of the compiler warnings on and make sure to include the MSFT extensions if we're on gcc. Furthermore, include an option to treat warnings as errors. I will probably always have this on, but other people who decide to use the library probably won't want it... 2013-01-28 18:11:29 -05:00
Pavel Krajcevski
42e4e8d4aa Amalgamate the different architecture problems with printf... 2013-01-28 17:49:57 -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
1b30efe488 Got rid of some more compiler warnings. 2013-01-28 16:57:15 -05:00
Pavel Krajcevski
08df6f6d65 Fix more compiler warnings. 2013-01-28 16:42:11 -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
28a55cc268 Remove pedantic flag because some things are just obnoxious (like no anonymous structs in unions. 2013-01-28 16:29:52 -05:00
Pavel Krajcevski
3cd699ab58 Add compiler flags to GCC or G++ to treat warnings as errors. 2013-01-28 11:54:47 -05:00
Pavel Krajcevski
f03d381092 Fix indentation in unix command-line tool and also make sure to not use strcat for our logfile since it messes up the compressed image output. 2013-01-28 11:51:36 -05:00
Pavel Krajcevski
cdbf72b6c0 Merge MSVC support into master. 2013-01-28 11:49:03 -05:00