mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-15 08:53:51 +00:00
refactor: add [[nodiscard]] to shader/asset load functions, suppress warnings
Add [[nodiscard]] to VkShaderModule::loadFromFile, Shader::loadFromFile/ loadFromSource, AssetManifest::load, DbcLoader::load — all return bool indicating success/failure that callers should check. Suppress with (void) at 17 call sites where validity is checked via isValid() after loading rather than the return value (m2_renderer recreatePipelines, swim_effects recreatePipelines).
This commit is contained in:
parent
b5b84fbc19
commit
e805eae33c
6 changed files with 27 additions and 27 deletions
|
|
@ -13,8 +13,8 @@ public:
|
|||
Shader() = default;
|
||||
~Shader();
|
||||
|
||||
bool loadFromFile(const std::string& vertexPath, const std::string& fragmentPath);
|
||||
bool loadFromSource(const std::string& vertexSource, const std::string& fragmentSource);
|
||||
[[nodiscard]] bool loadFromFile(const std::string& vertexPath, const std::string& fragmentPath);
|
||||
[[nodiscard]] bool loadFromSource(const std::string& vertexSource, const std::string& fragmentSource);
|
||||
|
||||
void use() const;
|
||||
void unuse() const;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public:
|
|||
VkShaderModule& operator=(VkShaderModule&& other) noexcept;
|
||||
|
||||
// Load a SPIR-V file from disk
|
||||
bool loadFromFile(VkDevice device, const std::string& path);
|
||||
[[nodiscard]] bool loadFromFile(VkDevice device, const std::string& path);
|
||||
|
||||
// Load from raw SPIR-V bytes
|
||||
bool loadFromMemory(VkDevice device, const uint32_t* code, size_t sizeBytes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue