Compare commits

...

39 Commits

Author SHA1 Message Date
Powei Feng
3ee82dc43f DRAFT testing mdbook installation 2025-07-16 15:55:24 -07:00
Ben Doherty
33da5fa38e Add documentation and flags for generating code coverage report (#8959) 2025-07-16 15:14:08 -07:00
Powei Feng
d136d85402 renderdiff: fix compare.py 2025-07-16 15:03:44 -07:00
Ben Doherty
a44f6d9498 Update renderdiff README.md (#8961) 2025-07-16 14:56:20 -07:00
Powei Feng
b5aeee3dfd renderdiff: upload artifact even when comparison fails (#8960)
Previously, if a comparison fails then the artifacts are not
uploaded.  This is defeats the puprpose of having artifacts. We
fix that by moving the test logic into presubmit.yml.

local_test.sh is the way to repro a run from local machine.
2025-07-16 14:45:51 -07:00
Sungun Park
d5ee54ff7e gl: Move program cache retrieval to the thread pool (#8957)
This commit refactors the ShaderCompilerService to move the logic for
retrieving compiled programs from the cache off the main thread and into
the compiler thread pool.

Previously, the cache lookup was performed on the main thread before a
compilation job was created. If the cache was slow or contained a large
number of entries, this could cause a noticeable stall, impacting
application responsiveness.

By moving the cache retrieval into the compilation task, the lookup now
happens on the background thread. This alleviates the main thread stall.

BUGS=[430628799]
2025-07-16 00:59:03 +00:00
rafadevai
cfd75743a2 vk: Fix pipeline binds (#8952)
When flushing a VulkanCommandBufffer the last bound pipeline in VulkanPipelineCache is not reset, so when starting a new VulkanCommandBuffer recording if the next binded pipeline is the same as the current one the vkCmdBindPipeline is not recorded, causing undefined behavior.

By the spec, the vkCmdBindPipeline only affects the commands in the same vkCommandBuffer. https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdBindPipeline.html#_description

BUGS=429105603,361822355
2025-07-15 22:56:10 +00:00
Mathias Agopian
6fd4f94418 better UBO invalidation
Only invalidate UBOs when the data actually changes. It turns out it's
a fairly common case for application to update MaterialInstance
parameters with the same value; we now check for this before
marking the UBO "dirty".

The overhead of this check should be very small but it could save
many very expensive buffer updates.
2025-07-15 11:24:01 -07:00
Mathias Agopian
e155fad7ef better UBO invalidation
Only invalidate UBOs when the data actually changes. It turns out it's
a fairly common case for application to update MaterialInstance
parameters with the same value; we now check for this before
marking the UBO "dirty".

The overhead of this check should be very small but it could save
many very expensive buffer updates.
2025-07-15 11:24:01 -07:00
Mathias Agopian
3683f94704 move postfx materials into their own cpp
eventually, we'll move postfx materials into their own .a and we'll
have a way to manually register them.
2025-07-15 11:23:36 -07:00
Mathias Agopian
34e2b81855 internal materials are now generated in different resources
instead of using a single resource binary for all materials, each
postfx set of materials (e.g. dof, bloom) gets its own resource file
based on the directory it is in.
2025-07-15 11:23:36 -07:00
Mathias Agopian
edebd8eed8 fix typo missing MaterialInstance::getParameter<mat4f>() 2025-07-15 11:16:25 -07:00
Sungun Park
36f7911917 Release Filament 1.62.1 2025-07-14 23:11:18 +00:00
Powei Feng
f64117fa26 vk: clean-up VulkanContext usage (#8945)
- Make sure that we don't allocate a VulkanContext on the function
   stack since this was passed erroroneously to other components
   and stored as a pointer
 - Use const& to refer to VulkanContext across components for
   consistency.
 - Remove unused VkPhysicalDeviceProtectedMemoryProperties struct.
2025-07-14 19:29:55 +00:00
Jeremy Nelson
1422c8cba9 check if format is compatible with renderpass blit mipmap generation 2025-07-14 14:13:44 -05:00
Mathias Agopian
29ed42fa98 dynamic resolution can be always be enable if minScale==maxScale
normally dynamic resolution is turned off when timerQueries are no
available, but we should still allow it if minScale==maxScale.

FIXES=[428767320]
2025-07-14 10:32:48 -07:00
Powei Feng
93029d2318 vk: clean-up rendertarget msaa setup (#8930) 2025-07-10 21:28:52 +00:00
Juan Caldas
c4a304788f webgpu : Remove try catch (#8936) 2025-07-10 13:33:20 +00:00
Juan Caldas
dfcdc9ca1e Add WebGPU Feature Levels (#8939)
BUGS = [420985749]
2025-07-10 13:05:29 +00:00
Mathias Agopian
dd844b1183 resgen: output offset/size as constants instead of variables
resgen now generates the resources size/offset directly as #define
instead of as an `extern` variable. The assembly file also 
doesn't generate the corresponding global variables, saving some binary 
space.
2025-07-09 17:08:58 -07:00
Sungun Park
a29f3a3011 gl: Enhance error reporting for asynchronous shader operations (#8938)
* gl: Enhance error reporting for asynchronous shader operations

When ShaderCompilerService asynchronously compiles and links shaders,
unexpected errors (e.g., GL_CONTEXT_LOST) can occur after the initial GL
call, complicating diagnostics.

This change improves error context by collecting the GL error status
when querying shader compilation and program link statuses. This
provides a more detailed understanding of error origins.

BUGS=[373396840]

* feedback
2025-07-09 18:33:02 +00:00
Sungun Park
84218f6ba2 gl: More robustly verify cached programs (#8941)
`glProgramBinary` can succeed but result in an unlinked program, for
instance if the graphics driver has been updated. This change adds a
check for `GL_LINK_STATUS` in addition to `glGetError` to ensure the
program is valid.

Also adds more detailed logging on failure.

BUGS=[430290459]
2025-07-09 17:58:25 +00:00
Jeremy Nelson
f9960fb065 adding checks for headless texture creation
& correcting present for headless
2025-07-09 10:28:31 -07:00
Jeremy Nelson
172d6d1045 Make isHeadless public, getCurrentTextureView doesn't need driver 2025-07-09 10:28:31 -07:00
Jeremy Nelson
2cfae31e9a Resolving conflicts 2025-07-09 10:28:31 -07:00
Juan Caldas
f44d1cbfe4 webgpu: Fix release branch (#8935) 2025-07-08 07:27:42 -04:00
Ben Doherty
f8eaa14a31 Metal: respect alpha to coverage (#8931) 2025-07-07 15:32:26 -07:00
Powei Feng
3d29cffd5d postsubmit: fix bad commit replacement 2025-07-07 14:30:26 -07:00
Mathias Agopian
3b1522ab56 API BREAKAGE: remove Texture::generatePrefilterMipmap
This feature is now supported by libfilament-generatePrefilterMipmap.a
2025-07-07 14:16:16 -07:00
Mathias Agopian
f6f7082b55 Make libfilament.java use libfilament-generatePrefilterMipmap 2025-07-07 14:16:16 -07:00
Mathias Agopian
4e50e64888 new generatePrefilterMipmap.a library 2025-07-07 14:16:16 -07:00
Mathias Agopian
27f7b198a6 make generatePrefilterMipmap more like a utility
it's now fully implemented with public API and is static.
2025-07-07 14:16:16 -07:00
Powei Feng
dc6c9996f6 renderdiff: update get-mesa to use also macport on MacOS (#8920) 2025-07-07 21:11:21 +00:00
Powei Feng
e0d19c8442 docs: post-submit update flow (#8906)
- Move directories into more descriptive organization
    - src_mdbook, src_markdeep, src_raw
    - mdbook will be generated from mdbook
    - markdeep will be generated to html
    - raw will be copied without modification
 - Add script that will run on a succesful commit to main. This
   script will update /docs and commit the changes.
2025-07-07 20:08:27 +00:00
Ben Doherty
086f81a49d Fix brew check in render tests (#8921) 2025-07-07 15:11:48 -04:00
rafadevai
4879a0a124 VK: Fix calculating the alignment for updateImage (#8929)
The alignment must be calculated using the
VulkanTexture format (dstImage) instead of the
PixelBufferDescriptor format.

Set the correct values for all supported formats
in getTexelBlockSize.

Use a helper function to correctly calculate the
required aligment based on the spec rules for
vkCmdCopyBufferToImage.

Co-authored-by: Serge Metral <sergemetral@google.com>
2025-07-07 10:59:05 -07:00
Mathias Agopian
637affefeb undeprecate a few methods because there is no cost keeping them
Box::transform is just an inline
IndirectLight::get{Color|Direction}Estimate() can be document to handle
the UB cases.
2025-07-07 10:10:12 -07:00
Andy Hovingh
8d219d3bc0 webgpu: render pipeline cache 2025-07-07 08:35:42 -05:00
Konrad Piascik
a7289da05f webgpu: remove unnecessary include to avoid iOS compilation failure 2025-07-04 10:27:12 -04:00
317 changed files with 15731 additions and 8122 deletions

View File

@@ -23,7 +23,7 @@ jobs:
GH_TOKEN: ${{ secrets.FILAMENTBOT_TOKEN }}
run: |
GOLDEN_BRANCH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | python3 test/renderdiff/src/commit_msg.py)
COMMIT_HASH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | head -n 1 | tr -d 'commit ')
COMMIT_HASH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | head -n 1 | sed "s/commit //g")
if [[ "${GOLDEN_BRANCH}" != "main" ]]; then
git config --global user.email "filament.bot@gmail.com"
git config --global user.name "Filament Bot"
@@ -33,3 +33,25 @@ jobs:
python3 test/renderdiff/src/update_golden.py --branch=${GOLDEN_BRANCH} \
--merge-to-main --filament-tag=${COMMIT_HASH} --golden-repo-token=${GH_TOKEN}
fi
update-docs:
name: update-docs
runs-on: 'ubuntu-24.04-4core'
steps:
- uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
- uses: ./.github/actions/linux-prereq
- id: get_commit_msg
uses: ./.github/actions/get-commit-msg
- name: Prerequisites
run: pip install selenium
- name: Run update script
env:
GH_TOKEN: ${{ secrets.FILAMENTBOT_TOKEN }}
run: |
COMMIT_HASH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | head -n 1 | sed "s/commit //g")
git config --global user.email "filament.bot@gmail.com"
git config --global user.name "Filament Bot"
git config --global credential.helper cache
bash docs_src/build/postsubmit.sh ${COMMIT_HASH} ${GH_TOKEN}

View File

@@ -130,13 +130,30 @@ jobs:
run: |
bash build/common/get-mesa.sh
pip install tifffile numpy
- name: Run Test
- name: Render
run: |
echo "${{ steps.get_commit_msg.outputs.msg }}" | bash test/renderdiff/test.sh
TEST_DIR=test/renderdiff
source ${TEST_DIR}/src/preamble.sh
start_
GOLDEN_BRANCH=$(echo "${{ steps.get_commit_msg.outputs.msg }}" | python3 ${TEST_DIR}/src/commit_msg.py)
bash ${TEST_DIR}/generate.sh && \
python3 ${TEST_DIR}/src/golden_manager.py \
--branch=${GOLDEN_BRANCH} \
--output=${GOLDEN_OUTPUT_DIR}
# Note that we need to upload the output even if comparison fails
- uses: actions/upload-artifact@v4
with:
name: presubmit-renderdiff-result
path: ./out/renderdiff
- name: Compare output
run: |
TEST_DIR=test/renderdiff
source ${TEST_DIR}/src/preamble.sh
python3 ${TEST_DIR}/src/compare.py \
--src=${GOLDEN_OUTPUT_DIR} \
--dest=${RENDER_OUTPUT_DIR} \
--out=${DIFF_OUTPUT_DIR}
end_
validate-wgsl-webgpu:
name: validate-wgsl-webgpu
@@ -171,3 +188,17 @@ jobs:
./build.sh -p desktop debug gltf_viewer
- name: Run test
run: bash test/code-correctness/test.sh
test-mdbook:
name: test-mdbook
runs-on: 'ubuntu-24.04-4core'
steps:
- uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
- uses: ./.github/actions/linux-prereq
- name: Run build script
run: |
bash docs_src/build/install_mdbook.sh && source ~/.bashrc
mdbook --version

View File

@@ -41,6 +41,8 @@ option(FILAMENT_ENABLE_ASAN_UBSAN "Enable Address and Undefined Behavior Sanitiz
option(FILAMENT_ENABLE_TSAN "Enable Thread Sanitizer" OFF)
option(FILAMENT_ENABLE_COVERAGE "Enable LLVM code coverage" OFF)
option(FILAMENT_ENABLE_FEATURE_LEVEL_0 "Enable Feature Level 0" ON)
option(FILAMENT_ENABLE_MULTIVIEW "Enable multiview for Filament" OFF)
@@ -460,6 +462,10 @@ if (NOT MSVC AND NOT WEBGL)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_SANITIZE_OPTIONS}")
if (FILAMENT_ENABLE_COVERAGE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-instr-generate -fcoverage-mapping")
endif()
# Disable the stack check for macOS to workaround a known issue in clang 11.0.0.
# See: https://forums.developer.apple.com/thread/121887
if (APPLE)
@@ -786,6 +792,7 @@ add_subdirectory(${LIBRARIES}/filabridge)
add_subdirectory(${LIBRARIES}/filaflat)
add_subdirectory(${LIBRARIES}/filagui)
add_subdirectory(${LIBRARIES}/filameshio)
add_subdirectory(${LIBRARIES}/generatePrefilterMipmap)
add_subdirectory(${LIBRARIES}/gltfio)
add_subdirectory(${LIBRARIES}/ibl)
add_subdirectory(${LIBRARIES}/iblprefilter)

View File

@@ -31,7 +31,7 @@ repositories {
}
dependencies {
implementation 'com.google.android.filament:filament-android:1.62.0'
implementation 'com.google.android.filament:filament-android:1.62.1'
}
```
@@ -51,7 +51,7 @@ Here are all the libraries available in the group `com.google.android.filament`:
iOS projects can use CocoaPods to install the latest release:
```shell
pod 'Filament', '~> 1.62.0'
pod 'Filament', '~> 1.62.1'
```
## Documentation

View File

@@ -7,6 +7,11 @@ A new header is inserted each time a *tag* is created.
Instead, if you are authoring a PR for the main branch, add your release note to
[NEW_RELEASE_NOTES.md](./NEW_RELEASE_NOTES.md).
## v1.62.2
- Metal: fix, respect alpha to coverage rasterization
- engine: removed `Texture::generatePrefilterMipmap`, a new `libfilament-generatePrefilterMipmap` library can be used in its stead [⚠️ **API BREAKAGE**]
## v1.62.1
- Add new shader define `VARIANT_DEPTH`, defined when a material is compiled for depth variants

View File

@@ -13,6 +13,10 @@ add_library(filament STATIC IMPORTED)
set_target_properties(filament PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfilament.a)
add_library(filament-generatePrefilterMipmap STATIC IMPORTED)
set_target_properties(filament-generatePrefilterMipmap PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libfilament-generatePrefilterMipmap.a)
add_library(backend STATIC IMPORTED)
set_target_properties(backend PROPERTIES IMPORTED_LOCATION
${FILAMENT_DIR}/lib/${ANDROID_ABI}/libbackend.a)
@@ -120,6 +124,7 @@ add_library(filament-jni SHARED
# Ordering is significant in the following list. The PRIVATE qualifier prevents transitive deps.
target_link_libraries(filament-jni
PRIVATE filament-generatePrefilterMipmap
PRIVATE filament
PRIVATE backend
PRIVATE filaflat

View File

@@ -23,16 +23,20 @@
#include <android/bitmap.h>
#endif
#include <backend/BufferDescriptor.h>
#include <filament/Engine.h>
#include <filament/Stream.h>
#include <filament/Texture.h>
#include <filament-generatePrefilterMipmap/generatePrefilterMipmap.h>
#include <backend/BufferDescriptor.h>
#include "common/CallbackUtils.h"
#include "common/NioUtils.h"
#include "private/backend/VirtualMachineEnv.h"
using namespace filament;
using namespace backend;
@@ -421,7 +425,7 @@ Java_com_google_android_filament_Texture_nGeneratePrefilterMipmap(JNIEnv *env, j
Engine *engine = (Engine *) nativeEngine;
jint *faceOffsetsInBytes = env->GetIntArrayElements(faceOffsetsInBytes_, nullptr);
Texture::FaceOffsets faceOffsets;
filament::FaceOffsets faceOffsets;
std::copy_n(faceOffsetsInBytes, 6, faceOffsets.offsets);
env->ReleaseIntArrayElements(faceOffsetsInBytes_, faceOffsetsInBytes, JNI_ABORT);
@@ -444,10 +448,11 @@ Java_com_google_android_filament_Texture_nGeneratePrefilterMipmap(JNIEnv *env, j
(uint32_t) left, (uint32_t) top, (uint32_t) stride,
callback->getHandler(), &JniBufferCallback::postToJavaAndDestroy, callback);
Texture::PrefilterOptions options;
filament::PrefilterOptions options;
options.sampleCount = sampleCount;
options.mirror = mirror;
texture->generatePrefilterMipmap(*engine, std::move(desc), faceOffsets, &options);
filament::generatePrefilterMipmap(texture, *engine, std::move(desc), faceOffsets, &options);
return 0;
}

View File

@@ -1390,8 +1390,8 @@ public class View {
*
* \note
* Dynamic resolution is only supported on platforms where the time to render
* a frame can be measured accurately. Dynamic resolution is currently only
* supported on Android.
* a frame can be measured accurately. On platform where this is not supported,
* Dynamic Resolution can't be enabled unless minScale == maxScale.
*
* @see Renderer::FrameRateOptions
*

View File

@@ -1,5 +1,5 @@
GROUP=com.google.android.filament
VERSION_NAME=1.62.0
VERSION_NAME=1.62.1
POM_DESCRIPTION=Real-time physically based rendering engine for Android.

View File

@@ -63,6 +63,9 @@ function print_help {
echo " -b"
echo " Enable Address and Undefined Behavior Sanitizers (asan/ubsan) for debugging."
echo " This is only for the desktop build."
echo " -V"
echo " Enable LLVM code coverage for debug builds."
echo " This is only for the desktop build."
echo " -x value"
echo " Define a preprocessor flag FILAMENT_BACKEND_DEBUG_FLAG with [value]. This is useful for"
echo " enabling debug paths in the backend from the build script. For example, make a"
@@ -208,6 +211,7 @@ MATOPT_OPTION=""
MATOPT_GRADLE_OPTION=""
ASAN_UBSAN_OPTION=""
COVERAGE_OPTION=""
BACKEND_DEBUG_FLAG_OPTION=""
@@ -275,6 +279,7 @@ function build_desktop_target {
${MATDBG_OPTION} \
${MATOPT_OPTION} \
${ASAN_UBSAN_OPTION} \
${COVERAGE_OPTION} \
${BACKEND_DEBUG_FLAG_OPTION} \
${STEREOSCOPIC_OPTION} \
${OSMESA_OPTION} \
@@ -835,7 +840,7 @@ function check_debug_release_build {
pushd "$(dirname "$0")" > /dev/null
while getopts ":hacCfgimp:q:uvWslwedtk:bx:S:X:" opt; do
while getopts ":hacCfgimp:q:uvWslwedtk:bVx:S:X:" opt; do
case ${opt} in
h)
print_help
@@ -983,6 +988,9 @@ while getopts ":hacCfgimp:q:uvWslwedtk:bx:S:X:" opt; do
b) ASAN_UBSAN_OPTION="-DFILAMENT_ENABLE_ASAN_UBSAN=ON"
echo "Enabled ASAN/UBSAN"
;;
V) COVERAGE_OPTION="-DFILAMENT_ENABLE_COVERAGE=ON"
echo "Enabled coverage"
;;
x) BACKEND_DEBUG_FLAG_OPTION="-DFILAMENT_BACKEND_DEBUG_FLAG=${OPTARG}"
;;
S) case $(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') in

View File

@@ -77,16 +77,20 @@ if [[ "$OS_NAME" == "Linux" ]]; then
sudo ln -s /usr/bin/clang++-${CLANG_VERSION} /usr/bin/clang++
fi # [[ "$GITHUB_WORKFLOW" ]]
elif [[ "$OS_NAME" == "Darwin" ]]; then
if [[ ! "$GITHUB_WORKFLOW" ]]; then
if [ ! command -v brew > /dev/null 2>&1 ]; then
echo "Error: need to install homebrew to continue"
exit 1
fi
if command -v brew > /dev/null 2>&1; then
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install autoconf automake libx11 libxext libxrandr \
llvm@${LLVM_VERSION} ninja meson pkg-config libxshmfence
# For reasons unknown, this is necessary for pkg-config to find homebrew's packages
LOCAL_PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
elif command -v port > /dev/null 2>&1; then
sudo port install autoconf automake libx11 libXext libXrandr llvm-${LLVM_VERSION} \
ninja meson pkgconfig libxshmfence
# For reasons unknown, this is necessary for pkg-config to find macport's packages
LOCAL_PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"
else
echo "Error: need to install homebrew or macports to continue"
exit 1
fi
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install autoconf automake libx11 libxext libxrandr llvm@${LLVM_VERSION} ninja meson pkg-config libxshmfence
# For reasons unknown, this is necessary for pkg-config to find homebrew's packages
LOCAL_PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
fi # [[ "$OS_NAME" == x ]]
LOCAL_LDFLAGS=${LDFLAGS}

7
docs_src/.gitignore vendored
View File

@@ -1,2 +1,5 @@
book
src/dup/*.md
build/__pycache__
src_mdbook/book
src_mdbook/src/dup/*.md
src_mdbook/src/main/filament.md
src_mdbook/src/main/materials.md

View File

@@ -30,16 +30,23 @@ from utils import execute, ArgParseImpl
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.join(CUR_DIR, '../../')
DOCS_SRC_DIR = os.path.abspath(os.path.join(CUR_DIR, '../'))
MARKDEEP_SRC_DIR = os.path.join(DOCS_SRC_DIR, 'src_markdeep')
MDBOOK_SRC_DIR = os.path.join(DOCS_SRC_DIR, 'src_mdbook')
RAW_SRC_DIR = os.path.join(DOCS_SRC_DIR, 'src_raw')
SRC_SRC_DIRS = [MARKDEEP_SRC_DIR, MDBOOK_SRC_DIR, RAW_SRC_DIR]
def get_edited_files(commit_hash):
INSERT = '#####?????'
res, ret = execute(f'git show --name-only --pretty=%b{INSERT} {commit_hash}')
assert res == 0, 'Failed to get edited filed'
assert res == 0, f'Failed to get edited filed {res}: ' + ret
files = []
_, after = ret.split(INSERT)
for r in filter(lambda a: len(a) > 0, after.split('\n')):
if r.startswith('commit'):
break
files.append(r)
files.append(os.path.abspath(os.path.join(ROOT_DIR, r)))
return files
# Returns True if there were no direct edits to '/docs'
@@ -54,12 +61,19 @@ def check_has_source_edits(commit_hash, printing=True):
config = {}
with open(f'{CUR_DIR}/duplicates.json') as config_txt:
config = json.loads(config_txt.read())
source_files = set(config.keys())
source_files = set(os.path.abspath(os.path.join(ROOT_DIR, k)) for k in config.keys())
edited_files = set(get_edited_files(commit_hash))
overlap = [f'\t{f}' for f in list(source_files & edited_files)]
if printing and len(overlap) > 0:
print(f'Found edited source files:\n' + '\n'.join(overlap))
return len(overlap) > 0
# find any changes to docs_src sources
is_docs_src_edit = lambda f: any(f.startswith(prefix) for prefix in SRC_SRC_DIRS)
final_edited = [f'\t{f}' for f in \
list(source_files & edited_files) + \
list(filter(is_docs_src_edit, edited_files))]
if printing and len(final_edited) > 0:
print(f'Found edited source files:\n' + '\n'.join(final_edited))
return len(final_edited) > 0
# Returns true in a given TAG is found in the commit msg
def commit_msg_has_tag(commit_hash, tag, printing=True):

View File

@@ -21,7 +21,7 @@ LINUX_ARM=4
function add_cargo_path() {
local BASH_P="${HOME}/.bashrc"
local PATH_LINE='export PATH=${PATH}:~/.cargo/bin'
local PATH_LINE='export PATH=${PATH}:${HOME}/.cargo/bin'
local TYPE=$1
if [ ${TYPE} == ${DARWIN_ARM} ] || [ ${TYPE} == ${DARWIN_X86} ]; then
BASH_P="${HOME}/.bash_profile"
@@ -77,10 +77,10 @@ print(get_type())
if [ ${TYPE} == ${LINUX_X86} ]; then
DL_URL='https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz'
fi
curl -L -o ~/Downloads/mdbook.tar.gz ${DL_URL}
curl -L -o /tmp/mdbook.tar.gz ${DL_URL}
mkdir -p /tmp/mdbook
tar -xvzf ~/Downloads/mdbook.tar.gz -C /tmp/mdbook >/dev/null 2>&1
mv /tmp/mdbook/mdbook ~/.cargo/bin/
tar -xvzf /tmp/mdbook.tar.gz -C /tmp/mdbook >/dev/null 2>&1
mv /tmp/mdbook/mdbook ${HOME}/.cargo/bin/
fi
add_cargo_path ${TYPE}
}

View File

@@ -0,0 +1,51 @@
#!/usr/bin/bash
# Copyright (C) 2025 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FILAMENT_BOT_TOKEN=$2
function update_to_main() {
python3 docs_src/build/run.py
mkdir -p tmp
pushd .
cd tmp
git clone https://x-access-token:${FILAMENT_BOT_TOKEN}@github.com/google/filament.git
cd filament
rm -rf docs/*
cp -r ../../docs_src/src_mdbook/book/* docs
git add -A docs/*
git commit -a \
-m "[automated] Updating /docs due to commit ${COMMIT_HASH:0:7}" \
-m "" \
-m "Full commit hash is ${COMMIT_HASH}" \
-m "" \
-m "DOCS_ALLOW_DIRECT_EDITS"
git push origin main
popd
}
COMMIT_HASH=$1
HAS_EDITS=$((python3 docs_src/build/checks.py --do-or="source_edits,commit_docs_force" $COMMIT_HASH > /dev/null && echo "true") || echo "false")
DO_BYPASS=$((python3 docs_src/build/checks.py --do-and="commit_docs_bypass" $COMMIT_HASH && echo "true") || echo "false")
if [[ "${HAS_EDITS}" == "true" && "${DO_BYPASS}" == "false" ]]; then
# Run again to output the edited files:
python3 docs_src/build/checks.py --do-or="source_edits,commit_docs_force" $COMMIT_HASH
update_to_main
else
echo "has edits (to /docs_src): ${HAS_EDITS}"
echo "bypass: ${DO_BYPASS}"
fi

View File

@@ -16,12 +16,18 @@ import json
import os
import re
from utils import execute, ArgParseImpl
import shutil
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
DOCS_SRC_DIR = os.path.join(CUR_DIR, '../')
ROOT_DIR = os.path.join(CUR_DIR, '../../')
SRC_DIR = os.path.join(CUR_DIR, '../src')
MARKDEEP_DIR = os.path.join(CUR_DIR, '../markdeep')
MDBOOK_DIR = os.path.join(CUR_DIR, '../src_mdbook')
BOOK_OUPUT_DIR = os.path.join(MDBOOK_DIR, 'book')
SRC_DIR = os.path.join(MDBOOK_DIR, 'src')
MARKDEEP_DIR = os.path.join(CUR_DIR, '../src_markdeep')
RAW_COPIES_DIR = os.path.join(CUR_DIR, '../src_raw')
DUP_DIR = os.path.join(SRC_DIR, 'dup')
MAIN_DIR = os.path.join(SRC_DIR, 'main')
@@ -124,5 +130,7 @@ if __name__ == "__main__":
pull_duplicates()
pull_markdeep_docs()
res, err = execute('mdbook build', cwd=DOCS_SRC_DIR)
res, err = execute('mdbook build', cwd=MDBOOK_DIR)
assert res == 0, f"failed to execute `mdbook`. return-code={res} err=\"{err}\""
shutil.copytree(RAW_COPIES_DIR, BOOK_OUPUT_DIR, dirs_exist_ok=True)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1027,8 +1027,11 @@ samplerCubemap | Cubemap texture
[Table [materialParamsTypes]: Material parameter types]
Samplers
: Sampler types can also specify a `format` which can be either `int` or `float` (defaults to
`float`).
: Sampler types can have the following fields:
- `format` : which can be either `int` or `float` (defaults to `float`).
- `multisample` : a boolean to indicate whether the sampler is meant for multisampling (defaults to `false`)
- `unfilterable` : a boolean to indicate whether the sampling is not filtered (defaults to `false`)
Arrays
: A parameter can define an array of values by appending `[size]` after the type name, where

View File

@@ -10,8 +10,8 @@ create-missing = false
[output.html]
mathjax-support = true
default-theme = "light"
preferred-dark-theme = "light"
default-theme = "ayu"
preferred-dark-theme = "ayu"
[output.html.print]
enable = false

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

View File

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 322 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 461 KiB

After

Width:  |  Height:  |  Size: 461 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

View File

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 320 KiB

View File

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 MiB

After

Width:  |  Height:  |  Size: 7.4 MiB

View File

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 814 B

View File

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 349 B

View File

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 170 B

View File

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 84 B

View File

Before

Width:  |  Height:  |  Size: 4.9 MiB

After

Width:  |  Height:  |  Size: 4.9 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 215 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 741 KiB

After

Width:  |  Height:  |  Size: 741 KiB

View File

Before

Width:  |  Height:  |  Size: 452 KiB

After

Width:  |  Height:  |  Size: 452 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Some files were not shown because too many files have changed in this diff Show More