Commit 4a979dc3 by Chris Forbes

Formatting-only change: conform better with swiftshader style

Change-Id: I5241cb398aa294a702c0f70980b80d399dfbc5b0 Reviewed-on: https://swiftshader-review.googlesource.com/c/23689Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent a1cd1190
......@@ -29,8 +29,10 @@ namespace sw
// - Input / Output interface blocks, builtin or otherwise, have been split.
// - The only input/output OpVariables present are those used by the entrypoint
for (auto insn : *this) {
switch (insn.opcode()) {
for (auto insn : *this)
{
switch (insn.opcode())
{
case spv::OpExecutionMode:
ProcessExecutionMode(insn);
break;
......@@ -48,7 +50,8 @@ namespace sw
case spv::OpTypeRuntimeArray:
case spv::OpTypeStruct:
case spv::OpTypePointer:
case spv::OpTypeFunction: {
case spv::OpTypeFunction:
{
auto resultId = insn.word(1);
auto &object = defs[resultId];
object.kind = Object::Kind::Type;
......@@ -56,7 +59,8 @@ namespace sw
break;
}
case spv::OpVariable: {
case spv::OpVariable:
{
auto typeId = insn.word(1);
auto resultId = insn.word(2);
auto storageClass = static_cast<spv::StorageClass>(insn.word(3));
......@@ -79,7 +83,8 @@ namespace sw
void SpirvShader::ProcessExecutionMode(InsnIterator insn)
{
auto mode = static_cast<spv::ExecutionMode>(insn.word(2));
switch (mode) {
switch (mode)
{
case spv::ExecutionModeEarlyFragmentTests:
modes.EarlyFragmentTests = true;
break;
......
......@@ -44,7 +44,9 @@ namespace sw
}
uint32_t wordCount() const
{ return *iter >> spv::WordCountShift; }
{
return *iter >> spv::WordCountShift;
}
uint32_t word(uint32_t n) const
{
......@@ -58,7 +60,9 @@ namespace sw
}
InsnIterator operator*() const
{ return *this; }
{
return *this;
}
InsnIterator &operator++()
{
......@@ -78,15 +82,20 @@ namespace sw
InsnIterator() = default;
explicit InsnIterator(InsnStore::const_iterator iter) : iter{iter}
{}
{
}
};
/* range-based-for interface */
InsnIterator begin() const
{ return InsnIterator{insns.cbegin() + 5}; }
{
return InsnIterator{insns.cbegin() + 5};
}
InsnIterator end() const
{ return InsnIterator{insns.cend()}; }
{
return InsnIterator{insns.cend()};
}
class Object
{
......@@ -104,7 +113,9 @@ namespace sw
};
int getSerialID() const
{ return serialID; }
{
return serialID;
}
explicit SpirvShader(InsnStore const &insns);
......@@ -121,7 +132,9 @@ namespace sw
};
Modes const &getModes() const
{ return modes; }
{
return modes;
}
private:
const int serialID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment