r600_set_atom_dirty(rctx, &rctx->cs_shader_state.atom, true);
}
+ bool need_buf_const = current->shader.uses_tex_buffers ||
+ current->shader.has_txq_cube_array_z_comp;
+
+ if (need_buf_const) {
+ eg_setup_buffer_constants(rctx, PIPE_SHADER_COMPUTE);
+ r600_update_driver_const_buffers(rctx, true);
+ }
if (evergreen_emit_atomic_buffer_setup(rctx, current, combined_atomics, &atomic_used_mask)) {
radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0));
radeon_emit(cs, EVENT_TYPE(EVENT_TYPE_CS_PARTIAL_FLUSH) | EVENT_INDEX(4));
uint8_t *atomic_used_mask_p);
void r600_update_compressed_resource_state(struct r600_context *rctx, bool compute_only);
+void eg_setup_buffer_constants(struct r600_context *rctx, int shader_type);
+void r600_update_driver_const_buffers(struct r600_context *rctx, bool compute_only);
#endif
r600_mark_atom_dirty(rctx, &rctx->sample_mask.atom);
}
-static void r600_update_driver_const_buffers(struct r600_context *rctx)
+void r600_update_driver_const_buffers(struct r600_context *rctx, bool compute_only)
{
int sh, size;
void *ptr;
struct pipe_constant_buffer cb;
- for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) {
+ int start, end;
+
+ start = compute_only ? PIPE_SHADER_COMPUTE : 0;
+ end = compute_only ? PIPE_SHADER_TYPES : PIPE_SHADER_COMPUTE;
+
+ for (sh = start; sh < end; sh++) {
struct r600_shader_driver_constants_info *info = &rctx->driver_consts[sh];
if (!info->vs_ucp_dirty &&
!info->texture_const_dirty &&
* 1. buffer size for TXQ
* 2. number of cube layers in a cube map array.
*/
-static void eg_setup_buffer_constants(struct r600_context *rctx, int shader_type)
+void eg_setup_buffer_constants(struct r600_context *rctx, int shader_type)
{
struct r600_textures_info *samplers = &rctx->samplers[shader_type];
struct r600_image_state *images = NULL;
if (shader_type == PIPE_SHADER_FRAGMENT) {
images = &rctx->fragment_images;
buffers = &rctx->fragment_buffers;
+ } else if (shader_type == PIPE_SHADER_COMPUTE) {
+ images = &rctx->compute_images;
+ buffers = &rctx->compute_buffers;
}
if (!samplers->views.dirty_buffer_constants &&
}
}
- r600_update_driver_const_buffers(rctx);
+ r600_update_driver_const_buffers(rctx, false);
if (rctx->b.chip_class < EVERGREEN && rctx->ps_shader && rctx->vs_shader) {
if (!r600_adjust_gprs(rctx)) {