Commit bacd7e78 by Ben Clayton

SpirvShader: Make accessors private.

getType(), getObject() and getFunction() are only internally used, make them private. Minor refactoring related to spirv function inlining. Bug: b/133213304 Change-Id: I75f9f5488a8485161d534b56eb6530c2946bf49e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33353Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 1c8a9695
...@@ -841,27 +841,6 @@ namespace sw ...@@ -841,27 +841,6 @@ namespace sw
std::unordered_map<spv::BuiltIn, BuiltinMapping, BuiltInHash> outputBuiltins; std::unordered_map<spv::BuiltIn, BuiltinMapping, BuiltInHash> outputBuiltins;
WorkgroupMemory workgroupMemory; WorkgroupMemory workgroupMemory;
Type const &getType(Type::ID id) const
{
auto it = types.find(id);
ASSERT_MSG(it != types.end(), "Unknown type %d", id.value());
return it->second;
}
Object const &getObject(Object::ID id) const
{
auto it = defs.find(id);
ASSERT_MSG(it != defs.end(), "Unknown object %d", id.value());
return it->second;
}
Function const &getFunction(Function::ID id) const
{
auto it = functions.find(id);
ASSERT_MSG(it != functions.end(), "Unknown function %d", id.value());
return it->second;
}
private: private:
const uint32_t codeSerialID; const uint32_t codeSerialID;
Modes modes; Modes modes;
...@@ -1073,6 +1052,27 @@ namespace sw ...@@ -1073,6 +1052,27 @@ namespace sw
SpirvShader::Type::ID const type; SpirvShader::Type::ID const type;
}; };
Type const &getType(Type::ID id) const
{
auto it = types.find(id);
ASSERT_MSG(it != types.end(), "Unknown type %d", id.value());
return it->second;
}
Object const &getObject(Object::ID id) const
{
auto it = defs.find(id);
ASSERT_MSG(it != defs.end(), "Unknown object %d", id.value());
return it->second;
}
Function const &getFunction(Function::ID id) const
{
auto it = functions.find(id);
ASSERT_MSG(it != functions.end(), "Unknown function %d", id.value());
return it->second;
}
// Returns a SIMD::Pointer to the underlying data for the given pointer // Returns a SIMD::Pointer to the underlying data for the given pointer
// object. // object.
// Handles objects of the following kinds: // Handles objects of the following kinds:
......
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