From 43091e81ccbe5fbe3f8b71d062caa8447a95331b Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Thu, 31 Aug 2023 22:43:21 -0800 Subject: [PATCH] std::array in GlobalShaderParamState::buf --- src/engine/render/shaderparam.cpp | 2 +- src/engine/render/shaderparam.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/render/shaderparam.cpp b/src/engine/render/shaderparam.cpp index b1f9be9a6..4678226bd 100644 --- a/src/engine/render/shaderparam.cpp +++ b/src/engine/render/shaderparam.cpp @@ -36,7 +36,7 @@ GlobalShaderParamState &GlobalShaderParam::getglobalparam(const std::string &nam else { GlobalShaderParamState ¶m = globalparams[name]; - std::memset(param.buf, -1, sizeof(param.buf)); + param.buf.fill(-1); param.version = -1; return param; } diff --git a/src/engine/render/shaderparam.h b/src/engine/render/shaderparam.h index 2ba68dbb0..70f319f8d 100644 --- a/src/engine/render/shaderparam.h +++ b/src/engine/render/shaderparam.h @@ -16,7 +16,7 @@ struct GlobalShaderParamState float fval[32]; int ival[32]; uint uval[32]; - uchar buf[32*sizeof(float)]; + std::array buf; }; int version;