Commit Graph
884 Commits
Author SHA1 Message Date
Philip Rideout 16088760c8 Update VulkanTexture constructor for TextureUsage. 2019-02-01 17:10:45 -08:00
Mathias Agopian 8298520f0a TextureUsage is now a bitmask, which makes it more flexible. 2019-02-01 17:10:45 -08:00
Philip Rideout 0595e8f7a6 Fix GL error seen with skinning due to UBO size.
This fixes an INVALID_OPERATION at draw call time with skinned
renderables. We do not see this error with Adreno drivers, but we saw it
with WebGL, and technically our usage was not spec compliant.
2019-02-01 16:56:06 -08:00
Ben Doherty 2972060cd0 Add scripts for combining static libraries (#769) 2019-02-01 15:38:48 -08:00
Philip Rideout 69de626ead Rename built-in shader inputs to "inputs" instead of "variables".
In the public docs and materials API, Filament "variables" are custom
interpolants (outputs of VS, inputs of FS). However we internally used
"variables" to also refer to built-in VS inputs.

CodeGenerator had a generateVariable method and a generateVariables
method, which did something completely different. :)
2019-02-01 13:20:13 -08:00
Adrian Perez 694d5a397e Typo fixes 2019-02-01 11:26:58 -08:00
Philip Rideout 92098d2610 Fix vk_imgui crash by allowing zero-sized uniform buffers.
The vk_imgui sample regressed in December or so, after some changes in
how Filament manages uniform buffers. This commit makes the Vulkan
driver more consistent with the GL driver, which does a check for
zero-sized buffers.
2019-02-01 09:55:23 -08:00
Philip Rideout 0b71691a61 Simplify VkCommandBuffer management. 2019-02-01 09:55:23 -08:00
Philip Rideout 6556345941 Vulkan: support WaitForIdle before swap chain construction. 2019-02-01 09:55:23 -08:00
Mathias Agopian d1aecf864f allocator's free() must take 2 parameters 2019-01-31 17:36:19 -08:00
Philip Rideout 01c2d31484 Implement blit in VulkanDriver.
Fixes #749.
2019-01-31 15:23:54 -08:00
Philip Rideout 18bff7ef5e Repair generateMipmaps for cubemaps.
This functionality regressed when we replaced the OpenGL implementation
with our own.

I proved both the regression and the fix by running suzanne with the
following hacks.

```
--- a/libs/image/include/image/KtxUtility.h
+++ b/libs/image/include/image/KtxUtility.h
@@ -129,8 +129,9 @@ namespace KtxUtility {
             for (uint32_t level = 0; level < nmips; ++level) {
                 ktx.getBlob({level, 0, 0}, &data, &size);
                 PixelBufferDescriptor pbd(data, size * 6, dataformat, datatype, cb, cbuser);
-                texture->setImage(*engine, level, std::move(pbd), Texture::FaceOffsets(size));
+                if (level == 0) texture->setImage(*engine, level, std::move(pbd), Texture::FaceOffsets(size));
             }
+            texture->generateMipmaps(*engine);
             return texture;
         }

--- a/samples/app/IBL.cpp
+++ b/samples/app/IBL.cpp
@@ -54,7 +54,7 @@ IBL::~IBL() {
 bool IBL::loadFromKtx(const std::string& prefix) {
     // First check for compressed variants of the environment.
     Path iblPath(prefix + "_ibl_s3tc.ktx");
-    if (!iblPath.exists()) {
+    if (true || !iblPath.exists()) {
```
2019-01-31 13:57:30 -08:00
Philip Rideout 41a1250598 Skinning: fix buffer overrun for non-zero bone offsets.
Fixes #764
2019-01-31 12:39:16 -08:00
Philip Rideout 2800f58aa1 Add jniLibs search path to filament-android for Vulkan.
This allows Filament to find validation layers in debug builds.
2019-01-30 16:33:54 -08:00
Adrian Perez 7ba46ef5f1 Add explicit includes for types not implied in all stdlib impls sceneform-1.7pr5 2019-01-30 16:08:57 -08:00
Benjamin Doherty 21f0aa5fb4 Enable custom allocator test for Windows 2019-01-30 16:05:49 -08:00
Mathias Agopian 8bdae79536 added rebind copy-ctor to STLAllocator
this should fix the build on windows debug
2019-01-30 16:05:49 -08:00
Mathias Agopian 0bdb6b8a8a workaround a compile error with some compilers 2019-01-30 16:05:49 -08:00
Philip Rideout 447f44539f Add warning to GenMipmaps for non-renderable formats. 2019-01-30 11:03:54 -08:00
Philip Rideout 0a9be8f9b2 Remove generateMipmaps from DriverAPI. 2019-01-30 11:03:54 -08:00
Philip Rideout d0df2e1336 Replace glGenMipmap with our own implementation. 2019-01-30 11:03:54 -08:00
Philip Rideout f690d5e69c Suzanne now tests generateMipmaps. 2019-01-30 11:03:54 -08:00
Philip Rideout 4ffd790fd6 GL blit now updates baseLevel / maxLevel of target texture.
This not only paves the way for our own mipmap generator routine, but
also better aligns the semantics of blit with setTextureData.

Motivated by #749.
2019-01-30 11:03:54 -08:00
Ben Doherty c29fcc7668 Fix typo in iOS readme 2019-01-29 18:13:38 -08:00
Mathias Agopian ae6ab66af4 fix #755: a race condition cousing a deadlock
This reverts a JobSystem optimization that attempted to avoid signaling
a condition when there was no waiters. Unfortunately, there was a
race that caused the the signaling thread to miss that the waiter flag
was set, thus not signaling.
sceneform-1.7pr4
2019-01-29 15:40:25 -08:00
Ben Doherty 7be3994c96 Add Metal shading language compilation to matc (#752) 2019-01-29 12:44:58 -07:00
Ben Doherty 836b641bff Add filamat-jni to CMake and build.sh (#740) 2019-01-29 12:34:04 -07:00
Tim van Scherpenzeel 44bfac85e9 added quiet flag 2019-01-29 11:04:58 -08:00
Romain Guy a141abd212 Fix Kotlin compilation error 2019-01-29 09:39:00 -08:00
Romain Guy 12aba0f1b7 Code cleanup 2019-01-29 09:36:18 -08:00
Philip Rideout 40666bdd23 HwTexture now remembers the format.
We were stashing the GL format but not the Filament format.

This simplifies VulkanTexture and will allow us to implement a very
simple mipmap generator in DriverBase.

Motivated by #749.
2019-01-29 08:59:36 -08:00
Romain Guy 66d71be300 Fix HDR ImageDecoder for width < 8 or > 32767 2019-01-28 15:16:53 -08:00
Romain Guy 614a832be0 Code cleanup in ImageDecoder.cpp 2019-01-28 15:16:53 -08:00
Ben Doherty 92de93bfb8 Add Metal skeleton code (#714) 2019-01-28 15:29:37 -07:00
Romain Guy c1b7f2ac27 Property write small .hdr files (#750)
* Cleanup ImageEncoder code

* Properly write HDR files when width < 8 or > 32767

A little oddity in the original Radiance file format encoding.
2019-01-28 14:02:28 -08:00
Philip Rideout 6110809d23 JNI fix for badly-sized PixelBufferDescriptors. (!)
Amazingly, the size field in PixelBufferDescriptor was often totally
incorrect for Java-based clients. The reason we did not notice: OpenGL
often consumes a pointer to image data without consuming a byte count
(e.g. glTexImage2D).

OpenGL infers size from dimensions + format, but Vulkan does not. This
caused texture corruption with Vulkan on Android.

This fix follows a pattern used in other places such as
FRenderer::readPixels.
2019-01-26 09:59:06 -08:00
Romain Guy 81a52411ed Clarify Fresnel term for IBL implementation of clear coat 2019-01-25 13:49:44 -08:00
cubeleo 6956154d62 mipgen: Disambiguated string with std:: prefix. (#741) 2019-01-25 09:02:11 -08:00
prideout 9940a68165 Stipulate clang 7 in README to align with Kokoro. 2019-01-24 12:06:00 -08:00
Philip Rideout c3d957671d Work around FXAA issue with Vulkan Adreno drivers.
Fixes #732.
2019-01-24 11:48:02 -08:00
Mathias Agopian fbb7e1f2ef Use a linear allocator for all our std::vector<> 2019-01-23 19:14:28 -08:00
Mathias Agopian 6e90d73e24 fix PassNode move ctor 2019-01-23 19:14:28 -08:00
Mathias Agopian 07c1dbb5f4 fix typo causing a memory corruption in STLAllocator<>
We were allocating n*sizeof(n) instead of n*sizeof(T). Thankfully, 
we were not using STLAllocator anywhere.
2019-01-23 19:14:28 -08:00
Philip Rideout 4e0749f0ae Add another folder to the build's "clean" task.
Gradle creates a hidden .externalNativeBuild folder when issuing CMake
for the first time. This folder contains cached command line parameters
that get passed to CMake, and these can become stale when switching
between "normal" Android builds and Vulkan-enabled Android builds, which
leads to frustrating build errors.
2019-01-23 17:12:56 -08:00
Ben Doherty f5bd28b7df Update linux README with CXXFLAGS (#736) 2019-01-23 16:39:34 -08:00
Ben Doherty ad4c4148f4 Add filamat-jni Gradle project (#733) sceneform-1.7pr3 2019-01-23 13:58:43 -08:00
Mathias Agopian a35762bdf2 compute discard flags for all attachments 2019-01-22 10:49:22 -08:00
Mathias Agopian 1ca2b1b642 calculate rendertarget's discard flags properly 2019-01-22 10:49:22 -08:00
Mathias Agopian 373e519292 slog.* << io::hex now prefixes values with 0x 2019-01-22 10:49:22 -08:00
Mathias Agopian acea32aae8 more validation in the framegraph
- validate that a pass actually uses a resource when requesting the
  concrete (Driver) handle.

- introduce a "blit" usage for a resource, which indicates that a 
  resource will be used as the source of a blit operation. This is
  unfortunatelly needed because blit operations work on rendertargets,
  not textures for the source.
2019-01-22 10:49:22 -08:00