Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant GL_EXT_samplerless_texture_functions? #5518

Closed
Ollhax opened this issue Nov 7, 2024 · 1 comment · Fixed by #5527
Closed

Redundant GL_EXT_samplerless_texture_functions? #5518

Ollhax opened this issue Nov 7, 2024 · 1 comment · Fixed by #5527
Assignees
Labels
goal:client support Feature or fix needed for a current slang user.

Comments

@Ollhax
Copy link

Ollhax commented Nov 7, 2024

I'm trying to get dimensions out of a 3d texture:

layout(binding=1) Sampler3D sampler;

...

float4 fragmentMain(...)
{
	int sizeX;
	int sizeY;
	int sizeZ;
	sampler.GetDimensions(sizeX, sizeY, sizeZ);
...
}

This shader doesn't work for me since it generates #extension GL_EXT_samplerless_texture_functions : require at the top, but that extension does not exist in regular OpenGL. I understand that Slang is not prioritizing/supporting GLSL shaders for OpenGL, but unless I'm missing something it's not really required in this situation anyway.

@csyonghe csyonghe added the goal:client support Feature or fix needed for a current slang user. label Nov 7, 2024
@csyonghe csyonghe added this to the Q4 2024 (Fall) milestone Nov 7, 2024
@csyonghe
Copy link
Collaborator

csyonghe commented Nov 7, 2024

\source\slang\slang-core-module-textures.cpp line 494 needs to be made conditional so we don't emit that extension requirement if we are emitting code for the combined sampler.

However, isCombined is currently a generic parameter instead of a meta parameter. We can avoid making isCombined to be another meta parameter by calling __requireGLSLExtension() inside an if (isCombined != 0) in the body of the GetDimensions() function for glsl.

cheneym2 added a commit to cheneym2/slang that referenced this issue Nov 8, 2024
This extension is only necessary when using texture functions
on non-combined texture/samplers.

Fixes shader-slang#5518
cheneym2 added a commit to cheneym2/slang that referenced this issue Nov 8, 2024
This extension is only necessary when using texture functions
on non-combined texture/samplers.

Fixes shader-slang#5518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client support Feature or fix needed for a current slang user.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants