Skip to content

Conversation

@davli-nv
Copy link
Contributor

@davli-nv davli-nv commented Nov 5, 2025

these are new for HLSL shader model 6.8

fixes #8929

@davli-nv davli-nv added pr: non-breaking PRs without breaking changes CoPilot labels Nov 5, 2025
@tangent-vector tangent-vector self-requested a review November 6, 2025 20:28
-these are new for HLSL shader model 6.8
-also change glsl.meta.slang to use existing sampler typealias in hlsl.meta.slang

fixes #8929
@davli-nv davli-nv marked this pull request as ready for review November 14, 2025 07:15
@davli-nv davli-nv requested a review from a team as a code owner November 14, 2025 07:15
jkwak-work
jkwak-work previously approved these changes Nov 18, 2025
Copy link
Collaborator

@jkwak-work jkwak-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

But ... can you also address TODO-s in glsl.meta.slang that seems to be related?
There are more than one location in glsl.meta.slang with the following comment:

// TODO: Need to apply bias 

Here is one of the examples,

// TODO: Need to apply bias
return sampler.SampleCmp(location, compareValue);

When I was writing the GLSL functions, there was no way to apply bias in HLSL.
The functions in glsl.meta.slang should simply call the counter part functions in hlsl.meta.slang that can take bias value.

@davli-nv
Copy link
Contributor Author

davli-nv commented Nov 18, 2025

Thanks @jkwak-work, I filed #9038 for the GLSL work since GLSL is lower priority compared to my other tasks.

@davli-nv davli-nv added this pull request to the merge queue Nov 18, 2025
float SampleCmpGrad(vector<float, Shape.dimensions+isArray> location, float compareValue, vector<float, Shape.dimensions> gradX, vector<float, Shape.dimensions> gradY, constexpr vector<int, Shape.planeDimensions> offset)
{
static_assert(!(Shape is __ShapeCube), "SampleCmpGrad with offset is not supported for TextureCube or TextureCubeArray");
static_assert(!(Shape is __ShapeCube && isArray != 0), "SampleCmpGrad is not supported for TextureCubeArray");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the second assert redundant? The first one will always fire first

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll move the stricter assert first, I think both should be kept

@davli-nv davli-nv removed this pull request from the merge queue due to a manual request Nov 18, 2025
@davli-nv davli-nv self-assigned this Nov 18, 2025
@davli-nv davli-nv enabled auto-merge November 18, 2025 02:34
Copy link
Contributor

@gtong-nv gtong-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@davli-nv davli-nv added this pull request to the merge queue Nov 18, 2025
Merged via the queue into master with commit fd3b729 Nov 18, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CoPilot pr: non-breaking PRs without breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HLSL add support of SampleCmpBias and SampleCmpGrad

4 participants