unsigned i, s;
DBG("apply:%d changed.group: %x\n", (int)apply, (int)mask->changed.group );
- if (apply)
- dst->changed.group |= mask->changed.group;
+
+ /* device changed.* are unused.
+ * Instead nine_context_apply_stateblock is used and will
+ * internally set the right context->changed fields.
+ * Uncomment these only if we want to apply a stateblock onto a stateblock.
+ *
+ * if (apply)
+ * dst->changed.group |= mask->changed.group;
+ */
if (mask->changed.group & NINE_STATE_VIEWPORT)
dst->viewport = src->viewport;
/* Render states.
* TODO: Maybe build a list ?
*/
- for (i = 0; i < ARRAY_SIZE(dst->changed.rs); ++i) {
+ for (i = 0; i < ARRAY_SIZE(mask->changed.rs); ++i) {
uint32_t m = mask->changed.rs[i];
- if (apply)
- dst->changed.rs[i] |= m;
+ /* if (apply)
+ * dst->changed.rs[i] |= m; */
while (m) {
const int r = ffs(m) - 1;
m &= ~(1 << r);
if (mask->changed.ucp & (1 << i))
memcpy(dst->clip.ucp[i],
src->clip.ucp[i], sizeof(src->clip.ucp[0]));
- if (apply)
- dst->changed.ucp |= mask->changed.ucp;
+ /* if (apply)
+ * dst->changed.ucp |= mask->changed.ucp;*/
}
/* Sampler state. */
dst->samp_advertised[s][i] = src->samp_advertised[s][i];
}
}
- if (apply)
- dst->changed.sampler[s] |= mask->changed.sampler[s];
+ /* if (apply)
+ * dst->changed.sampler[s] |= mask->changed.sampler[s];*/
}
}
if (mask->changed.stream_freq & (1 << i))
dst->stream_freq[i] = src->stream_freq[i];
}
- if (apply) {
- dst->changed.vtxbuf |= mask->changed.vtxbuf;
- dst->changed.stream_freq |= mask->changed.stream_freq;
- }
+ /*
+ * if (apply) {
+ * dst->changed.vtxbuf |= mask->changed.vtxbuf;
+ * dst->changed.stream_freq |= mask->changed.stream_freq;
+ * }*/
}
/* Textures */
for (i = 0; i < NINED3DTSS_COUNT; ++i)
if (mask->ff.changed.tex_stage[s][i / 32] & (1 << (i % 32)))
dst->ff.tex_stage[s][i] = src->ff.tex_stage[s][i];
- if (apply) {
- /* TODO: it's 32 exactly, just offset by 1 as 0 is unused */
- dst->ff.changed.tex_stage[s][0] |=
- mask->ff.changed.tex_stage[s][0];
- dst->ff.changed.tex_stage[s][1] |=
- mask->ff.changed.tex_stage[s][1];
- }
+ /*
+ * if (apply) {
+ * TODO: it's 32 exactly, just offset by 1 as 0 is unused
+ * dst->ff.changed.tex_stage[s][0] |=
+ * mask->ff.changed.tex_stage[s][0];
+ * dst->ff.changed.tex_stage[s][1] |=
+ * mask->ff.changed.tex_stage[s][1];
+ * }*/
}
}
if (mask->changed.group & NINE_STATE_FF_LIGHTING) {
*nine_state_access_transform(&dst->ff, s, TRUE) =
*nine_state_access_transform(&src->ff, s, FALSE);
}
- if (apply)
- dst->ff.changed.transform[i] |= mask->ff.changed.transform[i];
+ /* if (apply)
+ * dst->ff.changed.transform[i] |= mask->ff.changed.transform[i];*/
}
}
}
{
unsigned i;
- if (apply)
- dst->changed.group |= src->changed.group;
+ /* if (apply)
+ * dst->changed.group |= src->changed.group;
+ */
dst->viewport = src->viewport;
dst->scissor = src->scissor;
/* Render states. */
memcpy(dst->rs_advertised, src->rs_advertised, sizeof(dst->rs_advertised));
- if (apply)
- memcpy(dst->changed.rs, src->changed.rs, sizeof(dst->changed.rs));
+ /* if (apply)
+ * memcpy(dst->changed.rs, src->changed.rs, sizeof(dst->changed.rs));*/
/* Clip planes. */
memcpy(&dst->clip, &src->clip, sizeof(dst->clip));
- if (apply)
- dst->changed.ucp = src->changed.ucp;
+ /* if (apply)
+ * dst->changed.ucp = src->changed.ucp;*/
/* Sampler state. */
memcpy(dst->samp_advertised, src->samp_advertised, sizeof(dst->samp_advertised));
- if (apply)
- memcpy(dst->changed.sampler,
- src->changed.sampler, sizeof(dst->changed.sampler));
+ /* if (apply)
+ * memcpy(dst->changed.sampler,
+ * src->changed.sampler, sizeof(dst->changed.sampler));*/
/* Index buffer. */
NineStateBlock9_BindBuffer(device,
}
dst->stream_freq[i] = src->stream_freq[i];
}
- if (apply) {
- dst->changed.vtxbuf = (1ULL << MaxStreams) - 1;
- dst->changed.stream_freq = (1ULL << MaxStreams) - 1;
- }
+ /* if (apply) {
+ * dst->changed.vtxbuf = (1ULL << MaxStreams) - 1;
+ * dst->changed.stream_freq = (1ULL << MaxStreams) - 1;
+ * }*/
}
/* Textures */
dst->ff.material = src->ff.material;
memcpy(dst->ff.tex_stage, src->ff.tex_stage, sizeof(dst->ff.tex_stage));
- if (apply) /* TODO: memset */
- memcpy(dst->ff.changed.tex_stage,
- src->ff.changed.tex_stage, sizeof(dst->ff.changed.tex_stage));
+ /* if (apply) TODO: memset
+ * memcpy(dst->ff.changed.tex_stage,
+ * src->ff.changed.tex_stage, sizeof(dst->ff.changed.tex_stage));*/
/* Lights. */
if (1) {
/* Apply is always used on device state.
* src is then the D3DSBT_ALL stateblock which
* ff.changed.transform indicates all matrices are dirty.
- */
- if (apply)
- memcpy(dst->ff.changed.transform,
- src->ff.changed.transform, sizeof(dst->ff.changed.transform));
+ *
+ * if (apply)
+ * memcpy(dst->ff.changed.transform,
+ * src->ff.changed.transform, sizeof(dst->ff.changed.transform));*/
}
}