*
* This stage is the one which will feed stream output and the rasterizer.
*/
-static struct iris_compiled_shader *
-last_vue_shader(struct iris_context *ice)
+static gl_shader_stage
+last_vue_stage(struct iris_context *ice)
{
if (ice->shaders.prog[MESA_SHADER_GEOMETRY])
- return ice->shaders.prog[MESA_SHADER_GEOMETRY];
+ return MESA_SHADER_GEOMETRY;
if (ice->shaders.prog[MESA_SHADER_TESS_EVAL])
- return ice->shaders.prog[MESA_SHADER_TESS_EVAL];
+ return MESA_SHADER_TESS_EVAL;
- return ice->shaders.prog[MESA_SHADER_VERTEX];
+ return MESA_SHADER_VERTEX;
}
/**
if (dirty & IRIS_DIRTY_UNCOMPILED_GS)
iris_update_compiled_gs(ice);
- struct iris_compiled_shader *shader = last_vue_shader(ice);
+ gl_shader_stage last_stage = last_vue_stage(ice);
+ struct iris_compiled_shader *shader = ice->shaders.prog[last_stage];
+ struct iris_uncompiled_shader *ish = ice->shaders.uncompiled[last_stage];
update_last_vue_map(ice, shader->prog_data);
if (ice->state.streamout != shader->streamout) {
ice->state.streamout = shader->streamout;
ice->state.dirty |= IRIS_DIRTY_SO_DECL_LIST | IRIS_DIRTY_STREAMOUT;
}
+ if (ice->state.streamout_active) {
+ for (int i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {
+ struct iris_stream_output_target *so =
+ (void *) ice->state.so_target[i];
+ if (so)
+ so->stride = ish->stream_output.stride[i];
+ }
+ }
+
if (dirty & IRIS_DIRTY_UNCOMPILED_FS)
iris_update_compiled_fs(ice);
// ...
#include "intel/common/gen_sample_positions.h"
#include "iris_batch.h"
#include "iris_context.h"
+#include "iris_defines.h"
#include "iris_pipe.h"
#include "iris_resource.h"
lri.DataDWord = 0;
}
}
+ } else if (draw->count_from_stream_output) {
+ struct iris_stream_output_target *so =
+ (void *) draw->count_from_stream_output;
+
+ // XXX: avoid if possible
+ iris_emit_pipe_control_flush(batch, PIPE_CONTROL_CS_STALL);
+
+ iris_emit_cmd(batch, GENX(MI_LOAD_REGISTER_MEM), lrm) {
+ lrm.RegisterAddress = CS_GPR(0);
+ lrm.MemoryAddress =
+ ro_bo(iris_resource_bo(so->offset.res), so->offset.offset);
+ }
+ iris_math_div32_gpr0(ice, batch, so->stride);
+ _iris_emit_lrr(batch, _3DPRIM_VERTEX_COUNT, CS_GPR(0));
+
+ _iris_emit_lri(batch, _3DPRIM_START_VERTEX, 0);
+ _iris_emit_lri(batch, _3DPRIM_BASE_VERTEX, 0);
+ _iris_emit_lri(batch, _3DPRIM_START_INSTANCE, 0);
+ _iris_emit_lri(batch, _3DPRIM_INSTANCE_COUNT, draw->instance_count);
}
iris_emit_cmd(batch, GENX(3DPRIMITIVE), prim) {
- prim.StartInstanceLocation = draw->start_instance;
- prim.InstanceCount = draw->instance_count;
- prim.VertexCountPerInstance = draw->count;
prim.VertexAccessType = draw->index_size > 0 ? RANDOM : SEQUENTIAL;
prim.PredicateEnable =
ice->state.predicate == IRIS_PREDICATE_STATE_USE_BIT;
- // XXX: this is probably bonkers.
- prim.StartVertexLocation = draw->start;
+ if (draw->indirect || draw->count_from_stream_output) {
+ prim.IndirectParameterEnable = true;
+ } else {
+ prim.StartInstanceLocation = draw->start_instance;
+ prim.InstanceCount = draw->instance_count;
+ prim.VertexCountPerInstance = draw->count;
- prim.IndirectParameterEnable = draw->indirect != NULL;
+ // XXX: this is probably bonkers.
+ prim.StartVertexLocation = draw->start;
- if (draw->index_size) {
- prim.BaseVertexLocation += draw->index_bias;
- } else {
- prim.StartVertexLocation += draw->index_bias;
- }
+ if (draw->index_size) {
+ prim.BaseVertexLocation += draw->index_bias;
+ } else {
+ prim.StartVertexLocation += draw->index_bias;
+ }
- //prim.BaseVertexLocation = ...;
+ //prim.BaseVertexLocation = ...;
+ }
}
}