The context now contains SIMD vectors which must be aligned (specifically
samplePositions in the rastState in the derived state). Failure to align
can result in segv crash on unaligned memory access in vector
instructions.
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
if (screen->pipe == pipe)
screen->pipe = NULL;
- FREE(ctx);
+ AlignedFree(ctx);
}
struct pipe_context *
swr_create_context(struct pipe_screen *p_screen, void *priv, unsigned flags)
{
- struct swr_context *ctx = CALLOC_STRUCT(swr_context);
+ struct swr_context *ctx = (struct swr_context *)
+ AlignedMalloc(sizeof(struct swr_context), KNOB_SIMD_BYTES);
+ memset(ctx, 0, sizeof(struct swr_context));
+
ctx->blendJIT =
new std::unordered_map<BLEND_COMPILE_STATE, PFN_BLEND_JIT_FUNC>;