aux/tc: add tc_buffer_write to replace pipe_buffer_write usage
tc_buffer_write is the tc-safe version of this function which will avoid accidental invalidations that break behavior Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14770>
This commit is contained in:
parent
be5311972f
commit
143c156409
|
@ -104,6 +104,8 @@
|
||||||
* TC_TRANSFER_MAP_NO_INVALIDATE into transfer_map and buffer_subdata to
|
* TC_TRANSFER_MAP_NO_INVALIDATE into transfer_map and buffer_subdata to
|
||||||
* indicate this. Ignoring the flag will lead to failures.
|
* indicate this. Ignoring the flag will lead to failures.
|
||||||
* The threaded context uses its own buffer invalidation mechanism.
|
* The threaded context uses its own buffer invalidation mechanism.
|
||||||
|
* Do NOT use pipe_buffer_write, as this may trigger invalidation;
|
||||||
|
* use tc_buffer_write instead.
|
||||||
*
|
*
|
||||||
* 4) PIPE_MAP_ONCE can no longer be used to infer that a buffer will not be mapped
|
* 4) PIPE_MAP_ONCE can no longer be used to infer that a buffer will not be mapped
|
||||||
* a second time before it is unmapped.
|
* a second time before it is unmapped.
|
||||||
|
@ -612,6 +614,16 @@ tc_buffer_disable_cpu_storage(struct pipe_resource *buf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
tc_buffer_write(struct pipe_context *pipe,
|
||||||
|
struct pipe_resource *buf,
|
||||||
|
unsigned offset,
|
||||||
|
unsigned size,
|
||||||
|
const void *data)
|
||||||
|
{
|
||||||
|
pipe->buffer_subdata(pipe, buf, PIPE_MAP_WRITE | TC_TRANSFER_MAP_NO_INVALIDATE, offset, size, data);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue