The DebugShadowCasacade material was dependent on frameUniforms,
instead we use material parameters. We also pass all the informations
relative to cascades (it's not used yet, but will be in the future).
- In finish(), instead of block to wait for read pixels to finish,
we poll the state of the counter to ensure that all the readbacks
are complete. This allows us to complete the readpixel callbacks
by advancing webgpu's internal callback counter.
- Remove all the redundant flushes that are no longer needed now
that buffer upload is put on the command queue.
- Add a convenience method for getting swapchain dimensions. Will
be useful.
- Add webgpu as a valid backend for running backend tests on linux
(now that it no longer deadlocks).
- In finish(), instead of block to wait for read pixels to finish,
we poll the state of the counter to ensure that all the readbacks
are complete. This allows us to complete the readpixel callbacks
by advancing webgpu's internal callback counter.
- Remove all the redundant flushes that are no longer needed now
that buffer upload is put on the command queue.
- Add a convenience method for getting swapchain dimensions. Will
be useful.
- Add webgpu as a valid backend for running backend tests on linux
(now that it no longer deadlocks).
This commit addresses a critical security vulnerability (OOB write) and
several stability issues in the Radiance HDR parser.
Primary Fix:
* Fixed a heap buffer overflow in the RLE decoding loop (Issue #9748).
The decoder previously failed to verify if a run-length chunk exceeded
the remaining space in the scanline buffer. Added strict bounds checking
(`num_bytes + run_length > width`) before executing `memset` or
`mStream.read` to prevent arbitrary memory corruption.
Additional Security & Stability Improvements:
* Prevented an infinite loop (DoS) in header parsing. Replaced the
`do { ... } while(true);` loop with proper stream state checking
(`while (mStream.getline(...))`) to handle unexpected EOFs gracefully.
* Mitigated integer overflow and Out-Of-Memory (OOM) vulnerabilities by
enforcing maximum sane dimensions (`MAX_IMAGE_DIMENSION` and
`MAX_IMAGE_PIXELS`). This prevents catastrophic memory allocations
triggered by maliciously crafted width/height values.
* Initialized local variables and buffers (`buf`, `gamma`, `exposure`) to
prevent undefined behavior and parsing of stack garbage upon stream read
failures.
Fixes#9748
Keeping ShaderLanguage::UNSPECIFIED will return metal library
as the preferred language on metal. Here we just make it more
explicit that matdbg needs msl.
Fixes#9372
The toggle for animation was added recently to Settings and default
to false. This differs from before where animation is always assumed
to be enabled.
For gltf_viewer's interactive mode, we enable animation. (Batch mode
will still have animation off).
Fixes#9775
- Include gl_headers.h since it defines BACKEND_OPENGL_VERSION_GL(ES)
depending on which headers are available.
- Don't assume glGetString(GL_EXTENSIONS) returns a non-null value as
null is a possible return value for OpenGL (desktop).
We add the ability for the maniuplator to be null. If it is null,
then the camera settings won't be determined by the manipulator.
This is useful for when we want to set the camera parameters
outside of the modelviewer, but still use it to do everything else.
The init block of addPass will be executed immediately, which means
that even for passes that are culled, we will trip on incorrect format
given to the pass.
We move the stencil check to the execute block of addPass so that
it'll only assert when the pass is actually present in the graph.
FIXES=489437881
* engine: encapsulate material cache handling
We will soon allow `MaterialInstance` to override the value of spec constants.
To avoid code duplication, we introduce a new class `MaterialPrograms` which
handles the chunky bits of managing the program cache and values of the spec
constants.
* MaterialPrograms: add explicit initialize method
* MaterialPrograms: backport fixes, address comments
* MaterialPrograms: set all constants at once
* MaterialPrograms: rename to LocalProgramCache
* utils: add LRU cache to RefCountedMap
This change introduces a new data structure LruCache and uses it in
RefCountedMap to keep a fixed number of cache entries alive after their
reference count has dropped to zero in the main map.
* utils: address LRU cache comments
The FBO cache uses imageviews as its cache key. To ensure that these
views are valid for the lifetime of a key-value pair in the cache, we
need to also reference the rendertarget in the value part of the pair.
The RT contains attachments, which are wrappers around
which own the image views.
Fixes#9680
When more than one external sampler are present the
flow will clone the descriptor set twice and make a copy
of a binding that requires an immutable sampler. The copy
of this binding will cause a crash in some adreno GPUs.
This change will make sure the descriptor set is only cloned one
and after that only update binding operations are done for the
external sampled bindings.
Not all component managers are thread-safe for garbage-collection. In
particular, some need to access the DriverAPI which is never
thread-safe.
We refactor the garbage-collection code into FEngine, so it's not
duplicated in FRenderer. We make it more explicit that
FRenderableManager::destroyComponent() needs the DriverAPI, and we
don't call its gc() from a job.
Besides the refactoring, the only change in this CL is that
FRenderableManager::gc() is no longer called from a job.
FIXES=[489134910]
- refactoring/clecanup to make some changes easier
- VSM mipmap generation was mistakenly disable when blur radius was 0
- analytic variance was disabled because the math only worked for VSM. Fixed the math.
- better handling of large blurs when using fp32
- implement EVSM equivalent of receiver plane normal bias
- use correct EVSM clearing color
- mipmapping with point lights works much better (no seams)
- min variance is computed automatically
- custom high precision mipmaping shader for VSM
Android App:
- Refactored activity_main.xml to use modern Material 3 components.
- Grouped Export/Help buttons logically and moved ADB instructions
to dedicated info icons.
- Added an in-app "Load Test" button to explicitly pick test bundles.
- Updated ValidationInputManager.kt to gracefully handle relative
zip_path intent execution via ADB targeting app external storage.
Tooling & Documentation:
- Added a Python Textual TUI (validation_app.py) to automate device
discovery, test execution, bundling, renaming, and
downloading/uploading.
- Added README.md in test/render-validation documenting ADB intent
parameter capabilities and TUI dashboard setup.
The problem is that we might flush when resizing happens. So
we need to ask for the command buffer "after" the resize/acquire
swapchain logic.
Fixes#9718
It's no longer necessary to preallocate a "tag" to reuse a material
instance. Instead, we can simply pass a unique tag when getting the
instance from the pool.
* Provide thread name when attaching to JVM on Android
When calling AttachCurrentThread on Android, pass a JavaVMAttachArgs structure. This allows providing the thread name, which is retrieved using pthread_getname_np, to the JVM.
* Fix Android build error: pthread_getname_np requires API 26+
---------
Co-authored-by: Mathias Agopian <mathias@google.com>
The VSM variant bit was overloaded, it meant two different things
depending on the DEP bit (depth).
For standard variants (DEP = 0), it decides the type of the shadow
sampler used (PCF or 2D).
For depth variants (DEP = 1), it decides what is written during the
shadow pass (nothing, i.e. depth only, or EVSM depth moments).
We now clearly separate the two bits throughout the code.
This change should be purely source-cosmetic, there shouldn't be any
behavior changes.
Co-authored-by: Powei Feng <powei@google.com>
The previous code used the max of the texel's width or height footprint
in world space to compute the offset; this could both overestimate or
underestimate the bias causing some peter panning or acne.
The new code replaces a sqrt with a dot, but is otherwise similar.
The previous code was a bit clunky and not generic, it made assumptions
about the shape of the projection matrix.
This just uses the generic, correct calculation.
In addition the previous code used the wrong matrix, it assumed that
Wp wasn't needed, but it was because translations do change the
jacobian value at a given point.
RDIFF_ACCEPT_NEW_GOLDENS
- Introduces the `RDIFF_ACCEPT_NEW_GOLDENS` commit message tag.
- Conditionally skip the `test-renderdiff` presubmit comparison
if this tag is present.
- Extracts renderdiff generation into a reusable
`.github/actions/renderdiff-generate` composite action.
- Modifies `postsubmit-main.yml` to automatically generate new
goldens and push them to a temporary
`accept-goldens-<short-hash>` branch before merging them into
`main` when the tag is found.
If a framebuffer is destroyed while a command buffer is in flight (e.g.
during a window resize), it's possible for a command buffer to try to
use a framebuffer that no longer exists. This encapsulates framebuffers
and render passes in resource_ptr, to ensure they are never reclaimed
prematurely.