Revert "Add support for top-level uniforms in SPIR-V."

This reverts commit acba30420c.

Reason for revert: ASAN breakage on tree for
Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN

 Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame
     #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf)
   This frame has 35 object(s):
     [32, 104) 'body' (line 3363)
     [144, 152) 'main' (line 3365)
     [176, 184) 'ref.tmp' (line 3366)
     [208, 240) '__begin1' (line 3366)
     [272, 304) '__end1' (line 3366)
     [336, 344) 'ref.tmp27' (line 3370)
     [368, 384) 'ref.tmp31' (line 3371)
     [400, 416) 'interfaceVars' (line 3382)
     [432, 440) 'ref.tmp48' (line 3383)
     [464, 496) '__begin151' (line 3383)
     [528, 560) '__end154' (line 3383)
     [592, 596) 'id' (line 3386)
     [608, 624) 'tmp' (line 3393)
     [640, 648) 'ref.tmp114' (line 3398)
     [672, 704) '__begin1117' (line 3398)
     [736, 768) '__end1120' (line 3398)
     [800, 1008) 'uniformBuffer' (line 3405)
     [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable
     [1344, 1360) 'agg.tmp'
     [1376, 1576) 'adapter' (line 3411)
     [1648, 1848) 'ref.tmp179' (line 3413)
     [1920, 1928) 'ref.tmp191' (line 3415)
     [1952, 1960) 'ref.tmp210' (line 3421)
     [1984, 2016) '__begin1213' (line 3421)
     [2048, 2080) '__end1216' (line 3421)
     [2112, 2120) '__begin1242' (line 3427)
     [2144, 2152) '__end1247' (line 3427)
     [2176, 2192) 'entry256' (line 3427)
     [2208, 2224) 'tmp298' (line 3433)
     [2240, 2256) 'agg.tmp307'
     [2272, 2280) '__begin1365' (line 3457)
     [2304, 2312) 'ref.tmp415' (line 3469)
     [2336, 2368) '__begin1418' (line 3469)
     [2400, 2432) '__end1421' (line 3469)
     [2464, 2480) 'agg.tmp436'

Original change's description:
> Add support for top-level uniforms in SPIR-V.
>
> Previously, a uniform not wrapped in an interface block would report a
> SPIR-V error:
>
> "Variables identified with the Uniform storage class are
> used to access transparent buffer backed resources. Such variables must
> be typed as OpTypeStruct, or an array of this type..."
>
> Now, the SPIR-V code generator automatically detects such global
> variables and synthesizes a struct named _UniformBuffer to hold them.
> When these variables are accessed, an OpAccessChain instruction is added
> to grab the variable out of the struct.
>
> Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66
> Bug: skia:11225
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This commit is contained in:
John Stiles 2021-01-29 09:19:39 -05:00 committed by Skia Commit-Bot
parent b576168c8c
commit 0de76f72cd
12 changed files with 455 additions and 551 deletions

View File

@ -1742,7 +1742,7 @@ std::vector<SpvId> SPIRVCodeGenerator::getAccessChain(const Expression& expr, Ou
case Expression::Kind::kFieldAccess: {
const FieldAccess& fieldExpr = expr.as<FieldAccess>();
chain = this->getAccessChain(*fieldExpr.base(), out);
IntLiteral index(fContext, /*offset=*/-1, fieldExpr.fieldIndex());
IntLiteral index(fContext, -1, fieldExpr.fieldIndex());
chain.push_back(this->writeIntLiteral(index));
break;
}
@ -1867,30 +1867,14 @@ private:
const SPIRVCodeGenerator::Precision fPrecision;
};
int SPIRVCodeGenerator::findUniformFieldIndex(const Variable& var) const {
auto iter = fTopLevelUniformMap.find(&var);
return (iter != fTopLevelUniformMap.end()) ? iter->second : -1;
}
std::unique_ptr<SPIRVCodeGenerator::LValue> SPIRVCodeGenerator::getLValue(const Expression& expr,
OutputStream& out) {
const Type& type = expr.type();
Precision precision = type.highPrecision() ? Precision::kHigh : Precision::kLow;
switch (expr.kind()) {
case Expression::Kind::kVariableReference: {
const Variable& var = *expr.as<VariableReference>().variable();
int uniformIdx = this->findUniformFieldIndex(var);
if (uniformIdx >= 0) {
IntLiteral uniformIdxLiteral{fContext, /*offset=*/-1, uniformIdx};
SpvId memberId = this->nextId();
SpvId typeId = this->getPointerType(type, SpvStorageClassUniform);
SpvId uniformIdxId = this->writeIntLiteral(uniformIdxLiteral);
this->writeInstruction(SpvOpAccessChain, typeId, memberId, fUniformBufferId,
uniformIdxId, out);
return std::make_unique<PointerLValue>(*this, memberId, this->getType(type),
precision);
}
SpvId typeId;
const Variable& var = *expr.as<VariableReference>().variable();
if (var.modifiers().fLayout.fBuiltin == SK_IN_BUILTIN) {
typeId = this->getType(*Type::MakeArrayType("sk_in", var.type().componentType(),
fSkInCount));
@ -1971,21 +1955,13 @@ std::unique_ptr<SPIRVCodeGenerator::LValue> SPIRVCodeGenerator::getLValue(const
}
SpvId SPIRVCodeGenerator::writeVariableReference(const VariableReference& ref, OutputStream& out) {
// Is this variable is actually a uniform at global scope?
const Variable* variable = ref.variable();
if (this->findUniformFieldIndex(*variable) >= 0) {
// SPIR-V doesn't allow uniforms at global scope, so we've stashed them in an interface
// block. We need to fetch it from there. getLValue knows how to do this.
return this->getLValue(ref, out)->load(out);
}
SpvId result = this->nextId();
auto entry = fVariableMap.find(variable);
auto entry = fVariableMap.find(ref.variable());
SkASSERT(entry != fVariableMap.end());
SpvId var = entry->second;
this->writeInstruction(SpvOpLoad, this->getType(variable->type()), result, var, out);
this->writePrecisionModifier(variable->type(), result);
if (variable->modifiers().fLayout.fBuiltin == SK_FRAGCOORD_BUILTIN &&
this->writeInstruction(SpvOpLoad, this->getType(ref.variable()->type()), result, var, out);
this->writePrecisionModifier(ref.variable()->type(), result);
if (ref.variable()->modifiers().fLayout.fBuiltin == SK_FRAGCOORD_BUILTIN &&
fProgram.fSettings.fFlipY) {
// The x component never changes, so just grab it
SpvId xId = this->nextId();
@ -2007,14 +1983,11 @@ SpvId SPIRVCodeGenerator::writeVariableReference(const VariableReference& ref, O
fErrors.error(ref.fOffset, "RTHeightOffset is negative");
}
fields.emplace_back(
Modifiers(Layout(/*flags=*/0, /*location=*/-1,
fProgram.fSettings.fRTHeightOffset,
/*binding=*/-1, /*index=*/-1, /*set=*/-1, /*builtin=*/-1,
/*inputAttachmentIndex=*/-1, Layout::Format::kUnspecified,
Layout::kUnspecified_Primitive, /*maxVertices=*/1,
/*invocations=*/-1, /*marker=*/"", /*when=*/"",
Modifiers(Layout(0, -1, fProgram.fSettings.fRTHeightOffset, -1, -1, -1, -1,
-1, Layout::Format::kUnspecified,
Layout::kUnspecified_Primitive, 1, -1, "", "",
Layout::kNo_Key, Layout::CType::kDefault),
/*flags=*/0),
0),
SKSL_RTHEIGHT_NAME, fContext.fTypes.fFloat.get());
StringFragment name("sksl_synthetic_uniforms");
std::unique_ptr<Type> intfStruct = Type::MakeStructType(/*offset=*/-1, name,
@ -2028,14 +2001,11 @@ SpvId SPIRVCodeGenerator::writeVariableReference(const VariableReference& ref, O
fErrors.error(ref.fOffset, "layout(set=...) is required in SPIR-V");
}
bool usePushConstants = fProgram.fSettings.fUsePushConstants;
int flags = usePushConstants ? Layout::Flag::kPushConstant_Flag : 0;
Modifiers modifiers(
Layout(flags, /*location=*/-1, /*offset=*/-1, binding, /*index=*/-1,
set, /*builtin=*/-1, /*inputAttachmentIndex=*/-1,
Layout::Format::kUnspecified, Layout::kUnspecified_Primitive,
/*maxVertices=*/-1, /*invocations=*/-1, /*marker=*/"", /*when=*/"",
Layout::kNo_Key, Layout::CType::kDefault),
Modifiers::kUniform_Flag);
Layout layout;
layout.fFlags = usePushConstants ? Layout::Flag::kPushConstant_Flag : 0;
layout.fBinding = binding;
layout.fSet = set;
Modifiers modifiers(layout, Modifiers::kUniform_Flag);
const Variable* intfVar = fSynthetics.takeOwnershipOfSymbol(
std::make_unique<Variable>(/*offset=*/-1,
fProgram.fModifiers->addToPool(modifiers),
@ -2097,7 +2067,7 @@ SpvId SPIRVCodeGenerator::writeVariableReference(const VariableReference& ref, O
return adjusted;
}
if (variable->modifiers().fLayout.fBuiltin == SK_CLOCKWISE_BUILTIN &&
if (ref.variable()->modifiers().fLayout.fBuiltin == SK_CLOCKWISE_BUILTIN &&
!fProgram.fSettings.fFlipY) {
// FrontFacing in Vulkan is defined in terms of a top-down render target. In skia, we use
// the default convention of "counter-clockwise face is front".
@ -2912,7 +2882,8 @@ static bool is_dead(const Variable& var, const ProgramUsage* usage) {
return var.modifiers().fLayout.fBuiltin == SK_SAMPLEMASK_BUILTIN;
}
void SPIRVCodeGenerator::writeGlobalVar(Program::Kind kind, const VarDeclaration& varDecl) {
void SPIRVCodeGenerator::writeGlobalVar(Program::Kind kind, const VarDeclaration& varDecl,
OutputStream& out) {
const Variable& var = varDecl.var();
// These haven't been implemented in our SPIR-V generator yet and we only currently use them
// in the OpenGL backend.
@ -2935,15 +2906,11 @@ void SPIRVCodeGenerator::writeGlobalVar(Program::Kind kind, const VarDeclaration
if (is_dead(var, fProgram.fUsage.get())) {
return;
}
SpvStorageClass_ storageClass = get_storage_class(var, SpvStorageClassPrivate);
if (storageClass == SpvStorageClassUniform) {
// Top-level uniforms are emitted in writeUniformBuffer.
fTopLevelUniforms.push_back(&varDecl);
return;
}
const Type& type = var.type();
SpvStorageClass_ storageClass = get_storage_class(var, SpvStorageClassPrivate);
Layout layout = var.modifiers().fLayout;
if (layout.fSet < 0 && storageClass == SpvStorageClassUniformConstant) {
if (layout.fSet < 0 && (storageClass == SpvStorageClassUniform ||
storageClass == SpvStorageClassUniformConstant)) {
layout.fSet = fProgram.fSettings.fDefaultUniformSet;
}
SpvId id = this->nextId();
@ -3260,18 +3227,14 @@ void SPIRVCodeGenerator::writeGeometryShaderExecutionMode(SpvId entryPoint, Outp
invocations, out);
}
// Given any function, returns the top-level symbol table (OUTSIDE of the function's scope).
static std::shared_ptr<SymbolTable> get_top_level_symbol_table(const FunctionDeclaration& anyFunc) {
return anyFunc.definition()->body()->as<Block>().symbolTable()->fParent;
}
SPIRVCodeGenerator::EntrypointAdapter SPIRVCodeGenerator::writeEntrypointAdapter(
const FunctionDeclaration& main) {
// Our goal is to synthesize a tiny helper function which looks like this:
// void _entrypoint() { sk_FragColor = main(); }
// Fish a symbol table out of main().
std::shared_ptr<SymbolTable> symbolTable = get_top_level_symbol_table(main);
std::shared_ptr<SymbolTable> symbolTable =
main.definition()->body()->as<Block>().symbolTable()->fParent;
// Get `sk_FragColor` as a writable reference.
const Symbol* skFragColorSymbol = (*symbolTable)["sk_FragColor"];
@ -3322,45 +3285,6 @@ SPIRVCodeGenerator::EntrypointAdapter SPIRVCodeGenerator::writeEntrypointAdapter
return adapter;
}
SPIRVCodeGenerator::UniformBuffer SPIRVCodeGenerator::writeUniformBuffer(
std::shared_ptr<SymbolTable> topLevelSymbolTable) {
SkASSERT(!fTopLevelUniforms.empty());
static constexpr char kUniformBufferName[] = "_UniformBuffer";
SPIRVCodeGenerator::UniformBuffer uniformBuffer;
// Convert the list of top-level uniforms into a matching struct named _UniformBuffer, and build
// a lookup table of variables to UniformBuffer field indices.
std::vector<Type::Field> fields;
fields.reserve(fTopLevelUniforms.size());
fTopLevelUniformMap.reserve(fTopLevelUniforms.size());
for (const VarDeclaration* topLevelUniform : fTopLevelUniforms) {
const Variable* var = &topLevelUniform->var();
fTopLevelUniformMap[var] = (int)fields.size();
fields.emplace_back(var->modifiers(), var->name(), &var->type());
}
uniformBuffer.fStruct = Type::MakeStructType(/*offset=*/-1, kUniformBufferName,
std::move(fields));
// Create a global variable to contain this struct.
uniformBuffer.fLayout.fBinding = fProgram.fSettings.fDefaultUniformBinding;
uniformBuffer.fLayout.fSet = fProgram.fSettings.fDefaultUniformSet;
uniformBuffer.fModifiers = Modifiers{uniformBuffer.fLayout, Modifiers::kUniform_Flag};
uniformBuffer.fInnerVariable = std::make_unique<Variable>(
/*offset=*/-1, &uniformBuffer.fModifiers, kUniformBufferName,
uniformBuffer.fStruct.get(), /*builtin=*/false, Variable::Storage::kGlobal);
// Create an interface block object for this global variable.
uniformBuffer.fInterfaceBlock = std::make_unique<InterfaceBlock>(
/*offset=*/-1, uniformBuffer.fInnerVariable.get(), kUniformBufferName,
kUniformBufferName, /*arraySize=*/0, topLevelSymbolTable);
// Generate an interface block and hold onto its ID.
fUniformBufferId = this->writeInterfaceBlock(*uniformBuffer.fInterfaceBlock);
return uniformBuffer;
}
void SPIRVCodeGenerator::writeInstructions(const Program& program, OutputStream& out) {
fGLSLExtendedInstructions = this->nextId();
StringStream body;
@ -3401,14 +3325,10 @@ void SPIRVCodeGenerator::writeInstructions(const Program& program, OutputStream&
for (const ProgramElement* e : program.elements()) {
if (e->is<GlobalVarDeclaration>()) {
this->writeGlobalVar(program.fKind,
e->as<GlobalVarDeclaration>().declaration()->as<VarDeclaration>());
e->as<GlobalVarDeclaration>().declaration()->as<VarDeclaration>(),
body);
}
}
// Emit top-level uniforms into a dedicated uniform buffer.
UniformBuffer uniformBuffer;
if (!fTopLevelUniforms.empty()) {
uniformBuffer = this->writeUniformBuffer(get_top_level_symbol_table(*main));
}
// If main() returns a half4, synthesize a tiny entrypoint function which invokes the real
// main() and stores the result into sk_FragColor.
EntrypointAdapter adapter;

View File

@ -195,14 +195,12 @@ private:
SpvId writeFunction(const FunctionDefinition& f, OutputStream& out);
void writeGlobalVar(Program::Kind kind, const VarDeclaration& v);
void writeGlobalVar(Program::Kind kind, const VarDeclaration& v, OutputStream& out);
void writeVarDeclaration(const VarDeclaration& var, OutputStream& out);
SpvId writeVariableReference(const VariableReference& ref, OutputStream& out);
int findUniformFieldIndex(const Variable& var) const;
std::unique_ptr<LValue> getLValue(const Expression& value, OutputStream& out);
SpvId writeExpression(const Expression& expr, OutputStream& out);
@ -396,16 +394,6 @@ private:
EntrypointAdapter writeEntrypointAdapter(const FunctionDeclaration& main);
struct UniformBuffer {
std::unique_ptr<InterfaceBlock> fInterfaceBlock;
std::unique_ptr<Variable> fInnerVariable;
std::unique_ptr<Type> fStruct;
Layout fLayout;
Modifiers fModifiers;
};
UniformBuffer writeUniformBuffer(std::shared_ptr<SymbolTable> topLevelSymbolTable);
const Context& fContext;
const MemoryLayout fDefaultLayout;
@ -443,11 +431,6 @@ private:
// holds variables synthesized during output, for lifetime purposes
SymbolTable fSynthetics;
int fSkInCount = 1;
// Holds a list of uniforms that were declared as globals at the top-level instead of in an
// interface block.
std::vector<const VarDeclaration*> fTopLevelUniforms;
std::unordered_map<const Variable*, int> fTopLevelUniformMap; //<var, UniformBuffer field index>
SpvId fUniformBufferId = -1;
friend class PointerLValue;
friend class SwizzleLValue;

View File

@ -243,8 +243,7 @@ public:
/**
* For matrices and vectors, returns the type of individual cells (e.g. mat2 has a component
* type of Float). For arrays, returns the base type. For all other types, returns the type
* itself.
* type of Float). For all other types, returns the type itself.
*/
const Type& componentType() const {
if (fComponentType) {

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '10[%colorXform]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%colorXform = OpVariable %_ptr_Uniform_mat4v4float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,9 +12,8 @@ OpEntryPoint Fragment %main "main" %sk_FragColor %sk_Clockwise
OpExecutionMode %main OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
OpName %colorXform "colorXform"
OpName %s "s"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "colorXform"
OpName %main "main"
OpName %tmpColor "tmpColor"
OpDecorate %sk_FragColor RelaxedPrecision
@ -15,17 +21,11 @@ OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
OpDecorate %sk_Clockwise RelaxedPrecision
OpDecorate %sk_Clockwise BuiltIn FrontFacing
OpDecorate %colorXform DescriptorSet 0
OpDecorate %s RelaxedPrecision
OpDecorate %s Binding 0
OpDecorate %s DescriptorSet 0
OpMemberDecorate %_UniformBuffer 0 DescriptorSet 0
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 ColMajor
OpMemberDecorate %_UniformBuffer 0 MatrixStride 16
OpDecorate %_UniformBuffer Block
OpDecorate %14 Binding 0
OpDecorate %14 DescriptorSet 0
OpDecorate %24 RelaxedPrecision
OpDecorate %23 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@ -33,91 +33,87 @@ OpDecorate %24 RelaxedPrecision
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
%13 = OpTypeImage %float 2D 0 0 0 1 Unknown
%12 = OpTypeSampledImage %13
%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12
%s = OpVariable %_ptr_UniformConstant_12 UniformConstant
%mat4v4float = OpTypeMatrix %v4float 4
%_UniformBuffer = OpTypeStruct %mat4v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%14 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
%colorXform = OpVariable %_ptr_Uniform_mat4v4float Uniform
%16 = OpTypeImage %float 2D 0 0 0 1 Unknown
%15 = OpTypeSampledImage %16
%_ptr_UniformConstant_15 = OpTypePointer UniformConstant %15
%s = OpVariable %_ptr_UniformConstant_15 UniformConstant
%void = OpTypeVoid
%19 = OpTypeFunction %void
%18 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
%v2float = OpTypeVector %float 2
%float_1 = OpConstant %float 1
%27 = OpConstantComposite %v2float %float_1 %float_1
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%26 = OpConstantComposite %v2float %float_1 %float_1
%float_0 = OpConstant %float 0
%v4bool = OpTypeVector %bool 4
%v3float = OpTypeVector %float 3
%main = OpFunction %void None %19
%20 = OpLabel
%main = OpFunction %void None %18
%19 = OpLabel
%tmpColor = OpVariable %_ptr_Function_v4float Function
%59 = OpVariable %_ptr_Function_v4float Function
%24 = OpLoad %12 %s
%23 = OpImageSampleImplicitLod %v4float %24 %27
OpStore %tmpColor %23
%28 = OpAccessChain %_ptr_Uniform_mat4v4float %14 %int_0
%32 = OpLoad %mat4v4float %28
%35 = OpCompositeConstruct %v4float %float_1 %float_0 %float_0 %float_0
%36 = OpCompositeConstruct %v4float %float_0 %float_1 %float_0 %float_0
%37 = OpCompositeConstruct %v4float %float_0 %float_0 %float_1 %float_0
%38 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_1
%33 = OpCompositeConstruct %mat4v4float %35 %36 %37 %38
%40 = OpCompositeExtract %v4float %32 0
%41 = OpCompositeExtract %v4float %33 0
%42 = OpFOrdNotEqual %v4bool %40 %41
%43 = OpAny %bool %42
%44 = OpCompositeExtract %v4float %32 1
%45 = OpCompositeExtract %v4float %33 1
%54 = OpVariable %_ptr_Function_v4float Function
%23 = OpLoad %15 %s
%22 = OpImageSampleImplicitLod %v4float %23 %26
OpStore %tmpColor %22
%27 = OpLoad %mat4v4float %colorXform
%30 = OpCompositeConstruct %v4float %float_1 %float_0 %float_0 %float_0
%31 = OpCompositeConstruct %v4float %float_0 %float_1 %float_0 %float_0
%32 = OpCompositeConstruct %v4float %float_0 %float_0 %float_1 %float_0
%33 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %float_1
%28 = OpCompositeConstruct %mat4v4float %30 %31 %32 %33
%35 = OpCompositeExtract %v4float %27 0
%36 = OpCompositeExtract %v4float %28 0
%37 = OpFOrdNotEqual %v4bool %35 %36
%38 = OpAny %bool %37
%39 = OpCompositeExtract %v4float %27 1
%40 = OpCompositeExtract %v4float %28 1
%41 = OpFOrdNotEqual %v4bool %39 %40
%42 = OpAny %bool %41
%43 = OpLogicalOr %bool %38 %42
%44 = OpCompositeExtract %v4float %27 2
%45 = OpCompositeExtract %v4float %28 2
%46 = OpFOrdNotEqual %v4bool %44 %45
%47 = OpAny %bool %46
%48 = OpLogicalOr %bool %43 %47
%49 = OpCompositeExtract %v4float %32 2
%50 = OpCompositeExtract %v4float %33 2
%49 = OpCompositeExtract %v4float %27 3
%50 = OpCompositeExtract %v4float %28 3
%51 = OpFOrdNotEqual %v4bool %49 %50
%52 = OpAny %bool %51
%53 = OpLogicalOr %bool %48 %52
%54 = OpCompositeExtract %v4float %32 3
%55 = OpCompositeExtract %v4float %33 3
%56 = OpFOrdNotEqual %v4bool %54 %55
%57 = OpAny %bool %56
%58 = OpLogicalOr %bool %53 %57
OpSelectionMerge %62 None
OpBranchConditional %58 %60 %61
%60 = OpLabel
%64 = OpAccessChain %_ptr_Uniform_mat4v4float %14 %int_0
%65 = OpLoad %mat4v4float %64
%66 = OpLoad %v4float %tmpColor
%67 = OpVectorShuffle %v3float %66 %66 0 1 2
%69 = OpCompositeExtract %float %67 0
%70 = OpCompositeExtract %float %67 1
%71 = OpCompositeExtract %float %67 2
%72 = OpCompositeConstruct %v4float %69 %70 %71 %float_1
%73 = OpMatrixTimesVector %v4float %65 %72
%74 = OpVectorShuffle %v3float %73 %73 0 1 2
%75 = OpCompositeConstruct %v3float %float_0 %float_0 %float_0
OpSelectionMerge %57 None
OpBranchConditional %53 %55 %56
%55 = OpLabel
%59 = OpLoad %mat4v4float %colorXform
%60 = OpLoad %v4float %tmpColor
%61 = OpVectorShuffle %v3float %60 %60 0 1 2
%63 = OpCompositeExtract %float %61 0
%64 = OpCompositeExtract %float %61 1
%65 = OpCompositeExtract %float %61 2
%66 = OpCompositeConstruct %v4float %63 %64 %65 %float_1
%67 = OpMatrixTimesVector %v4float %59 %66
%68 = OpVectorShuffle %v3float %67 %67 0 1 2
%69 = OpCompositeConstruct %v3float %float_0 %float_0 %float_0
%70 = OpLoad %v4float %tmpColor
%71 = OpCompositeExtract %float %70 3
%72 = OpCompositeConstruct %v3float %71 %71 %71
%58 = OpExtInst %v3float %1 FClamp %68 %69 %72
%73 = OpCompositeExtract %float %58 0
%74 = OpCompositeExtract %float %58 1
%75 = OpCompositeExtract %float %58 2
%76 = OpLoad %v4float %tmpColor
%77 = OpCompositeExtract %float %76 3
%78 = OpCompositeConstruct %v3float %77 %77 %77
%63 = OpExtInst %v3float %1 FClamp %74 %75 %78
%79 = OpCompositeExtract %float %63 0
%80 = OpCompositeExtract %float %63 1
%81 = OpCompositeExtract %float %63 2
%82 = OpLoad %v4float %tmpColor
%83 = OpCompositeExtract %float %82 3
%84 = OpCompositeConstruct %v4float %79 %80 %81 %83
OpStore %59 %84
OpBranch %62
%61 = OpLabel
%85 = OpLoad %v4float %tmpColor
OpStore %59 %85
OpBranch %62
%62 = OpLabel
%86 = OpLoad %v4float %59
OpStore %sk_FragColor %86
%78 = OpCompositeConstruct %v4float %73 %74 %75 %77
OpStore %54 %78
OpBranch %57
%56 = OpLabel
%79 = OpLoad %v4float %tmpColor
OpStore %54 %79
OpBranch %57
%57 = OpLabel
%80 = OpLoad %v4float %54
OpStore %sk_FragColor %80
OpReturn
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '10[%colorWhite]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%colorWhite = OpVariable %_ptr_Uniform_v4float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,8 +12,7 @@ OpEntryPoint Fragment %_entrypoint "_entrypoint" %sk_FragColor %sk_Clockwise
OpExecutionMode %_entrypoint OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "colorWhite"
OpName %colorWhite "colorWhite"
OpName %_entrypoint "_entrypoint"
OpName %main "main"
OpName %x "x"
@ -17,23 +23,20 @@ OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
OpDecorate %sk_Clockwise RelaxedPrecision
OpDecorate %sk_Clockwise BuiltIn FrontFacing
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpDecorate %_UniformBuffer Block
OpDecorate %10 Binding 0
OpDecorate %10 DescriptorSet 0
OpDecorate %26 RelaxedPrecision
OpDecorate %35 RelaxedPrecision
OpDecorate %39 RelaxedPrecision
OpDecorate %43 RelaxedPrecision
OpDecorate %48 RelaxedPrecision
OpDecorate %49 RelaxedPrecision
OpDecorate %56 RelaxedPrecision
OpDecorate %colorWhite RelaxedPrecision
OpDecorate %colorWhite DescriptorSet 0
OpDecorate %21 RelaxedPrecision
OpDecorate %30 RelaxedPrecision
OpDecorate %34 RelaxedPrecision
OpDecorate %40 RelaxedPrecision
OpDecorate %45 RelaxedPrecision
OpDecorate %46 RelaxedPrecision
OpDecorate %53 RelaxedPrecision
OpDecorate %55 RelaxedPrecision
OpDecorate %58 RelaxedPrecision
OpDecorate %61 RelaxedPrecision
OpDecorate %68 RelaxedPrecision
OpDecorate %69 RelaxedPrecision
OpDecorate %70 RelaxedPrecision
OpDecorate %65 RelaxedPrecision
OpDecorate %66 RelaxedPrecision
OpDecorate %67 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@ -41,96 +44,95 @@ OpDecorate %70 RelaxedPrecision
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
%_UniformBuffer = OpTypeStruct %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%10 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid
%15 = OpTypeFunction %void
%18 = OpTypeFunction %v4float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%colorWhite = OpVariable %_ptr_Uniform_v4float Uniform
%void = OpTypeVoid
%14 = OpTypeFunction %void
%17 = OpTypeFunction %v4float
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Function_float = OpTypePointer Function %float
%float_n5 = OpConstant %float -5
%float_5 = OpConstant %float 5
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_2 = OpConstant %int 2
%int_1 = OpConstant %int 1
%_entrypoint = OpFunction %void None %15
%16 = OpLabel
%17 = OpFunctionCall %v4float %main
OpStore %sk_FragColor %17
%_entrypoint = OpFunction %void None %14
%15 = OpLabel
%16 = OpFunctionCall %v4float %main
OpStore %sk_FragColor %16
OpReturn
OpFunctionEnd
%main = OpFunction %v4float None %18
%19 = OpLabel
%main = OpFunction %v4float None %17
%18 = OpLabel
%x = OpVariable %_ptr_Function_v4float Function
%r = OpVariable %_ptr_Function_float Function
%b = OpVariable %_ptr_Function_float Function
%22 = OpAccessChain %_ptr_Uniform_v4float %10 %int_0
%26 = OpLoad %v4float %22
OpStore %x %26
%21 = OpLoad %v4float %colorWhite
OpStore %x %21
OpStore %r %float_n5
OpBranch %30
%30 = OpLabel
OpLoopMerge %34 %33 None
OpBranch %31
%31 = OpLabel
%35 = OpLoad %float %r
%37 = OpFOrdLessThan %bool %35 %float_5
OpBranchConditional %37 %32 %34
%32 = OpLabel
%39 = OpLoad %float %r
%38 = OpExtInst %float %1 FClamp %39 %float_0 %float_1
%42 = OpAccessChain %_ptr_Function_float %x %int_0
OpStore %42 %38
%43 = OpLoad %v4float %x
%44 = OpCompositeExtract %float %43 0
%45 = OpFOrdEqual %bool %44 %float_0
OpSelectionMerge %47 None
OpBranchConditional %45 %46 %47
%46 = OpLabel
OpBranch %34
%47 = OpLabel
OpBranch %33
%33 = OpLabel
%48 = OpLoad %float %r
%49 = OpFAdd %float %48 %float_1
OpStore %r %49
OpBranch %30
%34 = OpLabel
OpBranch %25
%25 = OpLabel
OpLoopMerge %29 %28 None
OpBranch %26
%26 = OpLabel
%30 = OpLoad %float %r
%32 = OpFOrdLessThan %bool %30 %float_5
OpBranchConditional %32 %27 %29
%27 = OpLabel
%34 = OpLoad %float %r
%33 = OpExtInst %float %1 FClamp %34 %float_0 %float_1
%37 = OpAccessChain %_ptr_Function_float %x %int_0
OpStore %37 %33
%40 = OpLoad %v4float %x
%41 = OpCompositeExtract %float %40 0
%42 = OpFOrdEqual %bool %41 %float_0
OpSelectionMerge %44 None
OpBranchConditional %42 %43 %44
%43 = OpLabel
OpBranch %29
%44 = OpLabel
OpBranch %28
%28 = OpLabel
%45 = OpLoad %float %r
%46 = OpFAdd %float %45 %float_1
OpStore %r %46
OpBranch %25
%29 = OpLabel
OpStore %b %float_5
OpBranch %48
%48 = OpLabel
OpLoopMerge %52 %51 None
OpBranch %49
%49 = OpLabel
%53 = OpLoad %float %b
%54 = OpFOrdGreaterThanEqual %bool %53 %float_0
OpBranchConditional %54 %50 %52
%50 = OpLabel
%55 = OpLoad %float %b
%56 = OpAccessChain %_ptr_Function_float %x %int_2
OpStore %56 %55
%58 = OpLoad %v4float %x
%59 = OpCompositeExtract %float %58 3
%60 = OpFOrdEqual %bool %59 %float_1
OpSelectionMerge %62 None
OpBranchConditional %60 %61 %62
%61 = OpLabel
OpBranch %51
%62 = OpLabel
%63 = OpAccessChain %_ptr_Function_float %x %int_1
OpStore %63 %float_0
OpBranch %51
%51 = OpLabel
OpLoopMerge %55 %54 None
OpBranch %52
%65 = OpLoad %float %b
%66 = OpFSub %float %65 %float_1
OpStore %b %66
OpBranch %48
%52 = OpLabel
%56 = OpLoad %float %b
%57 = OpFOrdGreaterThanEqual %bool %56 %float_0
OpBranchConditional %57 %53 %55
%53 = OpLabel
%58 = OpLoad %float %b
%59 = OpAccessChain %_ptr_Function_float %x %int_2
OpStore %59 %58
%61 = OpLoad %v4float %x
%62 = OpCompositeExtract %float %61 3
%63 = OpFOrdEqual %bool %62 %float_1
OpSelectionMerge %65 None
OpBranchConditional %63 %64 %65
%64 = OpLabel
OpBranch %54
%65 = OpLabel
%66 = OpAccessChain %_ptr_Function_float %x %int_1
OpStore %66 %float_0
OpBranch %54
%54 = OpLabel
%68 = OpLoad %float %b
%69 = OpFSub %float %68 %float_1
OpStore %b %69
OpBranch %51
%55 = OpLabel
%70 = OpLoad %v4float %x
OpReturnValue %70
%67 = OpLoad %v4float %x
OpReturnValue %67
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '8[%sk_RTAdjust]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%sk_RTAdjust = OpVariable %_ptr_Uniform_v4float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,63 +12,56 @@ OpEntryPoint Vertex %main "main" %3 %pos
OpName %sk_PerVertex "sk_PerVertex"
OpMemberName %sk_PerVertex 0 "sk_Position"
OpMemberName %sk_PerVertex 1 "sk_PointSize"
OpName %sk_RTAdjust "sk_RTAdjust"
OpName %pos "pos"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "sk_RTAdjust"
OpName %main "main"
OpMemberDecorate %sk_PerVertex 0 BuiltIn Position
OpMemberDecorate %sk_PerVertex 1 BuiltIn PointSize
OpDecorate %sk_PerVertex Block
OpMemberDecorate %_UniformBuffer 0 DescriptorSet 0
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpDecorate %_UniformBuffer Block
OpDecorate %10 Binding 0
OpDecorate %10 DescriptorSet 0
OpDecorate %sk_RTAdjust DescriptorSet 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%sk_PerVertex = OpTypeStruct %v4float %float
%_ptr_Output_sk_PerVertex = OpTypePointer Output %sk_PerVertex
%3 = OpVariable %_ptr_Output_sk_PerVertex Output
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%sk_RTAdjust = OpVariable %_ptr_Uniform_v4float Uniform
%_ptr_Input_v4float = OpTypePointer Input %v4float
%pos = OpVariable %_ptr_Input_v4float Input
%_UniformBuffer = OpTypeStruct %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%10 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid
%14 = OpTypeFunction %void
%13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Output_v4float = OpTypePointer Output %v4float
%v2float = OpTypeVector %float 2
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_0 = OpConstant %float 0
%main = OpFunction %void None %14
%15 = OpLabel
%16 = OpLoad %v4float %pos
%19 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %19 %16
%21 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%22 = OpLoad %v4float %21
%23 = OpVectorShuffle %v2float %22 %22 0 1
%25 = OpAccessChain %_ptr_Uniform_v4float %10 %int_0
%27 = OpLoad %v4float %25
%28 = OpVectorShuffle %v2float %27 %27 0 2
%29 = OpFMul %v2float %23 %28
%30 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%31 = OpLoad %v4float %30
%32 = OpVectorShuffle %v2float %31 %31 3 3
%33 = OpAccessChain %_ptr_Uniform_v4float %10 %int_0
%34 = OpLoad %v4float %33
%35 = OpVectorShuffle %v2float %34 %34 1 3
%36 = OpFMul %v2float %32 %35
%37 = OpFAdd %v2float %29 %36
%38 = OpCompositeExtract %float %37 0
%39 = OpCompositeExtract %float %37 1
%main = OpFunction %void None %13
%14 = OpLabel
%15 = OpLoad %v4float %pos
%18 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %18 %15
%20 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%21 = OpLoad %v4float %20
%22 = OpVectorShuffle %v2float %21 %21 0 1
%24 = OpLoad %v4float %sk_RTAdjust
%25 = OpVectorShuffle %v2float %24 %24 0 2
%26 = OpFMul %v2float %22 %25
%27 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%28 = OpLoad %v4float %27
%29 = OpVectorShuffle %v2float %28 %28 3 3
%30 = OpLoad %v4float %sk_RTAdjust
%31 = OpVectorShuffle %v2float %30 %30 1 3
%32 = OpFMul %v2float %29 %31
%33 = OpFAdd %v2float %26 %32
%34 = OpCompositeExtract %float %33 0
%35 = OpCompositeExtract %float %33 1
%37 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%38 = OpLoad %v4float %37
%39 = OpCompositeExtract %float %38 3
%40 = OpCompositeConstruct %v4float %34 %35 %float_0 %39
%41 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%42 = OpLoad %v4float %41
%43 = OpCompositeExtract %float %42 3
%44 = OpCompositeConstruct %v4float %38 %39 %float_0 %43
%45 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %45 %44
OpStore %41 %40
OpReturn
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '15[%sk_RTAdjust]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%sk_RTAdjust = OpVariable %_ptr_Uniform_v4float Uniform
OpCapability Geometry
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -10,17 +17,13 @@ OpName %sk_PerVertex "sk_PerVertex"
OpMemberName %sk_PerVertex 0 "sk_Position"
OpMemberName %sk_PerVertex 1 "sk_PointSize"
OpName %sk_InvocationID "sk_InvocationID"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "sk_RTAdjust"
OpName %sk_RTAdjust "sk_RTAdjust"
OpName %main "main"
OpMemberDecorate %sk_PerVertex 0 BuiltIn Position
OpMemberDecorate %sk_PerVertex 1 BuiltIn PointSize
OpDecorate %_arr_sk_PerVertex_int_1 ArrayStride 32
OpDecorate %sk_InvocationID BuiltIn InvocationId
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpDecorate %_UniformBuffer Block
OpDecorate %15 Binding 0
OpDecorate %15 DescriptorSet 0
OpDecorate %sk_RTAdjust DescriptorSet 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%sk_PerVertex = OpTypeStruct %v4float %float
@ -33,85 +36,81 @@ OpDecorate %15 DescriptorSet 0
%8 = OpVariable %_ptr_Input__arr_sk_PerVertex_int_1 Input
%_ptr_Input_int = OpTypePointer Input %int
%sk_InvocationID = OpVariable %_ptr_Input_int Input
%_UniformBuffer = OpTypeStruct %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%15 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%sk_RTAdjust = OpVariable %_ptr_Uniform_v4float Uniform
%void = OpTypeVoid
%19 = OpTypeFunction %void
%18 = OpTypeFunction %void
%int_0 = OpConstant %int 0
%_ptr_Input_v4float = OpTypePointer Input %v4float
%float_n0_5 = OpConstant %float -0.5
%float_0 = OpConstant %float 0
%_ptr_Output_v4float = OpTypePointer Output %v4float
%v2float = OpTypeVector %float 2
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_0_5 = OpConstant %float 0.5
%main = OpFunction %void None %19
%20 = OpLabel
%22 = OpAccessChain %_ptr_Input_v4float %8 %int_0 %int_0
%24 = OpLoad %v4float %22
%27 = OpLoad %int %sk_InvocationID
%28 = OpConvertSToF %float %27
%29 = OpCompositeConstruct %v4float %float_n0_5 %float_0 %float_0 %28
%30 = OpFAdd %v4float %24 %29
%31 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %31 %30
%33 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%34 = OpLoad %v4float %33
%35 = OpVectorShuffle %v2float %34 %34 0 1
%37 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
%39 = OpLoad %v4float %37
%40 = OpVectorShuffle %v2float %39 %39 0 2
%41 = OpFMul %v2float %35 %40
%42 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%43 = OpLoad %v4float %42
%44 = OpVectorShuffle %v2float %43 %43 3 3
%45 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
%46 = OpLoad %v4float %45
%47 = OpVectorShuffle %v2float %46 %46 1 3
%48 = OpFMul %v2float %44 %47
%49 = OpFAdd %v2float %41 %48
%50 = OpCompositeExtract %float %49 0
%51 = OpCompositeExtract %float %49 1
%main = OpFunction %void None %18
%19 = OpLabel
%21 = OpAccessChain %_ptr_Input_v4float %8 %int_0 %int_0
%23 = OpLoad %v4float %21
%26 = OpLoad %int %sk_InvocationID
%27 = OpConvertSToF %float %26
%28 = OpCompositeConstruct %v4float %float_n0_5 %float_0 %float_0 %27
%29 = OpFAdd %v4float %23 %28
%30 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %30 %29
%32 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%33 = OpLoad %v4float %32
%34 = OpVectorShuffle %v2float %33 %33 0 1
%36 = OpLoad %v4float %sk_RTAdjust
%37 = OpVectorShuffle %v2float %36 %36 0 2
%38 = OpFMul %v2float %34 %37
%39 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%40 = OpLoad %v4float %39
%41 = OpVectorShuffle %v2float %40 %40 3 3
%42 = OpLoad %v4float %sk_RTAdjust
%43 = OpVectorShuffle %v2float %42 %42 1 3
%44 = OpFMul %v2float %41 %43
%45 = OpFAdd %v2float %38 %44
%46 = OpCompositeExtract %float %45 0
%47 = OpCompositeExtract %float %45 1
%48 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%49 = OpLoad %v4float %48
%50 = OpCompositeExtract %float %49 3
%51 = OpCompositeConstruct %v4float %46 %47 %float_0 %50
%52 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%53 = OpLoad %v4float %52
%54 = OpCompositeExtract %float %53 3
%55 = OpCompositeConstruct %v4float %50 %51 %float_0 %54
%56 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %56 %55
OpStore %52 %51
OpEmitVertex
%58 = OpAccessChain %_ptr_Input_v4float %8 %int_0 %int_0
%59 = OpLoad %v4float %58
%61 = OpLoad %int %sk_InvocationID
%62 = OpConvertSToF %float %61
%63 = OpCompositeConstruct %v4float %float_0_5 %float_0 %float_0 %62
%64 = OpFAdd %v4float %59 %63
%65 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %65 %64
%66 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%67 = OpLoad %v4float %66
%68 = OpVectorShuffle %v2float %67 %67 0 1
%69 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
%70 = OpLoad %v4float %69
%71 = OpVectorShuffle %v2float %70 %70 0 2
%72 = OpFMul %v2float %68 %71
%73 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%74 = OpLoad %v4float %73
%75 = OpVectorShuffle %v2float %74 %74 3 3
%76 = OpAccessChain %_ptr_Uniform_v4float %15 %int_0
%77 = OpLoad %v4float %76
%78 = OpVectorShuffle %v2float %77 %77 1 3
%79 = OpFMul %v2float %75 %78
%80 = OpFAdd %v2float %72 %79
%81 = OpCompositeExtract %float %80 0
%82 = OpCompositeExtract %float %80 1
%83 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%84 = OpLoad %v4float %83
%85 = OpCompositeExtract %float %84 3
%86 = OpCompositeConstruct %v4float %81 %82 %float_0 %85
%87 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %87 %86
%54 = OpAccessChain %_ptr_Input_v4float %8 %int_0 %int_0
%55 = OpLoad %v4float %54
%57 = OpLoad %int %sk_InvocationID
%58 = OpConvertSToF %float %57
%59 = OpCompositeConstruct %v4float %float_0_5 %float_0 %float_0 %58
%60 = OpFAdd %v4float %55 %59
%61 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %61 %60
%62 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%63 = OpLoad %v4float %62
%64 = OpVectorShuffle %v2float %63 %63 0 1
%65 = OpLoad %v4float %sk_RTAdjust
%66 = OpVectorShuffle %v2float %65 %65 0 2
%67 = OpFMul %v2float %64 %66
%68 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%69 = OpLoad %v4float %68
%70 = OpVectorShuffle %v2float %69 %69 3 3
%71 = OpLoad %v4float %sk_RTAdjust
%72 = OpVectorShuffle %v2float %71 %71 1 3
%73 = OpFMul %v2float %70 %72
%74 = OpFAdd %v2float %67 %73
%75 = OpCompositeExtract %float %74 0
%76 = OpCompositeExtract %float %74 1
%77 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%78 = OpLoad %v4float %77
%79 = OpCompositeExtract %float %78 3
%80 = OpCompositeConstruct %v4float %75 %76 %float_0 %79
%81 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %81 %80
OpEmitVertex
OpEndPrimitive
OpReturn
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '8[%sk_RTAdjust]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%sk_RTAdjust = OpVariable %_ptr_Uniform_v4float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,61 +12,54 @@ OpEntryPoint Vertex %main "main" %3
OpName %sk_PerVertex "sk_PerVertex"
OpMemberName %sk_PerVertex 0 "sk_Position"
OpMemberName %sk_PerVertex 1 "sk_PointSize"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "sk_RTAdjust"
OpName %sk_RTAdjust "sk_RTAdjust"
OpName %main "main"
OpMemberDecorate %sk_PerVertex 0 BuiltIn Position
OpMemberDecorate %sk_PerVertex 1 BuiltIn PointSize
OpDecorate %sk_PerVertex Block
OpMemberDecorate %_UniformBuffer 0 DescriptorSet 0
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpDecorate %_UniformBuffer Block
OpDecorate %8 Binding 0
OpDecorate %8 DescriptorSet 0
OpDecorate %sk_RTAdjust DescriptorSet 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%sk_PerVertex = OpTypeStruct %v4float %float
%_ptr_Output_sk_PerVertex = OpTypePointer Output %sk_PerVertex
%3 = OpVariable %_ptr_Output_sk_PerVertex Output
%_UniformBuffer = OpTypeStruct %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%8 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%sk_RTAdjust = OpVariable %_ptr_Uniform_v4float Uniform
%void = OpTypeVoid
%12 = OpTypeFunction %void
%11 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Output_v4float = OpTypePointer Output %v4float
%v2float = OpTypeVector %float 2
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_0 = OpConstant %float 0
%main = OpFunction %void None %12
%13 = OpLabel
%18 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %18 %15
%20 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%21 = OpLoad %v4float %20
%22 = OpVectorShuffle %v2float %21 %21 0 1
%24 = OpAccessChain %_ptr_Uniform_v4float %8 %int_0
%26 = OpLoad %v4float %24
%27 = OpVectorShuffle %v2float %26 %26 0 2
%28 = OpFMul %v2float %22 %27
%29 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%30 = OpLoad %v4float %29
%31 = OpVectorShuffle %v2float %30 %30 3 3
%32 = OpAccessChain %_ptr_Uniform_v4float %8 %int_0
%33 = OpLoad %v4float %32
%34 = OpVectorShuffle %v2float %33 %33 1 3
%35 = OpFMul %v2float %31 %34
%36 = OpFAdd %v2float %28 %35
%37 = OpCompositeExtract %float %36 0
%38 = OpCompositeExtract %float %36 1
%main = OpFunction %void None %11
%12 = OpLabel
%17 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %17 %14
%19 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%20 = OpLoad %v4float %19
%21 = OpVectorShuffle %v2float %20 %20 0 1
%23 = OpLoad %v4float %sk_RTAdjust
%24 = OpVectorShuffle %v2float %23 %23 0 2
%25 = OpFMul %v2float %21 %24
%26 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%27 = OpLoad %v4float %26
%28 = OpVectorShuffle %v2float %27 %27 3 3
%29 = OpLoad %v4float %sk_RTAdjust
%30 = OpVectorShuffle %v2float %29 %29 1 3
%31 = OpFMul %v2float %28 %30
%32 = OpFAdd %v2float %25 %31
%33 = OpCompositeExtract %float %32 0
%34 = OpCompositeExtract %float %32 1
%36 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%37 = OpLoad %v4float %36
%38 = OpCompositeExtract %float %37 3
%39 = OpCompositeConstruct %v4float %33 %34 %float_0 %38
%40 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%41 = OpLoad %v4float %40
%42 = OpCompositeExtract %float %41 3
%43 = OpCompositeConstruct %v4float %37 %38 %float_0 %42
%44 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %44 %43
OpStore %40 %39
OpReturn
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '13[%colorRed]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%colorRed = OpVariable %_ptr_Uniform_v4float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,9 +12,8 @@ OpEntryPoint Fragment %_entrypoint "_entrypoint" %sk_FragColor %sk_Clockwise
OpExecutionMode %_entrypoint OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "colorRed"
OpMemberName %_UniformBuffer 1 "colorGreen"
OpName %colorRed "colorRed"
OpName %colorGreen "colorGreen"
OpName %_entrypoint "_entrypoint"
OpName %S "S"
OpMemberName %S 0 "x"
@ -25,21 +31,18 @@ OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
OpDecorate %sk_Clockwise RelaxedPrecision
OpDecorate %sk_Clockwise BuiltIn FrontFacing
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 1 Offset 16
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpDecorate %_UniformBuffer Block
OpDecorate %13 Binding 0
OpDecorate %13 DescriptorSet 0
OpDecorate %colorRed RelaxedPrecision
OpDecorate %colorRed DescriptorSet 0
OpDecorate %colorGreen RelaxedPrecision
OpDecorate %colorGreen DescriptorSet 0
OpMemberDecorate %S 0 Offset 0
OpMemberDecorate %S 1 Offset 4
OpDecorate %35 RelaxedPrecision
OpDecorate %59 RelaxedPrecision
OpDecorate %83 RelaxedPrecision
OpDecorate %89 RelaxedPrecision
OpDecorate %90 RelaxedPrecision
OpDecorate %91 RelaxedPrecision
OpDecorate %93 RelaxedPrecision
OpDecorate %94 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@ -47,9 +50,9 @@ OpDecorate %94 RelaxedPrecision
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
%_UniformBuffer = OpTypeStruct %v4float %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%13 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%colorRed = OpVariable %_ptr_Uniform_v4float Uniform
%colorGreen = OpVariable %_ptr_Uniform_v4float Uniform
%void = OpTypeVoid
%18 = OpTypeFunction %void
%int = OpTypeInt 32 1
@ -71,7 +74,6 @@ OpDecorate %94 RelaxedPrecision
%float_2 = OpConstant %float 2
%int_3 = OpConstant %int 3
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%_entrypoint = OpFunction %void None %18
%19 = OpLabel
%20 = OpFunctionCall %v4float %main
@ -151,16 +153,16 @@ OpStore %valid %82
OpSelectionMerge %88 None
OpBranchConditional %83 %86 %87
%86 = OpLabel
%89 = OpAccessChain %_ptr_Uniform_v4float %13 %int_1
%91 = OpLoad %v4float %89
OpStore %84 %91
%89 = OpLoad %v4float %colorGreen
OpStore %84 %89
OpBranch %88
%87 = OpLabel
%92 = OpAccessChain %_ptr_Uniform_v4float %13 %int_0
%93 = OpLoad %v4float %92
OpStore %84 %93
%90 = OpLoad %v4float %colorRed
OpStore %84 %90
OpBranch %88
%88 = OpLabel
%94 = OpLoad %v4float %84
OpReturnValue %94
%91 = OpLoad %v4float %84
OpReturnValue %91
OpFunctionEnd
1 error

View File

@ -1,19 +1,22 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '6[%arr]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%arr = OpVariable %_ptr_Uniform__arr_float_int_3 Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %sk_Clockwise
OpExecutionMode %main OriginUpperLeft
OpName %sk_Clockwise "sk_Clockwise"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "arr"
OpName %arr "arr"
OpName %main "main"
OpDecorate %sk_Clockwise RelaxedPrecision
OpDecorate %sk_Clockwise BuiltIn FrontFacing
OpDecorate %_arr_float_int_3 ArrayStride 16
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpDecorate %_UniformBuffer Block
OpDecorate %6 Binding 0
OpDecorate %6 DescriptorSet 0
OpDecorate %arr DescriptorSet 0
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
@ -21,12 +24,13 @@ OpDecorate %6 DescriptorSet 0
%int = OpTypeInt 32 1
%int_3 = OpConstant %int 3
%_arr_float_int_3 = OpTypeArray %float %int_3
%_UniformBuffer = OpTypeStruct %_arr_float_int_3
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%6 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Uniform__arr_float_int_3 = OpTypePointer Uniform %_arr_float_int_3
%arr = OpVariable %_ptr_Uniform__arr_float_int_3 Uniform
%void = OpTypeVoid
%14 = OpTypeFunction %void
%main = OpFunction %void None %14
%15 = OpLabel
%13 = OpTypeFunction %void
%main = OpFunction %void None %13
%14 = OpLabel
OpReturn
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '10[%myHalf]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%myHalf = OpVariable %_ptr_Uniform_float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,9 +12,8 @@ OpEntryPoint Fragment %_entrypoint "_entrypoint" %sk_FragColor %sk_Clockwise
OpExecutionMode %_entrypoint OriginUpperLeft
OpName %sk_FragColor "sk_FragColor"
OpName %sk_Clockwise "sk_Clockwise"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "myHalf"
OpMemberName %_UniformBuffer 1 "myHalf4"
OpName %myHalf "myHalf"
OpName %myHalf4 "myHalf4"
OpName %_entrypoint "_entrypoint"
OpName %main "main"
OpDecorate %sk_FragColor RelaxedPrecision
@ -15,15 +21,12 @@ OpDecorate %sk_FragColor Location 0
OpDecorate %sk_FragColor Index 0
OpDecorate %sk_Clockwise RelaxedPrecision
OpDecorate %sk_Clockwise BuiltIn FrontFacing
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpMemberDecorate %_UniformBuffer 1 Offset 16
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
OpDecorate %_UniformBuffer Block
OpDecorate %10 Binding 0
OpDecorate %10 DescriptorSet 0
OpDecorate %24 RelaxedPrecision
OpDecorate %28 RelaxedPrecision
OpDecorate %myHalf RelaxedPrecision
OpDecorate %myHalf DescriptorSet 0
OpDecorate %myHalf4 RelaxedPrecision
OpDecorate %myHalf4 DescriptorSet 0
OpDecorate %21 RelaxedPrecision
OpDecorate %22 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@ -31,29 +34,25 @@ OpDecorate %28 RelaxedPrecision
%bool = OpTypeBool
%_ptr_Input_bool = OpTypePointer Input %bool
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
%_UniformBuffer = OpTypeStruct %float %v4float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%10 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%void = OpTypeVoid
%15 = OpTypeFunction %void
%18 = OpTypeFunction %v4float
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Uniform_float = OpTypePointer Uniform %float
%int_0 = OpConstant %int 0
%_entrypoint = OpFunction %void None %15
%16 = OpLabel
%17 = OpFunctionCall %v4float %main
OpStore %sk_FragColor %17
%myHalf = OpVariable %_ptr_Uniform_float Uniform
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%myHalf4 = OpVariable %_ptr_Uniform_v4float Uniform
%void = OpTypeVoid
%16 = OpTypeFunction %void
%19 = OpTypeFunction %v4float
%_entrypoint = OpFunction %void None %16
%17 = OpLabel
%18 = OpFunctionCall %v4float %main
OpStore %sk_FragColor %18
OpReturn
OpFunctionEnd
%main = OpFunction %v4float None %18
%19 = OpLabel
%20 = OpAccessChain %_ptr_Uniform_v4float %10 %int_1
%24 = OpLoad %v4float %20
%25 = OpAccessChain %_ptr_Uniform_float %10 %int_0
%28 = OpLoad %float %25
%29 = OpVectorTimesScalar %v4float %24 %28
OpReturnValue %29
%main = OpFunction %v4float None %19
%20 = OpLabel
%21 = OpLoad %v4float %myHalf4
%22 = OpLoad %float %myHalf
%23 = OpVectorTimesScalar %v4float %21 %22
OpReturnValue %23
OpFunctionEnd
1 error

View File

@ -1,3 +1,10 @@
### Compilation failed:
error: SPIR-V validation error: Uniform OpVariable <id> '8[%zoom]' has illegal type.
From Vulkan spec, section 14.5.2:
Variables identified with the Uniform storage class are used to access transparent buffer backed resources. Such variables must be typed as OpTypeStruct, or an array of this type
%zoom = OpVariable %_ptr_Uniform_float Uniform
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
@ -5,54 +12,47 @@ OpEntryPoint Vertex %main "main" %3
OpName %sk_PerVertex "sk_PerVertex"
OpMemberName %sk_PerVertex 0 "sk_Position"
OpMemberName %sk_PerVertex 1 "sk_PointSize"
OpName %_UniformBuffer "_UniformBuffer"
OpMemberName %_UniformBuffer 0 "zoom"
OpName %zoom "zoom"
OpName %main "main"
OpMemberDecorate %sk_PerVertex 0 BuiltIn Position
OpMemberDecorate %sk_PerVertex 1 BuiltIn PointSize
OpDecorate %sk_PerVertex Block
OpMemberDecorate %_UniformBuffer 0 DescriptorSet 0
OpMemberDecorate %_UniformBuffer 0 Offset 0
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
OpDecorate %_UniformBuffer Block
OpDecorate %8 Binding 0
OpDecorate %8 DescriptorSet 0
OpDecorate %22 RelaxedPrecision
OpDecorate %30 RelaxedPrecision
OpDecorate %zoom RelaxedPrecision
OpDecorate %zoom DescriptorSet 0
OpDecorate %19 RelaxedPrecision
OpDecorate %26 RelaxedPrecision
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%sk_PerVertex = OpTypeStruct %v4float %float
%_ptr_Output_sk_PerVertex = OpTypePointer Output %sk_PerVertex
%3 = OpVariable %_ptr_Output_sk_PerVertex Output
%_UniformBuffer = OpTypeStruct %float
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
%8 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
%_ptr_Uniform_float = OpTypePointer Uniform %float
%zoom = OpVariable %_ptr_Uniform_float Uniform
%void = OpTypeVoid
%12 = OpTypeFunction %void
%11 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%15 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Output_v4float = OpTypePointer Output %v4float
%_ptr_Uniform_float = OpTypePointer Uniform %float
%bool = OpTypeBool
%main = OpFunction %void None %12
%13 = OpLabel
%18 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %18 %15
%20 = OpAccessChain %_ptr_Uniform_float %8 %int_0
%22 = OpLoad %float %20
%23 = OpFOrdEqual %bool %22 %float_1
OpSelectionMerge %26 None
OpBranchConditional %23 %25 %26
%25 = OpLabel
%main = OpFunction %void None %11
%12 = OpLabel
%17 = OpAccessChain %_ptr_Output_v4float %3 %int_0
OpStore %17 %14
%19 = OpLoad %float %zoom
%20 = OpFOrdEqual %bool %19 %float_1
OpSelectionMerge %23 None
OpBranchConditional %20 %22 %23
%22 = OpLabel
OpReturn
%26 = OpLabel
%27 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%28 = OpLoad %v4float %27
%29 = OpAccessChain %_ptr_Uniform_float %8 %int_0
%30 = OpLoad %float %29
%31 = OpVectorTimesScalar %v4float %28 %30
OpStore %27 %31
%23 = OpLabel
%24 = OpAccessChain %_ptr_Output_v4float %3 %int_0
%25 = OpLoad %v4float %24
%26 = OpLoad %float %zoom
%27 = OpVectorTimesScalar %v4float %25 %26
OpStore %24 %27
OpReturn
OpFunctionEnd
1 error