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

Assertion `PureOperatorBuiltins == false' failed on use of texture2D #3629

Open
amalon opened this issue Jun 22, 2024 · 1 comment
Open

Assertion `PureOperatorBuiltins == false' failed on use of texture2D #3629

amalon opened this issue Jun 22, 2024 · 1 comment

Comments

@amalon
Copy link

amalon commented Jun 22, 2024

I know texture2D is deprecated, but glslangValidator asserts when its used. Here's an example:

texture2d.frag:

#version 330 core
uniform sampler2D tex;
void main()
{
    texture2D(tex, vec2(0));
}
$ glslangValidator -l -S frag texture2d.frag 
glslangValidator: /usr/src/debug/glslang/glslang-14.1.0/glslang/MachineIndependent/ParseHelper.cpp:2846: void glslang::TParseContext::nonOpBuiltInCheck(const glslang::TSourceLoc&, const glslang::TFunction&, glslang::TIntermAggregate&): Assertion `PureOperatorBuiltins == false' failed.
Aborted (core dumped)

Backtrace:

#5  0x00007ffff6c48c67 in __assert_fail (assertion=0x7ffff7dcb911 "PureOperatorBuiltins == false", file=0x7ffff7e06ff0 "/usr/src/debug/glslang/glslang-14.1.0/glslang/MachineIndependent/ParseHelper.cpp", 
    line=2846, function=0x7ffff7e089d0 "void glslang::TParseContext::nonOpBuiltInCheck(const glslang::TSourceLoc&, const glslang::TFunction&, glslang::TIntermAggregate&)") at assert.c:103
#6  0x00007ffff7d45ed8 in glslang::TParseContext::nonOpBuiltInCheck(glslang::TSourceLoc const&, glslang::TFunction const&, glslang::TIntermAggregate&) () from /usr/lib/libglslang.so.14
#7  0x00007ffff7d43ed9 in glslang::TParseContext::handleFunctionCall(glslang::TSourceLoc const&, glslang::TFunction*, TIntermNode*) () from /usr/lib/libglslang.so.14
#8  0x00007ffff7d9f74e in yyparse(glslang::TParseContext*) () from /usr/lib/libglslang.so.14
#9  0x00007ffff7d328d7 in glslang::TParseContext::parseShaderStrings(glslang::TPpContext&, glslang::TInputScanner&, bool) () from /usr/lib/libglslang.so.14
#10 0x00007ffff7db0503 in ?? () from /usr/lib/libglslang.so.14
#11 0x00007ffff7c2f0a1 in glslang::TShader::parse(TBuiltInResource const*, int, EProfile, bool, bool, EShMessages, glslang::TShader::Includer&) () from /usr/lib/libglslang.so.14
#12 0x000055555555eadc in ?? ()
#13 0x0000555555560a7c in ?? ()
#14 0x00007ffff6c39c88 in __libc_start_call_main (main=main@entry=0x5555555581a0, argc=argc@entry=5, argv=argv@entry=0x7fffffffdbe8) at ../sysdeps/nptl/libc_start_call_main.h:58
#15 0x00007ffff6c39d4c in __libc_start_main_impl (main=0x5555555581a0, argc=5, argv=0x7fffffffdbe8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdbd8)
    at ../csu/libc-start.c:360
#16 0x00005555555584d5 in ?? ()

OS: Arch Linux

$ glslangValidator -v
Glslang Version: 11:14.1.0
ESSL Version: OpenGL ES GLSL 3.20 glslang Khronos. 14.1.0
GLSL Version: 4.60 glslang Khronos. 14.1.0
SPIR-V Version 0x00010600, Revision 1
GLSL.std.450 Version 100, Revision 1
Khronos Tool ID 8
SPIR-V Generator Version 11
GL_KHR_vulkan_glsl version 100
ARB_GL_gl_spirv version 100
@arcady-lunarg
Copy link
Contributor

This is apparently a regression as of 275d7ae.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants