Commit Graph

8 Commits

Author SHA1 Message Date
dan sinclair 7092786f31 Fixup return of HLSL sign to match WGSL.
The HLSL `sign` method returns an `int` result (scalar or vector). The
WGSL `sign` expects the result to be the same type as the argument. This
CL injects a cast to the correct type after the `sign` call in the HLSL
generated source.

Bug: tint:1795
Change-Id: I51fed24b5b8b752b6b27fdfb5dd47eb803902793
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116692
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2023-01-11 13:18:29 +00:00
Ben Clayton be367b73ae Reduce shader complexity for external textures
Do more math on the CPU to avoid per-fragment ALU operations.
Use a mat3x2 instead of mat2x3 to avoid padding.

Fixed: dawn:1614
Change-Id: Ib0e0f7d44ed9aa16eaca712f6553214fad141feb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116060
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon1 Jones <brandon1.jones@intel.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2023-01-04 12:29:56 +00:00
Brandon Jones 183df9d24e Implement External Texture Crop Functionality
Adds to the External Texture shader transform to allow cropping. Tests
included.

Bug: chromium:1316671
Change-Id: Id0ec9acac22a0968ba6847d6ead9cf5084eaca88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113281
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-12-16 05:41:06 +00:00
Brandon Jones 85ceb08d5c Add ExternalTexture Rotate and FlipY Functionality
Adds functionality to Dawn and Tint to rotate and flip-Y external
textures through the shader transform. Tests are included.

Bug: chromium:1316671
Change-Id: I40a6b67eaeb2a348f469e4879eeb585bc40537b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110181
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-11-30 21:32:26 +00:00
Ben Clayton 4b60615eae test/tint: Fix e2e test generation for vec / mat
Where the intrinsic uses the fixed-dimension form of the types.

Change-Id: I1709382f762fe7394bbd88f428f09b15a1a8a643
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108642
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
2022-11-04 17:06:03 +00:00
Ben Clayton c6b381495d tint/transform: Refactor transforms
Replace the ShouldRun() method with Apply() which will do the
transformation if it needs to be done, otherwise returns
'SkipTransform'.

This reduces a bunch of duplicated scanning between the old ShouldRun()
and Transform().

This change also adjusts code style to make the transforms more
consistent.

Change-Id: I9a6b10cb8b4ed62676b12ef30fb7764d363386c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/107681
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
2022-11-03 08:41:19 +00:00
Ben Clayton 13f089095f tint/intrinsics: Texture queries now return unsigned integer / vectors
To match the spec.

Also add a bunch of missing texture test cases to
src/tint/ast/builtin_texture_helper_test.cc. Fix all the tests that were
broken because these were not being exercised.

Fixed: tint:1526
Change-Id: I207b51d307bbdc054b595e0e0e0fd3330607e171
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106681
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-10-26 18:36:44 +00:00
Ben Clayton c4ebf2cc57 tint: Implement textureSampleBaseClampToEdge
Fixed: tint:1671
Change-Id: Iaae5b5d571a4401c0255de727245bf8dbbe06740
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102642
Reviewed-by: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-09-22 22:59:16 +00:00