This patch tries to attach debug location of a branch/return instruction to its predecessor or the closing brace. If none could be found, no debug info should be emitted.
Don't report the following error when scanning inactive code (e.g. code inside #if 0):
"error: '#' : (#) can be preceded in its line only by spaces or horizontal tab"
Adds a variable to PpContext to say whether we're currently skipping over an inactive #if/#ifdef/#elif/#else, and don't report the error inside scanToken if true.
fixes 3704
Remove the dependency on LiveTraverser.h, which transitively includes
localintermediate.h. As a result, some things have been moved from
iomapper.h to iomapper.cpp, specifically the TVarEntry type and the
constructor and destructor of TGlslIoMapper.
If an 'in' is present in a shader stage, make sure a matching 'out'
is present in the previous stage. Only enabled when doing Vulkan.
This commit also fixes a bug where previous stage's linkerObjects
got polluted with 'in' variables from the next stage when merging
linker objects.
When location aliasing, the aliases sharing the location must have the same underlying numerical type and bit width (floating-point or integer, 32-bit versus 64-bit, etc.) and the same auxiliary storage and interpolation qualification.
This adds checks for the "patch" and "sample" qualifiers, and also relaxes the checks when the signedness of integer types differs.
It is invalid if the same decoration is applied to the same id multiple
times. This adds a check before adding a decoration that the decoration
is not already in the list. If it is, then the duplicate is not added.
Fixes#3627
SPIR-V requires that any instruction using the result of an
OpSampledImage instruction be in the same block as the OpSampledImage.
This is hard to guarantee in code generation but easy to fix after the
fact, by simply inserting a new OpSampledImage before the user of its
result if needed, with the new instruction having the same operands as
the original OpSampledImage.
This change adds a new pass to spv::Builder::postProcess that does this.
This might leave the original OpSampledImage instructions "orphaned"
with no users of their result ID, but dead code elimination would take
care of those further down the line.
* location aliasing
when location aliasing, the aliases sharing the location must have the same underlying numerical type
(floating-point or integer) and the same auxiliary storage and interpolation qualification.
The following case, glslang need report error.
layout(vertices = 1) out;
layout (location = 1, component = 0) in double gohan[];
layout (location = 1, component = 2) in float goten[];
in vec4 vs_tcs[];
out vec4 tcs_tes[];
void main()
{
}
* Need consider the following case: location aliasing with different interpolation qualifier.
This function is used to import SPIR-V extended instruction set. It
mistakenly treated the name of SPIR-V extended instruction set as the
name of SPIR-V extension. For example, when we have such code
getExtBuiltins("NonSemantic.DebugBreak")
'NonSemantic.DebugBreak' is added to SPIR-V extension. Rather, the
SPIR-V extension name should be 'SPV_KHR_non_semantics_info'. Therefore,
we must avoid this since the name of SPIR-V extended instruction set is
not necessarily equal to that of relevant SPIR-V extension. Adding a
SPIR-V extension must be done by calling addExtension() explicitly
outside this function.
This change also fixes disassembly issues of debugBreak().
coopmat<> type definition allows type parameters. To make it accept
types defined by spirv_type directive, we add spirvType info to the type
parameters. This change is to support this case. And a test is added to
show the missing usage.
The file and source text was not being set correctly in the test output.
This change makes the test fixture consistent with the command line
behavior, "-gVS", which was my original intent when I added these tests.
Add support for GL_ARB_shading_language_include. Usage is identical to
the way GL_GOOGLE_include_directive currently works glslang (since
GL_ARB_shading_language_include is inherently a runtime feature and
glslang is an offline compiler).
Users can simulate their runtime environment by using a custom
glslang::TShader::Includer or using filenames that match their GL
runtime names.
Closes#249.
Like with the last few PRs from me, it fixes a warning that's commonly enabled in downstream projects that might want to consume glslang via FetchContent or equivalent.
It doesn't actually enable the warning, but that might be desirable.
I think I found a bug in the Spv.FromFile.cpp tests that would have been prevented had this warning been enabled all along.
I had to guess the value for the missing field, so went for the most common one in the list.
The only test case that used a different value before had an RWTexture1D, so if baseImageBinding is meaning the same kind of image as image load store in OpenGL, it would make sense that that would be the only one to need a non-zero value for the binding.
I'm a little concerned that the test wasn't previously failing with the incorrectly-assigned fields as it implies they don't make any difference, so the test might be too permissive.
Co-authored-by: Neil Hickey <neil.hickey@arm.com>
Co-authored-by: Stuart Brady <stuart.brady@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Oes spec says:
For the both the input array gl_SampleMaskIn[] and the output array gl_SampleMask[], bit B of mask M
(gl_SampleMaskIn[M] or gl_SampleMask[M]) corresponds to sample 32*M+B. These arrays have
ceil(gl_MaxSamples/32) elements, where gl_MaxSamples is the maximum number of color samples
supported by the implementation.
But glslang report error "array must have size before use length".
layout(location = 0) out mediump vec4 fragColor;
void main (void)
{
for (int i = 0; i < gl_SampleMask.length(); ++i)
gl_SampleMask[i] = int(0xAAAAAAAA);
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
}
* Add two test items, one is for gl_MaxSapmles = 32 and the other one is for gl_MaxSapmles = 64.
The dependency was only because of the SpvOptions struct which is used
in both, but really is part of the glslang public interface and should
be in the public GlslangToSpv.h header.