#include "lima_screen.h"
#include "lima_texture.h"
#include "lima_resource.h"
-#include "lima_submit.h"
+#include "lima_job.h"
#include "lima_util.h"
#include "lima_format.h"
desc->va[va_idx + 1] |= va >> (32 - va_bit_idx);
}
+/*
+ * Note: this function is used by both draw and flush code path,
+ * make sure no lima_job_get() is called inside this.
+ */
void
lima_texture_desc_set_res(struct lima_context *ctx, lima_tex_desc *desc,
struct pipe_resource *prsc,
}
desc->format = lima_format_get_texel(prsc->format);
- desc->swap_r_b = lima_format_get_swap_rb(prsc->format);
+ desc->swap_r_b = lima_format_get_texel_swap_rb(prsc->format);
desc->width = width;
desc->height = height;
desc->unknown_3_1 = 1;
void
lima_update_textures(struct lima_context *ctx)
{
+ struct lima_job *job = lima_job_get(ctx);
struct lima_texture_stateobj *lima_tex = &ctx->tex_stateobj;
assert (lima_tex->num_samplers <= 16);
if (!lima_tex->num_samplers || !lima_tex->num_textures)
return;
- /* we always need to add texture bo to submit */
+ /* we always need to add texture bo to job */
for (int i = 0; i < lima_tex->num_samplers; i++) {
struct lima_sampler_view *texture = lima_sampler_view(lima_tex->textures[i]);
struct lima_resource *rsc = lima_resource(texture->base.texture);
- lima_submit_add_bo(ctx->submit, LIMA_PIPE_PP, rsc->bo, LIMA_SUBMIT_BO_READ);
+ lima_flush_previous_job_writing_resource(ctx, texture->base.texture);
+ lima_job_add_bo(job, LIMA_PIPE_PP, rsc->bo, LIMA_SUBMIT_BO_READ);
}
/* do not regenerate texture desc if no change */
}
lima_dump_command_stream_print(
- descs, size, false, "add textures_desc at va %x\n",
+ job->dump, descs, size, false, "add textures_desc at va %x\n",
lima_ctx_buff_va(ctx, lima_ctx_buff_pp_tex_desc));
lima_dump_texture_descriptor(
- descs, size,
+ job->dump, descs, size,
lima_ctx_buff_va(ctx, lima_ctx_buff_pp_tex_desc) + lima_tex_list_size,
lima_tex_list_size);
}