-
Notifications
You must be signed in to change notification settings - Fork 361
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
spvc: Add some flags. #579
Conversation
15a5feb
to
a17a971
Compare
libshaderc_spvc/src/spvc.cc
Outdated
options->glsl.version = compiler.get_common_options().version; | ||
if (options->glsl.version == 0) { | ||
// no version detected in source, use default | ||
options->glsl.version = 450; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
450 should probably be a constant somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
libshaderc_spvc/src/spvc.cc
Outdated
} | ||
if (stage_count != 1) { | ||
result->status = shaderc_compilation_status_compilation_error; | ||
if (stage_count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this backwards? This should be if (stage_count == 0)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
libshaderc_spvc/src/spvc.cc
Outdated
} | ||
if (!options->entry_point.empty()) { | ||
compiler.set_entry_point(options->entry_point, model); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies, forgot to run clang-format
spvc/test/run_spirv_cross_tests.py
Outdated
raise | ||
# Quietly run a command. Throw exception on failure. | ||
def check_call(cmd): | ||
global devnull |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean why the check_call() function? No strong need for it now (just redirects stdout). I expect to add logging here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the global devnull thing? Haven't seen that before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a handle to /dev/null which is opened/closed in main().
Yeah globals suck, but it doesn't seem much of an improvement to put this whole file into a class.
Implement the following spvc flags and update the test: --entry --version --remove-unused-variables --vulkan-semantics --separate-shader-objects --flatten-ubo The old --version flag is now -v.
Run clang-format. Define constant for default GLSL version. Fix bug in entry point handling.
42887f3
to
7eb1f1c
Compare
Includes 7425820 Start v2019.1-dev 34c412f Finish v2019.0 7e46a09 Update CHANGES 63ab5ac Re-write environment control flags to be consistent (google#637) 538a9d2 Add ability to transform spvc input from WebGPU SPIR-V (google#631) 0b84e66 Ran 2to3 on git-sync-deps (google#636) 27bffdf Roll spirv-tools dependency (google#634) c7b4974 Remove dead file (google#632) 5ba891a Convert spirv-cross tests to using a known failures list (google#626) 05c766a Add flag to allow filtering tests cases being run (google#625) 9f04be0 Run pyformat on utils and test scripts (google#624) 326165c Run spirv-cross tests in parallel (google#622) 08549a9 Convert to requiring Python 3 (google#621) 1475418 Change 'target' env to 'source' env in spvc API (google#610) dce7a4b Roll glslang, spirv-tools, spirv-headers, spirv-cross (google#614) 5cf297d Spvc tests: Assemble explicitly for Vulkan1.1 env (google#615) 1defed7 Fix spvc test logging (google#616) 3ac606a Update CHANGES, switch to 2019.0-dev (google#613) 55b9f5d 1.4: GOOGLE suffix drops from certain instructions f51af41 Fix typos in the artifacts links. (google#606) afc69d3 Disable running re2 tests (google#603) 6805e55 Fix Windows build uploads. (google#597) 60caf55 Package and upload builds. (google#595) 59a49bc Shaderc requires Python3 (google#594) 5af3dbf Roll spirv-cross. (google#592) ff9ae40 Satisfy gn check. (google#591) 60658b0 Fix gn build. (google#590) 439a848 Export config files for pkg-config. (google#581) 2caa40b spvc: Add MSL and HLSL tests. (google#585) 1d9383f Roll DEPS. (google#586) 7bb8a43 spvc testing: add logging. (google#583) 067a749 spvc: Add some flags. (google#579) f7fa8ce Enable spvc test. (google#578) 4b8446f Upate python scripts work with python3. (google#569) eb0e335 Add presubmit_clang_asan bot. (google#575) 665bbc1 Add spvc command line tool and tests. (google#571) 337d42d Remove extra .clang-format files. (google#573) cfb65d4 Fix spvc_c_smoke_test some more. (google#574) 712cebf Fix spvc_c_smoke_test. (google#572) 6bba7fe Avoid leading dot slash in cmake target. (google#570) 94f21e8 Roll GLSLang. (google#564) Testing: checkbuild.py on Linux; unit tests on Windows Change-Id: Ie1b63aacac7194fe8330068e6a01c5bdf44cd321
This builds on #578
spvc: Add some flags.
Implement the following spvc flags and update the test:
--entry
--version
--remove-unused-variables
--vulkan-semantics
--separate-shader-objects
--flatten-ubo
The old --version flag is now -v.