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

Remove debugOptions from internal classes #3370

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

ncesario-lunarg
Copy link
Collaborator

The debug options passed down from the public ShConstruct* functions to internal code is unused. This change removes the internal debugOptions fields and attempts to make it more obvious these fields are not used.

This change does not change the public-facing interface.

This change also adds the -Wshorten-64-to-32 warning to the StandAlone build in order to avoid unwanted 64-to-32 bit conversions in the future.

Closes #3348.

@@ -516,7 +516,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi

if (set) {
errno = 0;
int setVal = ::strtol(argv[curArg], nullptr, 10);
int setVal = static_cast<int>(::strtol(argv[curArg], nullptr, 10));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These casts were necessary due to the addition of -Wshorten-64-to-32.

Comment on lines +333 to +339
GLSLANG_EXPORT int ShCompile(const ShHandle, const char* const shaderStrings[], const int numStrings,
const int* lengths, const EShOptimizationLevel, const TBuiltInResource* resources,
int, // debugOptions unused
int defaultVersion = 110, // use 100 for ES environment, overridden by #version in shader
bool forwardCompatible = false, // give errors for use of deprecated features
EShMessages messages = EShMsgDefault // warnings and errors
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These whitespace changes are coming from clang-format.

What is our policy on clang-format? It looks like we don't enforce clang-format changes, yet we have a .clang-format file checked into the repo. Should we either enforce clang-format (perhaps modifying the .clang-format file first), or just get rid of the .clang-format file if we don't plan on enforcing it?

The debug options passed down from the public ShConstruct* functions to
internal code is unused. This change removes the internal debugOptions
fields and attempts to make it more obvious these fields are not used.

This change does not change the public-facing interface.

This change also adds the -Wshorten-64-to-32 warning to the StandAlone
build in order to avoid unwanted 64-to-32 bit conversions in the future.

Closes KhronosGroup#3348.
ncesario-lunarg referenced this pull request Oct 21, 2023
Adds the --no-link option which outputs the compiled shader binaries
without linking them. This is a first step towards allowing users to
create SPIR-v binary, non-executable libraries.

When using the --no-link option, all functions are decorated with the
Export linkage attribute.
Copy link
Contributor

@arcady-lunarg arcady-lunarg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for taking care of this.

@arcady-lunarg arcady-lunarg merged commit 8fa4658 into KhronosGroup:main Oct 26, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to propagate 64 bit options correctly in glslang standalone
2 participants