mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 14:28:05 +02:00
zink: only update inlinable constants when they change
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12577>
This commit is contained in:
parent
2eeaaabb8e
commit
1454955e5d
1 changed files with 7 additions and 3 deletions
|
|
@ -992,10 +992,14 @@ zink_set_inlinable_constants(struct pipe_context *pctx,
|
|||
uint num_values, uint32_t *values)
|
||||
{
|
||||
struct zink_context *ctx = (struct zink_context *)pctx;
|
||||
const uint32_t bit = BITFIELD_BIT(shader);
|
||||
|
||||
memcpy(ctx->inlinable_uniforms[shader], values, num_values * 4);
|
||||
ctx->dirty_shader_stages |= 1 << shader;
|
||||
ctx->inlinable_uniforms_valid_mask |= 1 << shader;
|
||||
if (!(ctx->inlinable_uniforms_valid_mask & bit) ||
|
||||
memcmp(ctx->inlinable_uniforms[shader], values, num_values * 4)) {
|
||||
memcpy(ctx->inlinable_uniforms[shader], values, num_values * 4);
|
||||
ctx->dirty_shader_stages |= bit;
|
||||
ctx->inlinable_uniforms_valid_mask |= bit;
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue