Browse Source

Update :-) Almost there

sebavan 6 years ago
parent
commit
7c1a663356

+ 7 - 7
localDevWebGPU/index.html

@@ -64,7 +64,7 @@
         var engine = null;
         var engine = null;
 
 
         // Allow querystring to navigate easily in debug in local samples.
         // Allow querystring to navigate easily in debug in local samples.
-        var indexjs = 'src/index';
+        var indexjs = '/localDev/src/index';
         var sampleSearch = /sample=([0-9]+)/i;
         var sampleSearch = /sample=([0-9]+)/i;
         var matches = null;
         var matches = null;
         if ((matches = sampleSearch.exec(window.location)) !== null) {
         if ((matches = sampleSearch.exec(window.location)) !== null) {
@@ -79,10 +79,10 @@
             .require(indexjs)
             .require(indexjs)
             .load(function() {
             .load(function() {
                 if (BABYLON.Engine.isSupported()) {
                 if (BABYLON.Engine.isSupported()) {
-                    var onLoad = () => {
+                    var onLoad = (engine) => {
                         // call the scene creation from the js.
                         // call the scene creation from the js.
                         if (typeof delayCreateScene !== "undefined") {
                         if (typeof delayCreateScene !== "undefined") {
-                            var scene = delayCreateScene();
+                            var scene = delayCreateScene(engine);
 
 
                             if (scene) {
                             if (scene) {
                                 // Register a render loop to repeatedly render the scene
                                 // Register a render loop to repeatedly render the scene
@@ -96,7 +96,7 @@
                             }
                             }
                         }
                         }
                         else {
                         else {
-                            var scene = createScene();
+                            var scene = createScene(engine);
 
 
                             if (scene) {
                             if (scene) {
 
 
@@ -134,13 +134,13 @@
 
 
                     if (typeof createEngine !== "undefined") {
                     if (typeof createEngine !== "undefined") {
                         engine = createEngine();
                         engine = createEngine();
-                        engine.initEngineAsync(shadercOptions).then(() => onLoad());
+                        engine.initEngineAsync(shadercOptions).then(() => onLoad(engine));
                     } else {
                     } else {
                         engine = new BABYLON.WebGPUEngine(canvas);
                         engine = new BABYLON.WebGPUEngine(canvas);
-                        engine.initEngineAsync(shadercOptions).then(() => onLoad());
+                        engine.initEngineAsync(shadercOptions).then(() => onLoad(engine));
                     }
                     }
 
 
-                    // BABYLONDEVTOOLS.Loader.debugShortcut(engine);                    
+                    // BABYLONDEVTOOLS.Loader.debugShortcut(engine);
                 }
                 }
                 else {
                 else {
                     alert('BabylonJS is not supported.')
                     alert('BabylonJS is not supported.')

+ 0 - 1
src/Engines/WebGPU/webgpuConstants.ts

@@ -74,7 +74,6 @@ export class WebGPUConstants {
     public static readonly GPUTextureFormat_rgba32float: GPUTextureFormat = "rgba32float";
     public static readonly GPUTextureFormat_rgba32float: GPUTextureFormat = "rgba32float";
     /* Depth and Stencil formats */
     /* Depth and Stencil formats */
     public static readonly GPUTextureFormat_depth32float: GPUTextureFormat = "depth32float";
     public static readonly GPUTextureFormat_depth32float: GPUTextureFormat = "depth32float";
-    public static readonly GPUTextureFormat_depth32floatStencil8: GPUTextureFormat = "depth32float-stencil8";
     public static readonly GPUTextureFormat_depth24plus: GPUTextureFormat = "depth24plus";
     public static readonly GPUTextureFormat_depth24plus: GPUTextureFormat = "depth24plus";
     public static readonly GPUTextureFormat_depth24plusStencil8: GPUTextureFormat = "depth24plus-stencil8";
     public static readonly GPUTextureFormat_depth24plusStencil8: GPUTextureFormat = "depth24plus-stencil8";
 
 

+ 0 - 1
src/LibDeclarations/webgpu.d.ts

@@ -154,7 +154,6 @@ type GPUTextureFormat =
   | "rgba32sint"
   | "rgba32sint"
   | "rgba32float"
   | "rgba32float"
   | "depth32float"
   | "depth32float"
-  | "depth32float-stencil8"
   | "depth24plus"
   | "depth24plus"
   | "depth24plus-stencil8";
   | "depth24plus-stencil8";
 type GPUTextureViewDimension =
 type GPUTextureViewDimension =