46 inline static std::array<float, 4> sDrawPack = {0.0, 0.0, 0.0, 0.0};
52 inline static std::array<float, 4> sWidthPack = {0.0, 0.0, 0.0, 0.0};
58 inline static std::array<float, 4> sColorPack = {0.0, 0.0, 0.0, 0.0};
60 inline static Uniform sDrawModeUniform;
61 inline static Uniform sWidthUniform;
62 inline static Uniform sColorUniform;
71 d0 |=
mri.surface().underlying() << 16;
73 d1 |=
mri.edges().underlying() << 16;
75 sDrawPack[0] = std::bit_cast<float>(
d0);
76 sDrawPack[1] = std::bit_cast<float>(
d1);
78 sWidthPack[0] = settings.pointWidth();
79 sWidthPack[1] = settings.wireframeWidth();
80 sWidthPack[2] = settings.edgesWidth();
82 sColorPack[0] = std::bit_cast<float>(settings.pointUserColor().abgr());
84 std::bit_cast<float>(settings.surfaceUserColor().abgr());
86 std::bit_cast<float>(settings.wireframeUserColor().abgr());
87 sColorPack[3] = std::bit_cast<float>(settings.edgesUserColor().abgr());
94 if (!sDrawModeUniform.
isValid())
96 Uniform(
"u_mrsDrawPack", bgfx::UniformType::Vec4);
98 sWidthUniform =
Uniform(
"u_mrsWidthPack", bgfx::UniformType::Vec4);
100 sColorUniform =
Uniform(
"u_mrsColorPack", bgfx::UniformType::Vec4);
101 sDrawModeUniform.
bind(sDrawPack.data());
102 sWidthUniform.
bind(sWidthPack.data());
103 sColorUniform.
bind(sColorPack.data());