summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderVertex.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2019-05-30 14:15:02 +0200
committerGitHub <noreply@github.com>2019-05-30 14:15:02 +0200
commit90c9991086e2c062f7b1ffd1bf2693f250e39e6d (patch)
tree12a85a742159e30c824393255dd3bb1402fc6067 /Source/Core/VideoCommon/UberShaderVertex.cpp
parent2ce587f781aa4257a17ea68938f9a6ce18c0bc38 (diff)
parentf7eff6dab8a7103a19d6fa57772aab4f448a472d (diff)
Merge pull request #8141 from lioncash/init
VideoCommon/ShaderGenCommon: Simplify initialization of ShaderUid class
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderVertex.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderVertex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/UberShaderVertex.cpp b/Source/Core/VideoCommon/UberShaderVertex.cpp
index 4032e0df40..5fb30aaf03 100644
--- a/Source/Core/VideoCommon/UberShaderVertex.cpp
+++ b/Source/Core/VideoCommon/UberShaderVertex.cpp
@@ -15,9 +15,10 @@ namespace UberShader
VertexShaderUid GetVertexShaderUid()
{
VertexShaderUid out;
- vertex_ubershader_uid_data* uid_data = out.GetUidData<vertex_ubershader_uid_data>();
- memset(uid_data, 0, sizeof(*uid_data));
+
+ vertex_ubershader_uid_data* const uid_data = out.GetUidData();
uid_data->num_texgens = xfmem.numTexGen.numTexGens;
+
return out;
}
@@ -487,11 +488,10 @@ void GenVertexShaderTexGens(APIType ApiType, u32 numTexgen, ShaderCode& out)
void EnumerateVertexShaderUids(const std::function<void(const VertexShaderUid&)>& callback)
{
VertexShaderUid uid;
- std::memset(&uid, 0, sizeof(uid));
for (u32 texgens = 0; texgens <= 8; texgens++)
{
- auto* vuid = uid.GetUidData<UberShader::vertex_ubershader_uid_data>();
+ vertex_ubershader_uid_data* const vuid = uid.GetUidData();
vuid->num_texgens = texgens;
callback(uid);
}