diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2019-05-30 14:15:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-30 14:15:02 +0200 |
| commit | 90c9991086e2c062f7b1ffd1bf2693f250e39e6d (patch) | |
| tree | 12a85a742159e30c824393255dd3bb1402fc6067 /Source/Core/VideoCommon/UberShaderPixel.cpp | |
| parent | 2ce587f781aa4257a17ea68938f9a6ce18c0bc38 (diff) | |
| parent | f7eff6dab8a7103a19d6fa57772aab4f448a472d (diff) | |
Merge pull request #8141 from lioncash/init
VideoCommon/ShaderGenCommon: Simplify initialization of ShaderUid class
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderPixel.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/UberShaderPixel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp index 097b6456bd..6d2886b256 100644 --- a/Source/Core/VideoCommon/UberShaderPixel.cpp +++ b/Source/Core/VideoCommon/UberShaderPixel.cpp @@ -14,8 +14,8 @@ namespace UberShader PixelShaderUid GetPixelShaderUid() { PixelShaderUid out; - pixel_ubershader_uid_data* uid_data = out.GetUidData<pixel_ubershader_uid_data>(); - memset(uid_data, 0, sizeof(*uid_data)); + + pixel_ubershader_uid_data* const uid_data = out.GetUidData(); uid_data->num_texgens = xfmem.numTexGen.numTexGens; uid_data->early_depth = bpmem.UseEarlyDepthTest() && @@ -26,13 +26,14 @@ PixelShaderUid GetPixelShaderUid() (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !uid_data->early_depth) || (bpmem.zmode.testenable && bpmem.genMode.zfreeze); uid_data->uint_output = bpmem.blendmode.UseLogicOp(); + return out; } void ClearUnusedPixelShaderUidBits(APIType ApiType, const ShaderHostConfig& host_config, PixelShaderUid* uid) { - pixel_ubershader_uid_data* uid_data = uid->GetUidData<pixel_ubershader_uid_data>(); + pixel_ubershader_uid_data* const uid_data = uid->GetUidData(); // OpenGL and Vulkan convert implicitly normalized color outputs to their uint representation. // Therefore, it is not necessary to use a uint output on these backends. We also disable the @@ -1390,11 +1391,10 @@ ShaderCode GenPixelShader(APIType ApiType, const ShaderHostConfig& host_config, void EnumeratePixelShaderUids(const std::function<void(const PixelShaderUid&)>& callback) { PixelShaderUid uid; - std::memset(&uid, 0, sizeof(uid)); for (u32 texgens = 0; texgens <= 8; texgens++) { - auto* puid = uid.GetUidData<UberShader::pixel_ubershader_uid_data>(); + pixel_ubershader_uid_data* const puid = uid.GetUidData(); puid->num_texgens = texgens; for (u32 early_depth = 0; early_depth < 2; early_depth++) |
