google / google/shaderc

shaderc_compile_into_spv() ignores the entry point name parameter

Open
#1,465 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.2k
Forks
445
Avg merge
11h 6m
Merged PRs (30d)
6

Description

It seems like shaderc_compile_into_spv() completely ignores whatever string you put into the entry_point_name parameter. You can specify anything into it without affecting anything at all, for example an empty string (just a null terminator). The output SPIR-V is completely identical regardless of what is set as the entry point.

This does not seem like intended behaviour, as this is written in a comment in the source code:

> The entry_point_name null-terminated string defines the name of the entry point to associate with this GLSL source.

From this, while it is unclear if the entry point name should control which function is used in GLSL, it does seem like it definitely should at least affect the entry point name in the output SPIR-V. Currently, the entry point name "main" is always used, both when finding what function to use as an entry point in the GLSL code, and as the name for the entry point in the output SPIR-V.

I would be very grateful if someone could reproduce this issue. I'm using Shaderc through the latest version of the LWJGL Java binding, but have verified that the data I'm passing in is correct. However, I'm not entirely sure which version of Shaderc that LWJGL uses, so it would be good to confirm it. A minimal shader with just an empty main() function is enough to reproduce the issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.