Merge pull request #1482 from KhronosGroup/validate

SPV: Add SPIRV-Tools validator.
This commit is contained in:
John Kessenich 2018-08-30 13:20:11 -07:00 committed by GitHub
commit a4dfede4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
95 changed files with 624 additions and 137 deletions

View File

@ -5,6 +5,7 @@ set(SOURCES
SpvBuilder.cpp
SpvPostProcess.cpp
doc.cpp
SpvTools.cpp
disassemble.cpp)
set(SPVREMAP_SOURCES
@ -23,6 +24,7 @@ set(HEADERS
SpvBuilder.h
spvIR.h
doc.h
SpvTools.h
disassemble.h)
set(SPVREMAP_HEADERS

View File

@ -54,14 +54,6 @@ namespace spv {
#endif
}
#if ENABLE_OPT
#include "spirv-tools/optimizer.hpp"
#endif
#if ENABLE_OPT
using namespace spvtools;
#endif
// Glslang includes
#include "../glslang/MachineIndependent/localintermediate.h"
#include "../glslang/MachineIndependent/SymbolTable.h"
@ -7003,80 +6995,6 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
GlslangToSpv(intermediate, spirv, &logger, options);
}
#if ENABLE_OPT
// Apply the SPIRV-Tools validator to generated SPIR-V.
void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger, const SpvOptions* options)
{
spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2;
spvtools::Optimizer optimizer(target_env);
optimizer.SetMessageConsumer(
[](spv_message_level_t level, const char *source, const spv_position_t &position, const char *message) {
auto &out = std::cerr;
switch (level)
{
case SPV_MSG_FATAL:
case SPV_MSG_INTERNAL_ERROR:
case SPV_MSG_ERROR:
out << "error: ";
break;
case SPV_MSG_WARNING:
out << "warning: ";
break;
case SPV_MSG_INFO:
case SPV_MSG_DEBUG:
out << "info: ";
break;
default:
break;
}
if (source)
{
out << source << ":";
}
out << position.line << ":" << position.column << ":" << position.index << ":";
if (message)
{
out << " " << message;
}
out << std::endl;
});
optimizer.RegisterPass(CreateMergeReturnPass());
optimizer.RegisterPass(CreateInlineExhaustivePass());
optimizer.RegisterPass(CreateEliminateDeadFunctionsPass());
optimizer.RegisterPass(CreateScalarReplacementPass());
optimizer.RegisterPass(CreateLocalAccessChainConvertPass());
optimizer.RegisterPass(CreateLocalSingleBlockLoadStoreElimPass());
optimizer.RegisterPass(CreateLocalSingleStoreElimPass());
optimizer.RegisterPass(CreateSimplificationPass());
optimizer.RegisterPass(CreateAggressiveDCEPass());
optimizer.RegisterPass(CreateVectorDCEPass());
optimizer.RegisterPass(CreateDeadInsertElimPass());
optimizer.RegisterPass(CreateAggressiveDCEPass());
optimizer.RegisterPass(CreateDeadBranchElimPass());
optimizer.RegisterPass(CreateBlockMergePass());
optimizer.RegisterPass(CreateLocalMultiStoreElimPass());
optimizer.RegisterPass(CreateIfConversionPass());
optimizer.RegisterPass(CreateSimplificationPass());
optimizer.RegisterPass(CreateAggressiveDCEPass());
optimizer.RegisterPass(CreateVectorDCEPass());
optimizer.RegisterPass(CreateDeadInsertElimPass());
if (options->optimizeSize) {
optimizer.RegisterPass(CreateRedundancyEliminationPass());
// TODO(greg-lunarg): Add this when AMD driver issues are resolved
// optimizer.RegisterPass(CreateCommonUniformElimPass());
}
optimizer.RegisterPass(CreateAggressiveDCEPass());
optimizer.RegisterPass(CreateCFGCleanupPass());
optimizer.Run(spirv.data(), spirv.size(), &spirv);
}
#endif
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger, SpvOptions* options)
{
@ -7097,12 +7015,17 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
it.dumpSpv(spirv);
#if ENABLE_OPT
if (options->validate)
SpirvToolsValidate(intermediate, spirv, logger);
// If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan
// eg. forward and remove memory writes of opaque types.
if ((intermediate.getSource() == EShSourceHlsl || options->optimizeSize) &&
!options->disableOptimizer) {
if ((intermediate.getSource() == EShSourceHlsl || options->optimizeSize) && !options->disableOptimizer)
SpirvToolsLegalize(intermediate, spirv, logger, options);
}
if (options->disassemble)
glslang::SpirvToolsDisassemble(std::cout, spirv);
#endif
glslang::GetThreadPoolAllocator().pop();

9
SPIRV/GlslangToSpv.h Normal file → Executable file
View File

@ -38,6 +38,7 @@
#pragma warning(disable : 4464) // relative include path contains '..'
#endif
#include "SpvTools.h"
#include "../glslang/Include/intermediate.h"
#include <string>
@ -47,14 +48,6 @@
namespace glslang {
struct SpvOptions {
SpvOptions() : generateDebugInfo(false), disableOptimizer(true),
optimizeSize(false) { }
bool generateDebugInfo;
bool disableOptimizer;
bool optimizeSize;
};
void GetSpirvVersion(std::string&);
int GetSpirvGeneratorVersion();
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,

188
SPIRV/SpvTools.cpp Executable file
View File

@ -0,0 +1,188 @@
//
// Copyright (C) 2014-2016 LunarG, Inc.
// Copyright (C) 2018 Google, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Call into SPIRV-Tools to disassemble, validate, and optimize.
//
#if ENABLE_OPT
#include <cstdio>
#include <iostream>
#include "SpvTools.h"
#include "spirv-tools/optimizer.hpp"
#include "spirv-tools/libspirv.h"
namespace glslang {
// Translate glslang's view of target versioning to what SPIRV-Tools uses.
spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger)
{
switch (spvVersion.vulkan) {
case glslang::EShTargetVulkan_1_0: return spv_target_env::SPV_ENV_VULKAN_1_0;
case glslang::EShTargetVulkan_1_1: return spv_target_env::SPV_ENV_VULKAN_1_1;
default:
break;
}
if (spvVersion.openGl > 0)
return spv_target_env::SPV_ENV_OPENGL_4_5;
logger->missingFunctionality("Target version for SPIRV-Tools validator");
return spv_target_env::SPV_ENV_UNIVERSAL_1_0;
}
// Use the SPIRV-Tools disassembler to print SPIR-V.
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv)
{
// disassemble
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3);
spv_text text;
spv_diagnostic diagnostic = nullptr;
spvBinaryToText(context, spirv.data(), spirv.size(),
SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | SPV_BINARY_TO_TEXT_OPTION_INDENT,
&text, &diagnostic);
// dump
if (diagnostic == nullptr)
out << text->str;
else
spvDiagnosticPrint(diagnostic);
// teardown
spvDiagnosticDestroy(diagnostic);
spvContextDestroy(context);
}
// Apply the SPIRV-Tools validator to generated SPIR-V.
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger)
{
// validate
spv_context context = spvContextCreate(MapToSpirvToolsEnv(intermediate.getSpv(), logger));
spv_const_binary_t binary = { spirv.data(), spirv.size() };
spv_diagnostic diagnostic = nullptr;
spv_validator_options options = spvValidatorOptionsCreate();
spvValidatorOptionsSetRelaxBlockLayout(options, intermediate.usingHlslOffsets());
spvValidateWithOptions(context, options, &binary, &diagnostic);
// report
if (diagnostic != nullptr) {
logger->error("SPIRV-Tools Validation Errors");
logger->error(diagnostic->error);
}
// tear down
spvValidatorOptionsDestroy(options);
spvDiagnosticDestroy(diagnostic);
spvContextDestroy(context);
}
// Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of
// legalizing HLSL SPIR-V.
void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger, const SpvOptions* options)
{
spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2;
spvtools::Optimizer optimizer(target_env);
optimizer.SetMessageConsumer(
[](spv_message_level_t level, const char *source, const spv_position_t &position, const char *message) {
auto &out = std::cerr;
switch (level)
{
case SPV_MSG_FATAL:
case SPV_MSG_INTERNAL_ERROR:
case SPV_MSG_ERROR:
out << "error: ";
break;
case SPV_MSG_WARNING:
out << "warning: ";
break;
case SPV_MSG_INFO:
case SPV_MSG_DEBUG:
out << "info: ";
break;
default:
break;
}
if (source)
{
out << source << ":";
}
out << position.line << ":" << position.column << ":" << position.index << ":";
if (message)
{
out << " " << message;
}
out << std::endl;
});
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
optimizer.RegisterPass(spvtools::CreateEliminateDeadFunctionsPass());
optimizer.RegisterPass(spvtools::CreateScalarReplacementPass());
optimizer.RegisterPass(spvtools::CreateLocalAccessChainConvertPass());
optimizer.RegisterPass(spvtools::CreateLocalSingleBlockLoadStoreElimPass());
optimizer.RegisterPass(spvtools::CreateLocalSingleStoreElimPass());
optimizer.RegisterPass(spvtools::CreateSimplificationPass());
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateVectorDCEPass());
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
optimizer.RegisterPass(spvtools::CreateBlockMergePass());
optimizer.RegisterPass(spvtools::CreateLocalMultiStoreElimPass());
optimizer.RegisterPass(spvtools::CreateIfConversionPass());
optimizer.RegisterPass(spvtools::CreateSimplificationPass());
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateVectorDCEPass());
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
if (options->optimizeSize) {
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
// TODO(greg-lunarg): Add this when AMD driver issues are resolved
// optimizer.RegisterPass(CreateCommonUniformElimPass());
}
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
optimizer.Run(spirv.data(), spirv.size(), &spirv);
}
#endif
}; // end namespace glslang

80
SPIRV/SpvTools.h Executable file
View File

@ -0,0 +1,80 @@
//
// Copyright (C) 2014-2016 LunarG, Inc.
// Copyright (C) 2018 Google, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Call into SPIRV-Tools to disassemble, validate, and optimize.
//
#pragma once
#ifndef GLSLANG_SPV_TOOLS_H
#define GLSLANG_SPV_TOOLS_H
#include <vector>
#include <ostream>
#include "../glslang/MachineIndependent/localintermediate.h"
#include "Logger.h"
namespace glslang {
struct SpvOptions {
SpvOptions() : generateDebugInfo(false), disableOptimizer(true),
optimizeSize(false), disassemble(false), validate(false) { }
bool generateDebugInfo;
bool disableOptimizer;
bool optimizeSize;
bool disassemble;
bool validate;
};
#if ENABLE_OPT
// Use the SPIRV-Tools disassembler to print SPIR-V.
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
// Apply the SPIRV-Tools validator to generated SPIR-V.
void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger*);
// Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of
// legalizing HLSL SPIR-V.
void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger*, const SpvOptions*);
#endif
}; // end namespace glslang
#endif // GLSLANG_SPV_TOOLS_H

View File

@ -46,6 +46,7 @@
#include "disassemble.h"
#include "doc.h"
#include "SpvTools.h"
namespace spv {
extern "C" {
@ -716,32 +717,4 @@ void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
SpirvStream.processInstructions();
}
#if ENABLE_OPT
#include "spirv-tools/libspirv.h"
// Use the SPIRV-Tools disassembler to print SPIR-V.
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv)
{
// disassemble
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3);
spv_text text;
spv_diagnostic diagnostic = nullptr;
spvBinaryToText(context, spirv.data(), spirv.size(),
SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES | SPV_BINARY_TO_TEXT_OPTION_INDENT,
&text, &diagnostic);
// dump
if (diagnostic == nullptr)
out << text->str;
else
spvDiagnosticPrint(diagnostic);
// teardown
spvDiagnosticDestroy(diagnostic);
spvContextDestroy(context);
}
#endif
}; // end namespace spv

View File

@ -48,9 +48,6 @@ namespace spv {
// disassemble with glslang custom disassembler
void Disassemble(std::ostream& out, const std::vector<unsigned int>&);
// disassemble with SPIRV-Tools disassembler
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& stream);
}; // end namespace spv
#endif // disassembler_H

View File

@ -103,6 +103,7 @@ enum TOptions {
};
bool targetHlslFunctionality1 = false;
bool SpvToolsDisassembler = false;
bool SpvToolsValidate = false;
//
// Return codes from main/exit().
@ -514,6 +515,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
break;
} else if (lowerword == "spirv-dis") {
SpvToolsDisassembler = true;
} else if (lowerword == "spirv-val") {
SpvToolsValidate = true;
} else if (lowerword == "stdin") {
Options |= EOptionStdin;
shaderStageName = argv[1];
@ -978,6 +981,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
spvOptions.generateDebugInfo = true;
spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0;
spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0;
spvOptions.disassemble = SpvToolsDisassembler;
spvOptions.validate = SpvToolsValidate;
glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv, &logger, &spvOptions);
// Dump the spv to a file or stdout, etc., but only if not doing
@ -989,13 +994,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
} else {
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
}
#if ENABLE_OPT
if (SpvToolsDisassembler)
spv::SpirvToolsDisassemble(std::cout, spirv);
#else
if (SpvToolsDisassembler)
printf("SPIRV-Tools is not enabled; use -H for human readable SPIR-V\n");
#endif
if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv))
spv::Disassemble(std::cout, spirv);
}
@ -1427,6 +1425,7 @@ void usage()
" --shift-cbuffer-binding | --scb synonyms for --shift-UBO-binding\n"
" --spirv-dis output standard-form disassembly; works only\n"
" when a SPIR-V generation option is also used\n"
" --spirv-val execute the SPIRV-Tools validator\n"
" --source-entrypoint <name> the given shader source function is\n"
" renamed to be the <name> given in -e\n"
" --sep synonym for --source-entrypoint\n"

View File

@ -69,6 +69,10 @@ output primitive = line_strip
0:? 'ps' ( in 3-element array of uint PointSize)
0:? 'OutputStream.ps' ( out float PointSize)
error: SPIRV-Tools Validation Errors
error: According to the Vulkan spec BuiltIn PointSize variable needs to be a 32-bit float scalar. ID <28> (OpVariable) is not a float scalar.
%29 = OpLoad %_arr_uint_uint_3 %ps_1
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 36

View File

@ -93,6 +93,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=7) out 4-component vector of float)
0:? 'input' (layout( location=8) in 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Operand 2 of Decorate requires one of these capabilities: InputAttachment
OpDecorate %attach InputAttachmentIndex 4
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 51

View File

@ -145,6 +145,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.a' (layout( location=0) out 4-component vector of float)
0:? 'input' ( in 4-component vector of float FragCoord)
error: SPIRV-Tools Validation Errors
error: Structure id 50 decorated as BufferBlock for variable in Uniform storage class must follow standard storage buffer layout rules: member 7 at offset 128 overlaps previous member ending at offset 171
%tbufName = OpTypeStruct %v4float %int %float %float %float %float %float %float %mat3v4float %mat3v4float %mat3v4float %mat3v4float
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 73

View File

@ -131,6 +131,10 @@ gl_FragCoord origin is upper left
0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Only a single level of array is allowed for descriptor set variables
%cb3_0 = OpVariable %_ptr_Uniform__arr__arr_cb3_uint_4_uint_2 Uniform
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 66

View File

@ -543,6 +543,10 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out int)
error: SPIRV-Tools Validation Errors
error: Matrix types can only be parameterized with floating-point types.
%mat4v4int = OpTypeMatrix %v4int 4
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 98

View File

@ -117,6 +117,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.nCoverageMask' ( out 1-element array of uint SampleMaskIn)
0:? '@entryPointOutput.vColor' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Input variable id <34> is used by entry point 'main' id <4>, but is not listed as an interface
%i_1 = OpVariable %_ptr_Input_PS_INPUT Input
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 52

View File

@ -49,6 +49,10 @@ gl_FragCoord origin is upper left
0:? 'i' ( temp structure{})
0:? Linker Objects
error: SPIRV-Tools Validation Errors
error: Input variable id <20> is used by entry point 'main' id <4>, but is not listed as an interface
%i_1 = OpVariable %_ptr_Input_ps_in Input
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 27

View File

@ -47,6 +47,10 @@ Shader version: 500
0:? 'i' ( temp structure{})
0:? Linker Objects
error: SPIRV-Tools Validation Errors
error: Input variable id <20> is used by entry point 'main' id <4>, but is not listed as an interface
%i_1 = OpVariable %_ptr_Input_vs_in Input
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 27

View File

@ -64,6 +64,10 @@ gl_FragCoord origin is upper left
0:? 'f1' ( global 1-component vector of float)
0:? 'scalar' ( global float)
error: SPIRV-Tools Validation Errors
error: Expected int scalar or vector type as Result Type: IMul
%20 = OpIMul %float %18 %19
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 27

View File

@ -1261,6 +1261,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image Operand ConstOffsets to be a const object
%90 = OpImageGather %v4float %76 %78 %int_0 ConstOffsets %89
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 399

View File

@ -1253,6 +1253,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image Operand ConstOffsets to be a const object
%90 = OpImageGather %v4float %76 %78 %int_0 ConstOffsets %89
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 389

View File

@ -715,6 +715,10 @@ local_size = (1, 1, 1)
0:? 'inU0' (layout( location=3) in 4-component vector of uint)
0:? 'inU1' (layout( location=4) in 4-component vector of uint)
error: SPIRV-Tools Validation Errors
error: Expected operand to be vector bool: All
%64 = OpAll %bool %63
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 265

View File

@ -153,6 +153,10 @@ gl_FragCoord origin is upper left
0:? 'inF4' (layout( location=3) in 4-component vector of float)
0:? 'inI2' (layout( location=4) flat in 2-component vector of int)
error: SPIRV-Tools Validation Errors
error: GLSL.std.450 InterpolateAtOffset: expected Interpolant storage class to be Input
%28 = OpExtInst %float %1 InterpolateAtOffset %inF1 %27
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 80

View File

@ -5643,6 +5643,10 @@ gl_FragCoord origin is upper left
0:? 'gs_uc4' ( shared 4-component vector of uint)
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Matrix types can only be parameterized with floating-point types.
%mat2v2bool = OpTypeMatrix %v2bool 2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 1836

View File

@ -2778,6 +2778,10 @@ Shader version: 500
0:413 'inFM3x2' ( in 3X2 matrix of float)
0:? Linker Objects
error: SPIRV-Tools Validation Errors
error: Matrix types can only be parameterized with floating-point types.
%mat2v2bool = OpTypeMatrix %v2bool 2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 1225

View File

@ -151,6 +151,10 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Illegal number of components (1) for TypeVector
%v1float = OpTypeVector %float 1
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 77

View File

@ -231,6 +231,10 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Illegal number of components (1) for TypeVector
%v1bool = OpTypeVector %bool 1
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 130

View File

@ -30,6 +30,10 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 1-component vector of float f1, uniform 1X1 matrix of float fmat11, uniform 4X1 matrix of float fmat41, uniform 1X2 matrix of float fmat12, uniform 2X3 matrix of double dmat23, uniform 4X4 matrix of int int44})
error: SPIRV-Tools Validation Errors
error: Illegal number of components (1) for TypeVector
%v1float = OpTypeVector %float 1
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 30

View File

@ -397,6 +397,10 @@ gl_FragCoord origin is upper left
0:? Linker Objects
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Illegal number of components (1) for TypeVector
%v1int = OpTypeVector %int 1
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 232

View File

@ -676,6 +676,10 @@ Shader version: 500
0:? 'inf' (layout( location=0) in float)
Missing functionality: matrix swizzle
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '42[f3]'s type does not match Object <id> '34's type.
OpStore %f3 %int_0
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 118

View File

@ -101,6 +101,10 @@ gl_FragCoord origin is upper left
0:? 'N2::gf' ( global float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: OpFunctionCall Function <id>'s parameter count does not match the argument count.
%43 = OpFunctionCall %v4float %N2__N3__C1__getVec_
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 54

View File

@ -399,6 +399,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image Operand Bias to be float scalar
%28 = OpImageSampleImplicitLod %v4float %23 %float_0_100000001 Bias|ConstOffset %int_1 %float_0_5
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 161

View File

@ -297,6 +297,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image Operand Bias to be float scalar
%31 = OpImageSampleImplicitLod %v4float %23 %27 Bias|ConstOffset %int_0 %float_0_5
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 118

View File

@ -397,6 +397,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%48 = OpImageSampleDrefImplicitLod %float %43 %46 %47
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 209

View File

@ -379,6 +379,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%41 = OpImageSampleDrefImplicitLod %float %38 %39 %40
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 198

View File

@ -325,6 +325,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%42 = OpImageSampleDrefImplicitLod %float %39 %40 %41 ConstOffset %int_2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 167

View File

@ -337,6 +337,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%49 = OpImageSampleDrefImplicitLod %float %44 %47 %48 ConstOffset %int_2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 178

View File

@ -433,6 +433,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%49 = OpImageSampleDrefExplicitLod %float %44 %47 %48 Lod %float_0
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 210

View File

@ -415,6 +415,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%42 = OpImageSampleDrefExplicitLod %float %39 %40 %41 Lod %float_0
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 199

View File

@ -349,6 +349,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%43 = OpImageSampleDrefExplicitLod %float %40 %41 %42 Lod|ConstOffset %float_0 %int_2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 168

View File

@ -361,6 +361,10 @@ using depth_any
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: Expected Image 'Sampled Type' to be the same as Result Type
%50 = OpImageSampleDrefExplicitLod %float %45 %48 %49 Lod|ConstOffset %float_0 %int_2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 179

View File

@ -155,6 +155,10 @@ output primitive = line_strip
0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance)
0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance)
error: SPIRV-Tools Validation Errors
error: According to the Vulkan spec BuiltIn Position variable needs to be a 4-component 32-bit float vector. ID <20> (OpVariable) is not a float vector.
OpStore %OutputStream_clip0 %25
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 65

View File

@ -207,6 +207,10 @@ gl_FragCoord origin is upper left
0:? 'input[1].f' (layout( location=2) in float)
0:? 'input[2].f' (layout( location=3) in float)
error: SPIRV-Tools Validation Errors
error: According to the Vulkan spec BuiltIn FragCoord variable needs to be a 4-component 32-bit float vector. ID <41> (OpVariable) is not a float vector.
%input_pos = OpVariable %_ptr_Input__arr_v4float_uint_3 Input
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 66

View File

@ -149,6 +149,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: Structure id 12 decorated as BufferBlock must be explicitly laid out with Offset decorations.
%__0 = OpTypeStruct %uint
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 70

View File

@ -473,6 +473,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: AtomicIAdd: expected Value to be of type Result Type
%28 = OpAtomicIAdd %uint %24 %uint_1 %uint_0 %int_1
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 87

View File

@ -323,6 +323,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '14[size]'s type does not match Object <id> '20's type.
OpStore %size %20
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 114

View File

@ -175,6 +175,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '26[size]'s type does not match Object <id> '33's type.
OpStore %size %33
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 78

View File

@ -137,6 +137,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: Structure id 20 decorated as BufferBlock must be explicitly laid out with Offset decorations.
%__1 = OpTypeStruct %uint
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 78

View File

@ -187,6 +187,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '43[size]'s type does not match Object <id> '44's type.
OpStore %size %44
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 96

View File

@ -175,6 +175,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '26[size]'s type does not match Object <id> '33's type.
OpStore %size %33
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 78

View File

@ -1003,6 +1003,10 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'pos' (layout( location=0) flat in uint)
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '14[size]'s type does not match Object <id> '20's type.
OpStore %size %20
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 239

View File

@ -837,6 +837,10 @@ gl_FragCoord origin is upper left
0:? 'g_tTex2s1a' ( uniform texture2D)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
error: SPIRV-Tools Validation Errors
error: OpStore Pointer <id> '185's type does not match Object <id> '184's type.
OpStore %185 %184
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 240

View File

@ -105,6 +105,10 @@ output primitive = triangle_strip
0:? 'TriStream' ( temp structure{})
0:? Linker Objects
error: SPIRV-Tools Validation Errors
error: Output variable id <23> is used by entry point 'main' id <4>, but is not listed as an interface
%TriStream_1 = OpVariable %_ptr_Output_GSPS_INPUT Output
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 57

View File

@ -1,6 +1,10 @@
spv.130.frag
WARNING: 0:31: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 205

View File

@ -1,4 +1,8 @@
spv.140.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 96

View File

@ -1,4 +1,8 @@
spv.150.geom
error: SPIRV-Tools Validation Errors
error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability GeometryStreams
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 71

View File

@ -1,4 +1,8 @@
spv.400.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 1118

View File

@ -1,4 +1,8 @@
spv.420.geom
error: SPIRV-Tools Validation Errors
error: Capability GeometryStreams is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability GeometryStreams
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 72

View File

@ -1,6 +1,10 @@
spv.AofA.frag
WARNING: 0:6: '[][]' : Generating SPIR-V array-of-arrays, but Vulkan only supports single array level for this resource
error: SPIRV-Tools Validation Errors
error: Only a single level of array is allowed for descriptor set variables
%nameAofA = OpVariable %_ptr_Uniform__arr__arr_uAofA_uint_5_uint_3 Uniform
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 104

View File

@ -1,4 +1,8 @@
spv.atomicInt64.comp
error: SPIRV-Tools Validation Errors
error: Capability Int64Atomics is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability Int64Atomics
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 149

View File

@ -1,4 +1,8 @@
spv.builtInXFB.vert
error: SPIRV-Tools Validation Errors
error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability TransformFeedback
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 21

View File

@ -7,6 +7,8 @@ WARNING: 0:24: '' : attribute with arguments not recognized, skipping
WARNING: 0:25: '' : attribute with arguments not recognized, skipping
WARNING: 0:26: '' : attribute with arguments not recognized, skipping
error: SPIRV-Tools Validation Errors
error: Invalid loop control operand: 4 has invalid mask component 4
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 118

View File

@ -1,4 +1,6 @@
spv.debugInfo.frag
error: SPIRV-Tools Validation Errors
error: Invalid SPIR-V binary version 1.3 for target environment SPIR-V 1.0 (under OpenGL 4.5 semantics).
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 124

View File

@ -1,4 +1,8 @@
spv.explicittypes.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension)
OpCapability Float16
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 576

View File

@ -1,4 +1,8 @@
spv.float16.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability Float16
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 534

View File

@ -1,4 +1,8 @@
spv.float16Fetch.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability Float16
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 5923

View File

@ -1,4 +1,8 @@
spv.float32.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension)
OpCapability Float16
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 533

View File

@ -1,4 +1,8 @@
spv.float64.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension)
OpCapability Float16
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 524

View File

@ -1,4 +1,8 @@
spv.image.frag
error: SPIRV-Tools Validation Errors
error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability ImageRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 376

View File

@ -1,4 +1,8 @@
spv.imageLoadStoreLod.frag
error: SPIRV-Tools Validation Errors
error: Image Operand Lod can only be used with ExplicitLod opcodes and OpImageFetch
%19 = OpImageRead %v4float %15 %int_1 Lod %int_3
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 82

View File

@ -1,4 +1,8 @@
spv.int16.amd.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability Float16
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 560

View File

@ -1,4 +1,8 @@
spv.int16.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability Float16
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 523

View File

@ -1,4 +1,8 @@
spv.int32.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension)
OpCapability Float16
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 493

View File

@ -1,4 +1,8 @@
spv.int8.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension)
OpCapability Float16
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 518

View File

@ -1,4 +1,8 @@
spv.memoryQualifier.frag
error: SPIRV-Tools Validation Errors
error: Capability ImageRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability ImageRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 97

View File

@ -1,4 +1,8 @@
spv.multiviewPerViewAttributes.tesc
error: SPIRV-Tools Validation Errors
error: OpMemberName Member <id> '5' index is larger than Type <id> '27[gl_PositionPerViewNV]'s member count.
OpMemberName %gl_PerVertex_0 5 "gl_PositionPerViewNV"
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 37

View File

@ -1,4 +1,8 @@
spv.newTexture.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 284

View File

@ -1,4 +1,8 @@
spv.paramMemory.frag
error: SPIRV-Tools Validation Errors
error: OpFunctionCall Argument <id> '38[image1]'s type does not match Function <id> '8's parameter type.
%41 = OpFunctionCall %v4float %image_load_I21_vi2_ %image1 %param
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 69

View File

@ -1,4 +1,8 @@
spv.queryL.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 224

View File

@ -1,4 +1,8 @@
spv.sampleMaskOverrideCoverage.frag
error: SPIRV-Tools Validation Errors
error: Operand 2 of Decorate requires one of these capabilities: SampleMaskOverrideCoverageNV
OpDecorate %gl_SampleMask OverrideCoverageNV
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 20

View File

@ -1,4 +1,8 @@
spv.separate.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 319

View File

@ -1,4 +1,8 @@
spv.shaderBallotAMD.comp
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability Float16
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 1343

View File

@ -1,4 +1,8 @@
spv.sparseTexture.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 438

View File

@ -1,4 +1,8 @@
spv.sparseTextureClamp.frag
error: SPIRV-Tools Validation Errors
error: Capability SampledRect is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability SampledRect
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 360

View File

@ -1,4 +1,8 @@
spv.stereoViewRendering.tesc
error: SPIRV-Tools Validation Errors
error: When BuiltIn decoration is applied to a structure-type member, all members of that structure type must also be decorated with BuiltIn (No allowed mixing of built-in variables and non-built-in variables within a single structure). Structure id 27 does not meet this requirement.
%gl_PerVertex_0 = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1 %v4float
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 38

View File

@ -1,4 +1,8 @@
spv.subgroupPartitioned.comp
error: SPIRV-Tools Validation Errors
error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUniformArithmetic GroupNonUniformClustered
%179 = OpGroupNonUniformFAdd %float %uint_3 PartitionedReduceNV %176 %177
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 2506

View File

@ -1,4 +1,8 @@
spv.textureGatherBiasLod.frag
error: SPIRV-Tools Validation Errors
error: Image Operand Bias can only be used with ImplicitLod opcodes
%27 = OpImageGather %v4float %17 %21 %int_0 Bias %26
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 298

View File

@ -1,4 +1,8 @@
spv.viewportArray2.tesc
error: SPIRV-Tools Validation Errors
error: Vulkan spec allows BuiltIn ViewportIndex to be used only with Vertex, TessellationEvaluation, Geometry, or Fragment execution models. ID <0> (OpStore) is referencing ID <22> (OpVariable) which is decorated with BuiltIn ViewportIndex in function <4> called with execution model TessellationControl.
OpStore %gl_ViewportIndex %int_2
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 25

View File

@ -1,4 +1,8 @@
spv.vulkan110.int16.frag
error: SPIRV-Tools Validation Errors
error: Capability Float16 is not allowed by Vulkan 1.1 specification (or requires extension)
OpCapability Float16
// Module Version 10300
// Generated by (magic number): 80007
// Id's are bound by 523

View File

@ -1,4 +1,8 @@
spv.xfb.vert
error: SPIRV-Tools Validation Errors
error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability TransformFeedback
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 16

View File

@ -1,4 +1,8 @@
spv.xfb2.vert
error: SPIRV-Tools Validation Errors
error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability TransformFeedback
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 35

View File

@ -1,4 +1,8 @@
spv.xfb3.vert
error: SPIRV-Tools Validation Errors
error: Capability TransformFeedback is not allowed by Vulkan 1.0 specification (or requires extension)
OpCapability TransformFeedback
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 35

View File

@ -130,13 +130,13 @@ diff -b $BASEDIR/spv.looseUniformNoLoc.vert.out $TARGETDIR/spv.looseUniformNoLoc
# Testing debug information
#
echo Testing SPV Debug Information
$EXE -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf \
$EXE -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out
diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1
$EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \
$EXE -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf --spirv-val \
-G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.1.1.frag.out
diff -b $BASEDIR/spv.debugInfo.1.1.frag.out $TARGETDIR/spv.debugInfo.1.1.frag.out || HASERROR=1
$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --spirv-val --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
--sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out
diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1

View File

@ -41,6 +41,8 @@
#include "../Public/ShaderLang.h"
#include "Versions.h"
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <array>

View File

@ -79,6 +79,7 @@ TEST_P(LinkTestVulkan, FromFile)
std::vector<uint32_t> spirv_binary;
glslang::SpvOptions options;
options.disableOptimizer = true;
options.validate = true;
glslang::GlslangToSpv(*program.getIntermediate(shaders.front()->getStage()),
spirv_binary, &logger, &options);

9
gtests/TestFixture.h Normal file → Executable file
View File

@ -243,6 +243,7 @@ public:
std::vector<uint32_t> spirv_binary;
glslang::SpvOptions options;
options.disableOptimizer = !enableOptimizer;
options.validate = true;
glslang::GlslangToSpv(*program.getIntermediate(stage),
spirv_binary, &logger, &options);
@ -298,8 +299,10 @@ public:
if (success && (controls & EShMsgSpvRules)) {
std::vector<uint32_t> spirv_binary;
glslang::SpvOptions options;
options.validate = true;
glslang::GlslangToSpv(*program.getIntermediate(stage),
spirv_binary, &logger);
spirv_binary, &logger, &options);
std::ostringstream disassembly_stream;
spv::Parameterize();
@ -338,8 +341,10 @@ public:
if (success && (controls & EShMsgSpvRules)) {
std::vector<uint32_t> spirv_binary;
glslang::SpvOptions options;
options.validate = true;
glslang::GlslangToSpv(*program.getIntermediate(stage),
spirv_binary, &logger);
spirv_binary, &logger, &options);
spv::spirvbin_t(0 /*verbosity*/).remap(spirv_binary, remapOptions);

2
known_good.json Normal file → Executable file
View File

@ -5,7 +5,7 @@
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools",
"subdir" : "External/spirv-tools",
"commit" : "714bf84e58abd9573488fc365707fb8f288ca73c"
"commit" : "6d27a8350fbc339909834a6ef339c805cb1ab69b"
},
{
"name" : "spirv-tools/external/spirv-headers",