<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-stdlib-textures.cpp, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2024-10-25T22:59:17+00:00</updated>
<entry>
<title>Replace stdlib with core-module on files and projects (#5411)</title>
<updated>2024-10-25T22:59:17+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-10-25T22:59:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d8969d87dcc9eea3f186a0c93c5e48d3d1659e05'/>
<id>urn:sha1:d8969d87dcc9eea3f186a0c93c5e48d3d1659e05</id>
<content type='text'>
This commit renames the files and projects to prefer "core-module" over
"stdlib".

The directory name `source/slang-stdlib` needs to be renamed too, and
there will be another commit for it soon.</content>
</entry>
<entry>
<title>Fix incorrect use of pointer in WGSL (#5144)</title>
<updated>2024-09-23T23:30:40+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-09-23T23:30:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6912c58538112e75f3c18c749ceabe8f316fcef8'/>
<id>urn:sha1:6912c58538112e75f3c18c749ceabe8f316fcef8</id>
<content type='text'>
Closes #5143

Recently there was a commit that changed the behavior of the memory
pointer for WGSL.

This commit fixes some issues came up after the change.</content>
</entry>
<entry>
<title>WGSL implement texture intrinsics except gather and sampler-less (#5123)</title>
<updated>2024-09-21T02:55:49+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-09-21T02:55:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c42b5e24b5b9d6b03352d809e0a49485d361154f'/>
<id>urn:sha1:c42b5e24b5b9d6b03352d809e0a49485d361154f</id>
<content type='text'>
This commit implements all of the texture intrinsics for WGSL except "Gather" and sampler-less.
They will be implemented in a separate PR.

A few things to note:

 - texture sampling functions are available only for the fragment shader stage; not for compute
 - WGSL doesn't have any functions similar to CalculateLevelOfDetail or CalculateLevelOfDetailUnclamped.
 - WGSL doesn't have a function overlaoding for textureSample with "clamp" or "status" arguments.
 - WGSL doesn't support Load operation with offset for texture_multisampled_XX and texture_storage_XX.
 - WGSL supports only four types of depth textures: 2D, 2D_array, cube and cube_array.
 - WGSL doesn't support "offset" variants for cube and cube_array.</content>
</entry>
<entry>
<title>Emit errors when invalid capabilities are used (#4510)</title>
<updated>2024-07-02T17:35:49+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2024-07-02T17:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d5d03d1510f45f5ed7864031244713d87fc82b87'/>
<id>urn:sha1:d5d03d1510f45f5ed7864031244713d87fc82b87</id>
<content type='text'>
* Fix invalid capabilities being allowed

fixes: #4506
fixes: #4508

1. As per #4506, no longer allow invalid `[require(...)]`
2. As per #4508, no longer allow mismatch between `case` and `require` of a calling function
3. Fixes incorrect hlsl.meta capabilities
4. Added a ref to the parent function/decl for when erroring with capabilities to help debug meta.slang files for when weird source locations are generated.

* rename vars and copy lambdas by value

* fix some more capabilities

* incorrect capabilities on a texture test

* push capabilities fix

note: seperated capabilities for glsl,spirv,cuda,hlsl since not all functions support all targets (source of capability error)

* fix cmd line arg by using `xslang` to passthrough to slangc

* let auto-infer run for certain capabilities to reduce simple mistakes

---------

Co-authored-by: Jay Kwak &lt;82421531+jkwak-work@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Implement texture functions for Metal target (#4158)</title>
<updated>2024-05-14T22:42:12+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-05-14T22:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d76bed6c1b03e5d7ef19c947fdd5fcaf33b595f7'/>
<id>urn:sha1:d76bed6c1b03e5d7ef19c947fdd5fcaf33b595f7</id>
<content type='text'>
* Impl texture APIs for Metal target

This commit is to implement texture functions for Metal target.

The following functions are implemented and tested.
 - GetDimensions()
 - CalculateLevelOfDetail()
 - CalculateLevelOfDetailUnclamped()
 - Sample()
 - SampleBias()
 - SampleLevel()
 - SampleCmp()
 - SampleCmpLevelZero()
 - Gather()
 - SampleGrad()
 - Load()

Metal has limited support for the texture functions compared to HLSL.
 - LOD is not supported for 1D texture,
 - Depth textures are limited to 2D, 2DArray, Cube and CubeArray
   textures.
 - "Offset" variants are limited to 2D, 2DArray, 2D-Depth,
   2DArray-Depth and 3D textures.

The functions that cannot be implemented for Metal should properly
be handled by the capability system later.

* Fix the failing test, multi-file.hlsl

I am not sure why this change is needed.

* Fix compile errors on macOS 2nd try

* Remove a typo character to fix the compile error

* Trivial clean up

* Remove `as_type` where it was intended as static_cast

* Use a simpler sytax for __intrinsic_asm

* Trivial clean up

* Remove TEST_AFTER_FIXING_CAPABILITY_PROBLEM after fixing normalize

* Fix the failing test properly

* Fix an incorrect setup of Depth-cube texture

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Initial pass to add capability declarations to stdlib intrinsics. (#3912)</title>
<updated>2024-04-20T03:18:40+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2024-04-20T03:18:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f9bcad35562c1f08638e6d3eb397d370d7d2f8f8'/>
<id>urn:sha1:f9bcad35562c1f08638e6d3eb397d370d7d2f8f8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix #3566. (#3574)</title>
<updated>2024-02-12T22:23:53+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-02-12T22:23:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2e35b08d279b4eb37a359941a06970cdea973502'/>
<id>urn:sha1:2e35b08d279b4eb37a359941a06970cdea973502</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement GLSL build-in functions related to texture (#3544)</title>
<updated>2024-02-06T01:03:04+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-02-06T01:03:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a88a7db9b3c215be890d4a9da6414959f9f9a3c1'/>
<id>urn:sha1:a88a7db9b3c215be890d4a9da6414959f9f9a3c1</id>
<content type='text'>
* Implement GLSL texture related built-in functions

Partially resolves #3362

This change implemented GLSL build-in functions described in the
following sections of "OpenGL Spec" document.
  8.9.1. Texture Query Functions
  8.9.2. Texel Lookup Functions
  8.9.4. Texture Gather Functions
  8.9.5. Compatibility Profile Texture Functions

About 200 functions are newly implemented.

Most of the functions are calling the HLSL implementation so they are
expected to work for all targets but they haven't been tested throughly
yet.

__TextureImpl got a new generic parameter, "isRectangle", to support
sampler2DRect and sampler2DRectShadow. It is a sampler for rectangular
texture with no mipmaps. For the reason, its "GetDimentions()" doesn't
return mip information. The sampling needs to happen in an integer
coordinate not in a normalized [0,1] range. but this hasn't been
implemenented yet.

Texture functions whose name include "Offset" takes an integer type
parameter and those values are required to be a compile-time constant.
However, our currentl implementation of slangc seems to make the values
not-compile-time constant. As a workaround, the test case uses __LINE__
macro to use a unique numbers so that slangc wouldn't collect them into
a runtime variable. I put "constexpr" on "offset" parameters as much as
possible. But the issue was still reproduced when targetting SPIRV.

Texture functions whose name include "Proj" are emulated by dividing the
coordinate value with its last component. For that reason, they take one
additional component for its coordinate value. As an example, following
function takes two components for sampler1D, instead of one:
  vec4 textureProj(sampler1D sampler, vec2 p);

All shadow samplers stores depth-compare-value at the last component.
But sampler1DShadow take one extra component, which is vec3 not vec2.
It is unclear what the reason is but the second component is unused in
this case. Here is an example,
  float texture(sampler1DShadow sampler, vec3 p);

samplerCubeArrayShadow takes five components for its coordinate and
the depth-compare-value cannot be stored in the last component of the
cooridnate. It is separated out as an independent parameter,
  float texture(samplerCubeArrayShadow sampler, vec4 p, float compare);

TextureGather functions got some modifications. The existing
implementation was calling textureGatherOffset[s] with the parameters in
a wrong order. This mistake is corrected.

* Bring back GatherCmpRed/Green/Blue/Alpha

HLSL has GatherCmpRed/Green/Blue/Alpha functions and it was removed from
my previous change by a mistake.

This change brings them back.

* Disabling two failing tests in intrinsic-texture

The new test file, intrinsic-texture.slang, has five test settings and
two of them are currently failing; they are targetting HLSL and CPP.

This change disables them to avoid confusion.

* Remove "isRectangle" parameter from __TextureInfo

Partially resolves #3362

This commit has a few changes based on the feedback from the code
reviews.
  1. Remove "isRectangle" parameter from __TextureInfo, because
     "sampler2DRect" can be replaced with "sampler2D" that always uses
     lod level 0. All functions associated to "Rect" are also removed.
  2. Enabled tests for "samplerBuffer".
  3. Removed "__target_intrinsic(glsl)" from glsl.meta.slang, because we
     want to stay away from it in the future.
  4. Some tests in intrinsic-texture.slang are disabled if the functions
     take constant offset values or take MultiSample samplers.

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Update the GetDimension hlsl builtin for spirv path. In case of sampler, a combined sampled image needs an OpImage to be generated. (#3424)</title>
<updated>2024-01-03T00:22:59+00:00</updated>
<author>
<name>Pankaj Mistry</name>
<email>63069047+pmistryNV@users.noreply.github.com</email>
</author>
<published>2024-01-03T00:22:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f33485c105b354a5a183732f47b9ca59c10ea08f'/>
<id>urn:sha1:f33485c105b354a5a183732f47b9ca59c10ea08f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Unify stdlib `Texture` types into one generic type. (#3327)</title>
<updated>2023-11-16T22:32:33+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-11-16T22:32:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4c78efd0c34442866f20e9d00bbb6908115c9a01'/>
<id>urn:sha1:4c78efd0c34442866f20e9d00bbb6908115c9a01</id>
<content type='text'>
* Unify Texture types in stdlib into 1 generic type.

* Fixes.

* Fix.

* Fixes.

* Fix reflection.

* Fix binding reflection.

* Add gather intrinsics.

* Fix gather intrinsics.

* Fix texture type toText.

* Fix intrinsic.

* fix cuda intrinsic.

* Fix project files.

* cleanup.

* Fix.

* Fix.

* Fix sampler feedback test.

* Fix getDimension intrinsics.

* Fix spirv sample image intrinsics.

* Fix test.

* Fix GLSL intrinsic.

* Cleanup.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
</feed>
