util_memcpy_cpu_to_le32(tmp, ptr, size);
}
-void si_set_constant_buffer(struct si_context *sctx,
- struct si_buffer_resources *buffers,
- uint slot, struct pipe_constant_buffer *input)
+static void si_set_constant_buffer(struct si_context *sctx,
+ struct si_buffer_resources *buffers,
+ uint slot, struct pipe_constant_buffer *input)
{
assert(slot < buffers->desc.num_elements);
pipe_resource_reference(&buffers->buffers[slot], NULL);
buffers->desc.dirty_mask |= 1u << slot;
}
+void si_set_rw_buffer(struct si_context *sctx,
+ uint slot, struct pipe_constant_buffer *input)
+{
+ si_set_constant_buffer(sctx, &sctx->rw_buffers, slot, input);
+}
+
static void si_pipe_set_constant_buffer(struct pipe_context *ctx,
uint shader, uint slot,
struct pipe_constant_buffer *input)
cb.user_buffer = stipple;
cb.buffer_size = sizeof(stipple);
- si_set_constant_buffer(sctx, &sctx->rw_buffers,
- SI_PS_CONST_POLY_STIPPLE, &cb);
+ si_set_rw_buffer(sctx, SI_PS_CONST_POLY_STIPPLE, &cb);
}
/* TEXTURE METADATA ENABLE/DISABLE */
cb.user_buffer = state->ucp;
cb.buffer_offset = 0;
cb.buffer_size = 4*4*8;
- si_set_constant_buffer(sctx, &sctx->rw_buffers,
- SI_VS_CONST_CLIP_PLANES, &cb);
+ si_set_rw_buffer(sctx, SI_VS_CONST_CLIP_PLANES, &cb);
pipe_resource_reference(&cb.buffer, NULL);
}
assert(0);
}
constbuf.buffer_size = sctx->framebuffer.nr_samples * 2 * 4;
- si_set_constant_buffer(sctx, &sctx->rw_buffers,
- SI_PS_CONST_SAMPLE_POSITIONS, &constbuf);
+ si_set_rw_buffer(sctx, SI_PS_CONST_SAMPLE_POSITIONS, &constbuf);
/* Smoothing (only possible with nr_samples == 1) uses the same
* sample locations as the MSAA it simulates.
(void*)array, sizeof(array),
&cb.buffer_offset);
- si_set_constant_buffer(sctx, &sctx->rw_buffers,
- SI_HS_CONST_DEFAULT_TESS_LEVELS, &cb);
+ si_set_rw_buffer(sctx, SI_HS_CONST_DEFAULT_TESS_LEVELS, &cb);
pipe_resource_reference(&cb.buffer, NULL);
}
void si_emit_graphics_shader_userdata(struct si_context *sctx,
struct r600_atom *atom);
void si_emit_compute_shader_userdata(struct si_context *sctx);
-void si_set_constant_buffer(struct si_context *sctx,
- struct si_buffer_resources *buffers,
- uint slot, struct pipe_constant_buffer *input);
+void si_set_rw_buffer(struct si_context *sctx,
+ uint slot, struct pipe_constant_buffer *input);
/* si_state.c */
struct si_shader_selector;