continue;
struct v3d_sampler_view *view = v3d_sampler_view(pview);
- if (view->texture != view->base.texture)
+ if (view->texture != view->base.texture &&
+ view->base.format != PIPE_FORMAT_X32_S8X24_UINT)
v3d_update_shadow_texture(pctx, &view->base);
v3d_flush_jobs_writing_resource(v3d, view->texture);
}
}
+static void
+v3d_predraw_check_outputs(struct pipe_context *pctx)
+{
+ struct v3d_context *v3d = v3d_context(pctx);
+
+ /* Flush jobs reading from TF buffers that we are about to write. */
+ if (v3d_transform_feedback_enabled(v3d)) {
+ struct v3d_streamout_stateobj *so = &v3d->streamout;
+
+ for (int i = 0; i < so->num_targets; i++) {
+ if (!so->targets[i])
+ continue;
+
+ const struct pipe_stream_output_target *target =
+ so->targets[i];
+ v3d_flush_jobs_reading_resource(v3d, target->buffer);
+ }
+ }
+}
+
static void
v3d_emit_gl_shader_state(struct v3d_context *v3d,
const struct pipe_draw_info *info)
shader.fragment_shader_uses_real_pixel_centre_w_in_addition_to_centroid_w2 =
v3d->prog.fs->prog_data.fs->uses_center_w;
+#if V3D_VERSION >= 40
+ shader.disable_implicit_point_line_varyings =
+ !v3d->prog.fs->prog_data.fs->uses_implicit_point_line_varyings;
+#endif
+
shader.number_of_varyings_in_fragment_shader =
v3d->prog.fs->prog_data.fs->num_inputs;
v3d->prog.vs->prog_data.vs->separate_segments;
shader.coordinate_shader_input_vpm_segment_size =
- v3d->prog.cs->prog_data.vs->vpm_input_size;
+ v3d->prog.cs->prog_data.vs->separate_segments ?
+ v3d->prog.cs->prog_data.vs->vpm_input_size : 1;
shader.vertex_shader_input_vpm_segment_size =
- v3d->prog.vs->prog_data.vs->vpm_input_size;
+ v3d->prog.vs->prog_data.vs->separate_segments ?
+ v3d->prog.vs->prog_data.vs->vpm_input_size : 1;
shader.coordinate_shader_output_vpm_segment_size =
v3d->prog.cs->prog_data.vs->vpm_output_size;
vtx->defaults_offset);
}
+ bool cs_loaded_any = false;
for (int i = 0; i < vtx->num_elements; i++) {
struct pipe_vertex_element *elem = &vtx->pipe[i];
struct pipe_vertex_buffer *vb =
v3d->prog.cs->prog_data.vs->vattr_sizes[i];
attr.number_of_values_read_by_vertex_shader =
v3d->prog.vs->prog_data.vs->vattr_sizes[i];
+
+ /* GFXH-930: At least one attribute must be enabled
+ * and read by CS and VS. If we have attributes being
+ * consumed by the VS but not the CS, then set up a
+ * dummy load of the last attribute into the CS's VPM
+ * inputs. (Since CS is just dead-code-elimination
+ * compared to VS, we can't have CS loading but not
+ * VS).
+ */
+ if (v3d->prog.cs->prog_data.vs->vattr_sizes[i])
+ cs_loaded_any = true;
+ if (i == vtx->num_elements - 1 && !cs_loaded_any) {
+ attr.number_of_values_read_by_coordinate_shader = 1;
+ }
#if V3D_VERSION >= 41
attr.maximum_index = 0xffffff;
#endif
return;
}
- /* Before setting up the draw, flush anything writing to the textures
- * that we read from.
+ /* Before setting up the draw, flush anything writing to the resources
+ * that we read from or reading from resources we write to.
*/
- for (int s = 0; s < PIPE_SHADER_TYPES; s++)
+ for (int s = 0; s < PIPE_SHADER_COMPUTE; s++)
v3d_predraw_check_stage_inputs(pctx, s);
if (info->indirect)
v3d_flush_jobs_writing_resource(v3d, info->indirect->buffer);
+ v3d_predraw_check_outputs(pctx);
+
struct v3d_job *job = v3d_get_job_for_fbo(v3d);
/* If vertex texturing depends on the output of rendering, we need to
/* Mark SSBOs as being written. We don't actually know which ones are
* read vs written, so just assume the worst
*/
- for (int s = 0; s < PIPE_SHADER_TYPES; s++) {
+ for (int s = 0; s < PIPE_SHADER_COMPUTE; s++) {
foreach_bit(i, v3d->ssbo[s].enabled_mask) {
v3d_job_add_write_resource(job,
v3d->ssbo[s].sb[i].buffer);