Skip to content

Commit

Permalink
Support for integer/data textures in WebGL2 and WebGPU (#5921)
Browse files Browse the repository at this point in the history
* Support for integer/data textures in WebGL2 and WebGPU

* Add newline to fix lint

* Fix RG16I string label

* Add optional check

* Change comment to Not supported on WebGL1

Co-authored-by: Martin Valigursky <59932779+mvaligursky@users.noreply.github.com>

* Clean up uniform buffer storage selection and padding

* Clean up spaces

* Update WebGL1 not supported comment

* Use boolean flag to indicate integer pixel format

* Reorder constants and fix webgpu typo

* Keep original textureDimensions order in shader-processor

* Revert uniform-buffer with minimal additions

* Do not allow changing integer texture mipmap/filter properties, log warning

* Revert formatting changes to compressed formats

* Revert previous comment change

* Keep original order of pcUniformType in webgl-graphics-device

* Keep original order in webgl-graphics-device

* Minimize import diff

* Minimize import diff

* Sand simulation example

* Clean up example a bit

* Clean up some lines

* Use single int texture instead of uvec2

* Add additional keyboard shortcuts

* Reuse vertex shader, add comment

* Add comments to resetData

* Remove undefined throws

* Use example description, remove screen and assets, add comments

* Revert description width change

* Add a WebGL1 warning in controls panel

* Accept options object when creating shaders, allow changing outputType for every attachment

* Remove console log

* Update src/platform/graphics/shader-utils.js

* Additional PR comments

* Update src/scene/graphics/render-pass-shader-quad.js

* Update src/scene/graphics/render-pass-shader-quad.js

* Add note explaining use of 'comparison' for integer textures

* Update src/platform/graphics/webgpu/webgpu-bind-group-format.js

Co-authored-by: Will Eastcott <will@playcanvas.com>

* Update src/platform/graphics/shader-utils.js

Co-authored-by: Will Eastcott <will@playcanvas.com>

* Apply suggestions from code review

Co-authored-by: Will Eastcott <will@playcanvas.com>

* Update src/scene/graphics/render-pass-shader-quad.js

Co-authored-by: Will Eastcott <will@playcanvas.com>

* For unsigned pixel formats, use U instead of UI

* Change string names of pixelFormatInfo

---------

Co-authored-by: Martin Valigursky <59932779+mvaligursky@users.noreply.github.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
  • Loading branch information
3 people authored Jan 19, 2024
1 parent c566c15 commit 7283e5a
Show file tree
Hide file tree
Showing 25 changed files with 1,514 additions and 101 deletions.
1 change: 1 addition & 0 deletions examples/src/examples/graphics/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from "./grab-pass.mjs";
export * from "./ground-fog.mjs";
export * from "./hardware-instancing.mjs";
export * from "./hierarchy.mjs";
export * from "./integer-textures.mjs";
export * from "./layers.mjs";
export * from "./lights-baked-a-o.mjs";
export * from "./lights-baked.mjs";
Expand Down
Loading

0 comments on commit 7283e5a

Please sign in to comment.