<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/cross-compile/fmod.slang, 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-05-02T18:56:13+00:00</updated>
<entry>
<title>Fix fmod behavior targetting GLSL and SPIR-V (#4080)</title>
<updated>2024-05-02T18:56:13+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-05-02T18:56:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f7d54af67e026feb2546af1deaf2513a36f8516e'/>
<id>urn:sha1:f7d54af67e026feb2546af1deaf2513a36f8516e</id>
<content type='text'>
* Fix fmod behavior targetting GLSL and SPIR-V

The default implementation of fmod was doing "Modulo" operation when
"fmod" in HLSL should do "remainder" operation.

* Fix a mistake in `fmod` GLSL target

When using __intrinsic_asm, the "if" logic wasn't emitted.
"__intrinsic_asm" had to be called from a new function and `fmod` had to
call it.

Alternatively, I am using `operator?()` to workaround.

A similar modification is made to `roundEven()` hoping for a better
performance.</content>
</entry>
<entry>
<title>Convert more tests to use shader objects (#1659)</title>
<updated>2021-01-15T20:10:06+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-01-15T20:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2a5d5b32348c33aac7ca62aa9a4c2bb7cff8e08a'/>
<id>urn:sha1:2a5d5b32348c33aac7ca62aa9a4c2bb7cff8e08a</id>
<content type='text'>
This change converts a large number of our existing tests to use the `ShaderObject` support that was added to the `gfx` layer.

In many cases, tests were just updated to pass `-shaderobj` and the result Just Worked.
In other cases, a `name` attribute had to be added to one or more `TEST_INPUT` lines.

For tests that did not work with shader objects "out of the box," I spent a little bit of time trying to get them work, but fell back to letting those tests run in the older mode.
Future changes to the infrastructure will be needed to get those additional tests working in the new path.

Along with the changes to test files, the following implementation changes were made to get additional tests working:

* Because the shader object mode uses explicit register bindings (from reflection), the hacky logic that was offseting `u` registers for D3D12 based on the number of render targets gets disabled (by another hack).

* The "flat" reflection information coming from Slang was not correctly reporting "binding ranges" for things that consumed only uniform data (which would be everything on CUDA/CPU), so it was refactored to properly include binding ranges for anything where the type of the field/variable implied a binding range should be created (even if the `LayoutResourceKind` was `::Uniform`).

* A few fixes were made to the CUDA implementation of `Renderer`, in order to get additional tests up and running. Most of these changes had to do with texture bindings, which hadn't really been tested previously.

In addition, a few changes were made that were attempts at getting more tests working, but didn't actually help. These could be dropped if requested:

* As a quality-of-life feature (not being used) the `object` style of `TEST_INPUT` line is upgraded to support inferring the type to use from the type of the input being set.

* Any `object` shader input lines get ignored in non-shader-object mode.</content>
</entry>
<entry>
<title>Add GLSL translation for HLSL fmod() (#1342)</title>
<updated>2020-05-11T21:57:05+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2020-05-11T21:57:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f5dfa1ed6a51809e8593f5f2abc292ab39f35dcb'/>
<id>urn:sha1:f5dfa1ed6a51809e8593f5f2abc292ab39f35dcb</id>
<content type='text'>
The existing code was assuming `fmod()` was available as a builtin in GLSL, which isn't true. It also isn't possible to translate the HLSL `fmod()` to the GLSL `mod()` since the two have slightly different semantics.

This change introduces a definition for `fmod(x,y)` that amounts to `x - y*trunc(x/y)` which should agree with the HLSL version except in corner cases (e.g., there are some cases where the HLSL version returns `-0` and this one will return `0`).</content>
</entry>
</feed>
