Compare commits

...

1 Commits

Author SHA1 Message Date
Doris Wu
bd073119d2 Revert "buffer update opt: Add a flag to guard the feature (#9322)"
This reverts commit 49c4a5d62c.
2025-10-15 23:41:03 +08:00
3 changed files with 3 additions and 24 deletions

View File

@@ -557,8 +557,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu
jboolean disableHandleUseAfterFreeCheck, jboolean disableHandleUseAfterFreeCheck,
jint preferredShaderLanguage, jint preferredShaderLanguage,
jboolean forceGLES2Context, jboolean assertNativeWindowIsValid, jboolean forceGLES2Context, jboolean assertNativeWindowIsValid,
jint gpuContextPriority, jint gpuContextPriority) {
jboolean enableMaterialInstanceUniformBatching) {
Engine::Builder* builder = (Engine::Builder*) nativeBuilder; Engine::Builder* builder = (Engine::Builder*) nativeBuilder;
Engine::Config config = { Engine::Config config = {
.commandBufferSizeMB = (uint32_t) commandBufferSizeMB, .commandBufferSizeMB = (uint32_t) commandBufferSizeMB,
@@ -577,7 +576,6 @@ extern "C" JNIEXPORT void JNICALL Java_com_google_android_filament_Engine_nSetBu
.forceGLES2Context = (bool) forceGLES2Context, .forceGLES2Context = (bool) forceGLES2Context,
.assertNativeWindowIsValid = (bool) assertNativeWindowIsValid, .assertNativeWindowIsValid = (bool) assertNativeWindowIsValid,
.gpuContextPriority = (Engine::GpuContextPriority) gpuContextPriority, .gpuContextPriority = (Engine::GpuContextPriority) gpuContextPriority,
.enableMaterialInstanceUniformBatching = (bool) enableMaterialInstanceUniformBatching,
}; };
builder->config(&config); builder->config(&config);
} }

View File

@@ -264,8 +264,7 @@ public class Engine {
config.disableHandleUseAfterFreeCheck, config.disableHandleUseAfterFreeCheck,
config.preferredShaderLanguage.ordinal(), config.preferredShaderLanguage.ordinal(),
config.forceGLES2Context, config.assertNativeWindowIsValid, config.forceGLES2Context, config.assertNativeWindowIsValid,
config.gpuContextPriority.ordinal(), config.gpuContextPriority.ordinal());
config.enableMaterialInstanceUniformBatching);
return this; return this;
} }
@@ -526,15 +525,6 @@ public class Engine {
* GPU context priority level. Controls GPU work scheduling and preemption. * GPU context priority level. Controls GPU work scheduling and preemption.
*/ */
public GpuContextPriority gpuContextPriority = GpuContextPriority.DEFAULT; public GpuContextPriority gpuContextPriority = GpuContextPriority.DEFAULT;
/**
* Enables uniform batching for all material instances.
*
* When enabled, material instances will share a common large uniform buffer
* and use sub-allocations within it. This is expected to reduce CPU overhead
* by minimizing the number of buffer updates sent to the driver.
*/
public boolean enableMaterialInstanceUniformBatching = false;
} }
private Engine(long nativeEngine, Config config) { private Engine(long nativeEngine, Config config) {
@@ -1539,7 +1529,7 @@ public class Engine {
boolean disableHandleUseAfterFreeCheck, boolean disableHandleUseAfterFreeCheck,
int preferredShaderLanguage, int preferredShaderLanguage,
boolean forceGLES2Context, boolean assertNativeWindowIsValid, boolean forceGLES2Context, boolean assertNativeWindowIsValid,
int gpuContextPriority, boolean enableMaterialInstanceUniformBatching); int gpuContextPriority);
private static native void nSetBuilderFeatureLevel(long nativeBuilder, int ordinal); private static native void nSetBuilderFeatureLevel(long nativeBuilder, int ordinal);
private static native void nSetBuilderSharedContext(long nativeBuilder, long sharedContext); private static native void nSetBuilderSharedContext(long nativeBuilder, long sharedContext);
private static native void nSetBuilderPaused(long nativeBuilder, boolean paused); private static native void nSetBuilderPaused(long nativeBuilder, boolean paused);

View File

@@ -417,15 +417,6 @@ public:
* GPU context priority level. Controls GPU work scheduling and preemption. * GPU context priority level. Controls GPU work scheduling and preemption.
*/ */
GpuContextPriority gpuContextPriority = GpuContextPriority::DEFAULT; GpuContextPriority gpuContextPriority = GpuContextPriority::DEFAULT;
/**
* Enables uniform batching for all material instances.
*
* When enabled, material instances will share a common large uniform buffer
* and use sub-allocations within it. This is expected to reduce CPU overhead
* by minimizing the number of buffer updates sent to the driver.
*/
bool enableMaterialInstanceUniformBatching = false;
}; };