Commit Graph

224 Commits

Author SHA1 Message Date
Philip Rideout
6f601e6021 Update KTX files and allow glFormat = LUMINANCE 2018-12-06 10:33:49 -08:00
Sebastian Hartte
339483b8e2 Consider the correct KTX header attribute to determine the data format 2018-12-06 10:33:49 -08:00
Sebastian Hartte
cfa486275a Install the image library as well 2018-12-05 17:57:20 -08:00
Mathias Agopian
7ab25ff4a2 improve libmath benchmark 2018-12-05 17:19:47 -08:00
Philip Rideout
8bb68b3c55 Rename MeshIO class to MeshReader.
This makes the name symmetrical with MeshWriter.
2018-12-05 17:15:52 -08:00
Philip Rideout
beaf751604 filamesh: Compress attributes individually.
This further reduces compressed suzanne from 333489 bytes to 272761.

Tested with vk_hellopbr and tutorial_suzanne.html

Issue #558
2018-12-05 17:15:52 -08:00
Philip Rideout
6c55b3b989 filamesh: Add support for COMPRESSION.
Note that the WebGL build uses filameshio, but Android does not. Our
Android samples therefore do not yet understand the compressed format.
For web, I measured the before / after:

```
BEFORE: filament.wasm = 505796, suzanne.filamesh = 521476
 AFTER: filament.wasm = 510915, suzanne.filamesh = 333489
```

Issue #558
2018-12-05 13:20:55 -08:00
Philip Rideout
b4b12914a1 Add bitcast to utils. 2018-12-04 17:56:37 -08:00
Philip Rideout
ff2da6e3b4 Add zeux/meshoptimizer to third_party.
This also adds it as a dependency to filameshio. This does not seem to
increase the size of the WebGL build even though filameshio is a
dependency, perhaps because we are not using it yet.
2018-12-04 16:36:56 -08:00
Philip Rideout
fff76bfa3e Resurrect the NOOP driver. 2018-12-04 14:34:16 -08:00
Ben Doherty
f05b2f47a8 Fix use of UV0 and UV1 coordinates (#576)
* Fix use of UV1

* Add a test case

* Spelling
2018-12-04 13:23:01 -08:00
Ben Doherty
2b6499fb18 Deprecate MaterialBuilder::postprocessor (#569)
* Deprecate postprocessor

* Remove unimplemented method
2018-12-04 10:11:52 -08:00
Philip Rideout
1ec037aeca filamesh: Remove duplicated code. 2018-12-03 14:18:12 -08:00
Philip Rideout
a7d6af8d22 filamesh: Add support for TEXCOORD_SNORM16. 2018-12-03 14:18:12 -08:00
Mathias Agopian
6d68a4a4c6 libmath benchmarks 2018-12-03 11:58:30 -08:00
Philip Rideout
edda436405 Documentation for new filamesh flags, etc. 2018-12-02 16:46:31 -08:00
Philip Rideout
61992f556c Add unit test for filamesh.
The motivation behind a new regression test is the fact that we will
soon be adding compression features to filamesh.
2018-12-02 16:46:31 -08:00
Philip Rideout
aa3a7085cc Factor out common filamesh / meshio code.
This creates a filamesh namespace and removes several duplicated
classes, including Box and filamesh::Header.
2018-12-02 16:46:31 -08:00
Philip Rideout
af799e734a FilamentApp can now use KTX environments.
When cmgen creates ktx files, it creates a pair: one with an _ibl suffix
and one with _skybox. This convention is now honored by FilamentApp.

Note that we already have several KTX environments in the repo, so you
can clone a fresh repo and do:

  gltf_viewer --ibl={FILAMENT}/docs/webgl/pillars_2k DamagedHelmet.gltf

Note that we have several hundred files in samples/envs, we should
consider replacing those or copying the environments in docs/webgl
(which git would internally de-dup, due to content hashing).
2018-11-30 14:09:04 -08:00
Philip Rideout
7366bdb500 More KtxUtility improvements.
This makes it easier for C++ clients to use KTX files and simplifies
the JavaScript bindings.
2018-11-30 13:16:47 -08:00
Philip Rideout
bcfe03c8e1 KtxUtility improvements.
This makes it easier for C++ clients to use KTX files and simplifies
the JavaScript bindings.
2018-11-29 16:39:30 -08:00
Mathias Agopian
e8895fee11 Add a binary search benchmark
this one basically shows that the stl is is a good as our "branch less"
versions. this is because clang generate branchless code in the end.
2018-11-29 11:44:52 -08:00
Mathias Agopian
42a3d5ea33 use utils::Mutex instead of std::mutex for Allocators locking policy
on Android it's about 2x faster and uses much less instructions, which
is better for i-cache pressure.
2018-11-29 11:44:52 -08:00
Mathias Agopian
785ce645e2 pool allocators benchmark
this benchmark shows that, as we expected, on Android mutexes,
spinlocks and lock-free algorithms are running at similar performance.
2018-11-29 11:44:52 -08:00
Ben Doherty
fe4907d0ff Remove use of iostream in filamat (#549) 2018-11-29 10:35:37 -08:00
Philip Rideout
239317ee10 Use resgen for libshaders. 2018-11-29 07:37:56 -08:00
Ben Doherty
b759074c8f Deprecate set method on MaterialBuilder (#545)
* Remove the defines entry in material definitions

* Deprecate set function

* Remove some getter methods from MaterilaBuilder

* Fix tests, add to CI
2018-11-28 15:35:19 -08:00
Ben Doherty
3a677fa832 Fix matc crash (#546) 2018-11-28 15:00:45 -08:00
Mathias Agopian
cf5606e940 Fix another bug in AtomicFreeList
An assert checking invariants would sometime trigger, the problem
was a logic error that would be exposed by a race when running out
of space in the list.

The root of the problem is that in one place we were not remapping the 
-1 offset to nullptr, storing a pointer violating our invariants.

Also added more asserts!!!
2018-11-28 12:10:23 -08:00
Philip Rideout
91abaf575b Add tangents utility to fix #532.
I tested this by writing a quick-and-dirty Sphere demo.
2018-11-28 11:27:37 -08:00
Mathias Agopian
05854e0d05 port the "filament_calls" benchmark to google benchmark 2018-11-27 15:07:45 -08:00
Ben Doherty
a1ed3b81a3 Move static code analysis into filamat (#534)
* Handle static code analysis automatically

* Fix matc test cases

* Only call InitializeProcess once per process
2018-11-27 14:11:27 -08:00
Sebastian Hartte
6b030c9694 More documentation of the free list 2018-11-27 11:44:32 -08:00
Sebastian Hartte
df4a2bb86e Fixes #542 by moving the assert to after checking for a possible race condition 2018-11-27 11:44:32 -08:00
Ben Doherty
0548b28535 Update glslang (#526)
* Update glslang

* Update builtinResource

* Add glslang update README
2018-11-27 09:52:03 -08:00
Ben Doherty
594f1abbbc Rename GlslChunk to TextChunk (#527)
* Rename Glsl -> Text

* Make MaterialTextChunk and DictionaryTextChunk more generic
2018-11-26 14:02:04 -08:00
Pixelflinger
cf4410f656 Add some libutils benchmarks 2018-11-26 11:51:17 -08:00
Pixelflinger
bc0f2f26f2 Tweak Profiler API so it works in multithread
Instead of using a singleton, Profiler has to be instantiated in the
scope/thread it is used.
2018-11-26 11:51:17 -08:00
Ben Doherty
6d158bbc80 Remove codeGenTargetApi (#511) 2018-11-26 10:51:34 -08:00
shartte
9ab9333fa5 Fixes various MSVC issues in public headers (#523) 2018-11-26 09:17:19 -08:00
Mathias Agopian
d1b19efa55 a fast approximation of pow() and pow(x, 2.2f)
fast::pow(x, 2.2f) is about 100x faster than std::pow.
std::pow(x, 2.2f) takes roughly 1000 cycles.
2018-11-21 13:46:56 -08:00
Mathias Agopian
9e39004b1f Add wait_for and wait_until to our Condition implementation
We're using timed condition variable in one place, but the STL version
pulls in a lot of code because it does clock calculations in 
"long double" (!!!!). Since we already had an implementation
of condition_variable, we just add the timed version.
This saves several KiB of code.

Also don't use unique_lock() lock/unlock because it can throw exceptions.
2018-11-21 13:46:07 -08:00
Mathias Agopian
1212728e45 get rid of std::string in OpenGLProgram
This was generating tons of code.
2018-11-21 13:46:07 -08:00
Mathias Agopian
815fb36b98 code size optimizations
- prevent unrolling of some loops. e.g. one loop generated more than
  1 KB of code!
2018-11-21 13:46:07 -08:00
Mathias Agopian
5bcc4cfff1 Improve the slow-path of creating a program
This removes a lot of heap allocations/deallocations, and reduces
code size. Most improvements come from using CString and
StaticString instead of std::string and better using move
semantics.
2018-11-21 13:46:07 -08:00
Mathias Agopian
c1a7164084 Improve usage of CString
This cuts down 7 calls to free() to 1, when
instantiating a new program. There are still many low-hanging fruits
there.
2018-11-21 13:46:07 -08:00
prideout
776284b2b5 Raise sampler limit to 16.
In practice this limits materials to 10 samplers since Filament uses 5
for lights and skips 1 slot for the post-process sampler. This can
probably be optimized.
2018-11-20 16:05:16 -08:00
prideout
cfa9895b96 Improve error reporting for bindings overflow.
We now check for sampler overflow during material compilation rather
than waiting for run-time checks. This allows for Kokoro-based
validation of sample materials, and allows developers to catch this
issue in their asset pipeline.

We should also probably raise the upper limit (Qualcomm allows up to 16
samplers in their Vulkan implementation) but that can be a separate PR.

Fixes #507
2018-11-20 15:28:02 -08:00
Ben Doherty
b5fa822e86 Move GLSLPostProcessor and dependencies into filamat (#500)
* Move GLSLPostProcessor into filamat
2018-11-20 12:30:26 -08:00
Philip Rideout
aa0090a85b Fix build warnings. 2018-11-19 15:59:31 -08:00