-
Notifications
You must be signed in to change notification settings - Fork 343
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
-mfmt=bin/c/num to emit binary as it is, numbers or C init list #218
Conversation
@@ -0,0 +1,127 @@ | |||
# Copyright 2015 The Shaderc Authors. All rights reserved. |
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.
This is year 2016. :)
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.
Fixed.
|c-init-list |Output SPIRV binary code as a text file containing C-style + | ||
initializer list. This option is valid when the compilation + | ||
output is SPIRV binary code. It is not valid to use when the + | ||
output is not SPIV binary code, like when `-S`, `-E`, `-M`, + |
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.
typo: SPIR-V
done my review. |
Discussed offline. |
d065f90
to
475fd3b
Compare
|c |Output SPIR-V binary code as a text file containing C-style + | ||
initializer list. + | ||
This is just wrapping the output of `num` option with curly | ||
brakets. |
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.
"brackets".
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.
Fixed in d7942c1
==== `-mfmt=<format>` | ||
|
||
Select output format for compilation output in SPIR-V binary code form. | ||
Supported options are listed in <<binary-output-format-selection,binary output |
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.
in the ... table.
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.
Fixed in d7942c1
Done review. Plus advice to expose binary emission format as public inner class to the FileCompiler, and have a single set-bin-output-format method on FileCompiler. |
+2 |
Add command line option: `-mfmt=<fmt>` to select the emission format for SPIR-V binary output. Available formats are `bin` (default): a sequence of binary 32-bitwords in host native endianness; `num` a list of comma-separated hex numbers in text form; `c` a C-style initializer list of hex numbers. `-mfmt=<fmt>` should only be specified when the compilation output is SPIRV binary code. When used with disassembly mode (-S) and preprocessing-only mode (-E), it will result in error and fail the compilation. Note that dumping dependency info as compilation output (-M or -MM) also implies preprocessing-only (-E) and will lead to error. But dumpping dependency info to extra .d file (-MD or -MMD) won't cause error as the compilation output is still SPIRV binary code.
f70d8d5
to
989394a
Compare
Squashed and merged |
Previously, the renumbering loop would sometimes iterate in the wrong order. To fix this, instead use the binding info already correctly extracted by `ExtractSpirvInfo`. Fixes ComputeCopyStorageBufferTests.BasicTest/D3D12.
Issue: #214
Add command line option: -masm=c-init-list to emit SPIRV binary code as
a C-style uint32_t array initializer list in the output file.
-masm=c-init-list should only be specified when the compilation output
is SPIRV binary code. When used with disassembly mode (-S) and
preprocessing-only mode (-E), it will result in error and fail the
compilation. Note that dumping dependency info as compilation output (-M
or -MM) also implies preprocessing-only (-E) and will lead to error.
But dumpping dependency info to extra .d file (-MD or -MMD) won't cause
error as the compilation output is still SPIRV binary code.