On Thu, 18 Feb 2021 at 15:14, Rémi Bernon rbernon@codeweavers.com wrote:
On 2/18/21 3:06 PM, Henri Verbeet wrote:
On Thu, 18 Feb 2021 at 13:31, Rémi Bernon rbernon@codeweavers.com wrote:
+void state_reset(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, DWORD flags) +{
- memset(&state->flags, 0, sizeof(struct wined3d_state) - FIELD_OFFSET(struct wined3d_state, flags));
- state_init(state, d3d_info, flags);
+}
Do we expect to ever change the flags on state_reset()? The "flags" parameter seems redundant. The memset() effectively clears the entire structure, except if we were to ever move the "flags" field to a different place in the structure. Any reason to not simply use "memset(state, 0, sizeof(*state));"?
So I wanted to avoid adding a new helper, but would having both state_init and state_reset make more sense?
I think so, yes.