Skip to content

Commit

Permalink
webgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
pandrr committed Dec 16, 2024
1 parent 656fb4c commit 527b888
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
7 changes: 0 additions & 7 deletions src/core/cgp/cgp_binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ export default class Binding
return;
}


if (this.uniforms.length == 1 && this.uniforms[0].getType() == "t")
{
if (this.uniforms[0].getValue() && this.uniforms[0].getValue().gpuTexture) o.resource = this.uniforms[0].getValue().gpuTexture.createView();
Expand Down Expand Up @@ -311,23 +310,17 @@ export default class Binding
for (let i = 0; i < this.uniforms.length; i++)
{
info.push(this.uniforms[i].getName() + " " + this.uniforms[i].getValue());



this.uniforms[i].copyToBuffer(this.cGpuBuffers[inst].floatArr, off); // todo: check if uniform changed?


// if (isNaN(this.cGpuBuffers[inst].floatArr[0]))
// {
// console.log("shitttttttt", this.cGpuBuffers[inst].floatArr[0], this.uniforms[i].getName(), this.cGpuBuffers[inst].name, this.uniforms[i]);
// }


off += this.uniforms[i].getSizeBytes() / 4;
}
if (this._cgp.frameStore.branchProfiler) this._cgp.frameStore.branchStack.push("uni buff", info);


// console.log("upodate", inst);

this.cGpuBuffers[inst].updateGpuBuffer();
Expand Down
20 changes: 5 additions & 15 deletions src/core/cgp/cgp_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ class WebGpuContext extends CGState
// for (let i = this._shaderStack.length - 1; i >= 0; i--) if (this._shaderStack[i]) if (this.frameStore.renderOffscreen == this._shaderStack[i].offScreenPass) return this._shaderStack[i];
}


setDevice(device)
{
this.device = device;
Expand All @@ -203,8 +202,6 @@ class WebGpuContext extends CGState
this.emitEvent("deviceChange");
}



pushErrorScope(name, options = {})
{
if (this.catchErrors)
Expand Down Expand Up @@ -316,11 +313,9 @@ class WebGpuContext extends CGState
this._stackDepthWrite.pop();
}


// --------------------------------------
// state depthfunc


/**
* @function pushDepthFunc
* @memberof Context
Expand Down Expand Up @@ -355,8 +350,6 @@ class WebGpuContext extends CGState
this._stackDepthFunc.pop();
}



// --------------------------------------
// state CullFace

Expand Down Expand Up @@ -385,21 +378,19 @@ class WebGpuContext extends CGState
}

/**
* pop face culling enabled state
* @function popCullFace
* @memberof Context
* @instance
*/
* pop face culling enabled state
* @function popCullFace
* @memberof Context
* @instance
*/
popCullFace()
{
this._stackCullFace.pop();
}


// --------------------------------------
// state CullFace Facing


/**
* push face culling face side
* @function pushCullFaceFacing
Expand Down Expand Up @@ -440,7 +431,6 @@ class WebGpuContext extends CGState
this._stackBlend.push(b);
}


popBlend()
{
this._stackBlend.pop();
Expand Down

0 comments on commit 527b888

Please sign in to comment.