Răsfoiți Sursa

BatchedMesh: Deprecate old instancing render paths (#30550)

* Deprecate use of "_multiDrawInstances"

* r170 -> r173

* 173 -> 174

* Fix logs
Garrett Johnson 11 luni în urmă
părinte
comite
97a078d73a

+ 2 - 0
src/renderers/WebGLRenderer.js

@@ -870,6 +870,8 @@ class WebGLRenderer {
 
 
 				if ( object._multiDrawInstances !== null ) {
 				if ( object._multiDrawInstances !== null ) {
 
 
+					// @deprecated, r174
+					warnOnce( 'THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
 					renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
 					renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
 
 
 				} else {
 				} else {

+ 2 - 0
src/renderers/webgl-fallback/WebGLBackend.js

@@ -1076,6 +1076,8 @@ class WebGLBackend extends Backend {
 
 
 				if ( object._multiDrawInstances !== null ) {
 				if ( object._multiDrawInstances !== null ) {
 
 
+					// @deprecated, r174
+					warnOnce( 'THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
 					renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
 					renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
 
 
 				} else if ( ! this.hasFeature( 'WEBGL_multi_draw' ) ) {
 				} else if ( ! this.hasFeature( 'WEBGL_multi_draw' ) ) {

+ 8 - 0
src/renderers/webgpu/WebGPUBackend.js

@@ -15,6 +15,7 @@ import WebGPUTextureUtils from './utils/WebGPUTextureUtils.js';
 
 
 import { WebGPUCoordinateSystem } from '../../constants.js';
 import { WebGPUCoordinateSystem } from '../../constants.js';
 import WebGPUTimestampQueryPool from './utils/WebGPUTimestampQueryPool.js';
 import WebGPUTimestampQueryPool from './utils/WebGPUTimestampQueryPool.js';
+import { warnOnce } from '../../utils.js';
 
 
 /**
 /**
  * A backend implementation targeting WebGPU.
  * A backend implementation targeting WebGPU.
@@ -1220,6 +1221,13 @@ class WebGPUBackend extends Backend {
 				const drawCount = object._multiDrawCount;
 				const drawCount = object._multiDrawCount;
 				const drawInstances = object._multiDrawInstances;
 				const drawInstances = object._multiDrawInstances;
 
 
+				if ( drawInstances !== null ) {
+
+					// @deprecated, r174
+					warnOnce( 'THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
+
+				}
+
 				for ( let i = 0; i < drawCount; i ++ ) {
 				for ( let i = 0; i < drawCount; i ++ ) {
 
 
 					const count = drawInstances ? drawInstances[ i ] : 1;
 					const count = drawInstances ? drawInstances[ i ] : 1;

粤ICP备19079148号