summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/drivers')
-rw-r--r--lib/mesa/src/gallium/drivers/llvmpipe/lp_surface.c6
-rw-r--r--lib/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c18
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_perfcounter.c5
-rw-r--r--lib/mesa/src/gallium/drivers/radeonsi/si_pm4.c2
4 files changed, 26 insertions, 5 deletions
diff --git a/lib/mesa/src/gallium/drivers/llvmpipe/lp_surface.c b/lib/mesa/src/gallium/drivers/llvmpipe/lp_surface.c
index 8e905b8d7..ef5821bce 100644
--- a/lib/mesa/src/gallium/drivers/llvmpipe/lp_surface.c
+++ b/lib/mesa/src/gallium/drivers/llvmpipe/lp_surface.c
@@ -311,6 +311,9 @@ llvmpipe_clear_render_target(struct pipe_context *pipe,
if (render_condition_enabled && !llvmpipe_check_render_cond(llvmpipe))
return;
+ width = MIN2(width, dst->texture->width0 - dstx);
+ height = MIN2(height, dst->texture->height0 - dsty);
+
if (dst->texture->nr_samples > 1) {
struct pipe_box box;
u_box_2d(dstx, dsty, width, height, &box);
@@ -379,6 +382,9 @@ llvmpipe_clear_depth_stencil(struct pipe_context *pipe,
if (render_condition_enabled && !llvmpipe_check_render_cond(llvmpipe))
return;
+ width = MIN2(width, dst->texture->width0 - dstx);
+ height = MIN2(height, dst->texture->height0 - dsty);
+
if (dst->texture->nr_samples > 1) {
uint64_t zstencil = util_pack64_z_stencil(dst->format, depth, stencil);
struct pipe_box box;
diff --git a/lib/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c b/lib/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c
index d235c8db5..a1daca18f 100644
--- a/lib/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/lib/mesa/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -1367,6 +1367,12 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch,
for (int i = 0; i < ctx->sampler_view_count[stage]; ++i) {
struct panfrost_sampler_view *view = ctx->sampler_views[stage][i];
+
+ if (!view) {
+ memset(&out[i], 0, sizeof(out[i]));
+ continue;
+ }
+
struct pipe_sampler_view *pview = &view->base;
struct panfrost_resource *rsrc = pan_resource(pview->texture);
@@ -1379,11 +1385,14 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch,
return T.gpu;
#else
- uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS];
+ uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS] = { 0 };
for (int i = 0; i < ctx->sampler_view_count[stage]; ++i) {
struct panfrost_sampler_view *view = ctx->sampler_views[stage][i];
+ if (!view)
+ continue;
+
panfrost_update_sampler_view(view, &ctx->base);
trampolines[i] = panfrost_get_tex_desc(batch, stage, view);
@@ -1411,8 +1420,11 @@ panfrost_emit_sampler_descriptors(struct panfrost_batch *batch,
SAMPLER);
struct mali_sampler_packed *out = (struct mali_sampler_packed *) T.cpu;
- for (unsigned i = 0; i < ctx->sampler_count[stage]; ++i)
- out[i] = ctx->samplers[stage][i]->hw;
+ for (unsigned i = 0; i < ctx->sampler_count[stage]; ++i) {
+ struct panfrost_sampler_state *st = ctx->samplers[stage][i];
+
+ out[i] = st ? st->hw : (struct mali_sampler_packed){0};
+ }
return T.gpu;
}
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_perfcounter.c b/lib/mesa/src/gallium/drivers/radeonsi/si_perfcounter.c
index 0bee2f7d0..ee996f525 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_perfcounter.c
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_perfcounter.c
@@ -158,7 +158,10 @@ static void si_pc_emit_stop(struct si_context *sctx, struct si_resource *buffer,
radeon_emit(EVENT_TYPE(V_028A90_PERFCOUNTER_STOP) | EVENT_INDEX(0));
radeon_set_uconfig_reg(
R_036020_CP_PERFMON_CNTL,
- S_036020_PERFMON_STATE(V_036020_CP_PERFMON_STATE_STOP_COUNTING) | S_036020_PERFMON_SAMPLE_ENABLE(1));
+ S_036020_PERFMON_STATE(sctx->screen->info.never_stop_sq_perf_counters ?
+ V_036020_CP_PERFMON_STATE_START_COUNTING :
+ V_036020_CP_PERFMON_STATE_STOP_COUNTING) |
+ S_036020_PERFMON_SAMPLE_ENABLE(1));
radeon_end();
}
diff --git a/lib/mesa/src/gallium/drivers/radeonsi/si_pm4.c b/lib/mesa/src/gallium/drivers/radeonsi/si_pm4.c
index ae4affa1b..d4ea07692 100644
--- a/lib/mesa/src/gallium/drivers/radeonsi/si_pm4.c
+++ b/lib/mesa/src/gallium/drivers/radeonsi/si_pm4.c
@@ -137,7 +137,7 @@ void si_pm4_reset_emitted(struct si_context *sctx, bool first_cs)
* added to the buffer list on the next draw call.
*/
for (unsigned i = 0; i < SI_NUM_STATES; i++) {
- struct si_pm4_state *state = sctx->emitted.array[i];
+ struct si_pm4_state *state = sctx->queued.array[i];
if (state && state->is_shader) {
sctx->emitted.array[i] = NULL;