/* fixme: move it from here */
#define MAX_PRIMITIVES 64
-static INLINE int
+static inline int
draw_gs_get_input_index(int semantic, int index,
const struct tgsi_shader_info *input_info)
{
* the number of elements in the SOA vector. This ensures that the
* throughput is optimized for the given vector instruction set.
*/
-static INLINE boolean
+static inline boolean
draw_gs_should_flush(struct draw_geometry_shader *shader)
{
return (shader->fetched_prim_count == shader->vector_length);
if (shader->info.uses_invocationid) {
unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INVOCATIONID];
for (j = 0; j < TGSI_QUAD_SIZE; j++)
- machine->SystemValue[i].i[j] = shader->invocation_id;
+ machine->SystemValue[i].xyzw[0].i[j] = shader->invocation_id;
}
}
{
struct tgsi_exec_machine *machine = shader->machine;
- tgsi_set_exec_mask(machine,
- 1,
- input_primitives > 1,
- input_primitives > 2,
- input_primitives > 3);
-
/* run interpreter */
- tgsi_exec_machine_run(machine);
+ tgsi_exec_machine_run(machine, 0);
return
machine->Temps[TGSI_EXEC_TEMP_PRIMITIVE_I].xyzw[TGSI_EXEC_TEMP_PRIMITIVE_C].u[0];
if (!use_llvm && shader && shader->machine->Tokens != shader->state.tokens) {
tgsi_exec_machine_bind_shader(shader->machine,
shader->state.tokens,
- draw->gs.tgsi.sampler);
+ draw->gs.tgsi.sampler,
+ draw->gs.tgsi.image,
+ draw->gs.tgsi.buffer);
}
}
draw_gs_init( struct draw_context *draw )
{
if (!draw->llvm) {
- draw->gs.tgsi.machine = tgsi_exec_machine_create();
+ draw->gs.tgsi.machine = tgsi_exec_machine_create(PIPE_SHADER_GEOMETRY);
if (!draw->gs.tgsi.machine)
return FALSE;
if (use_llvm) {
llvm_gs = CALLOC_STRUCT(llvm_geometry_shader);
- if (llvm_gs == NULL)
+ if (!llvm_gs)
return NULL;
gs = &llvm_gs->base;
if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) {
debug_assert(gs->info.output_semantic_index[i] <
PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- gs->clipdistance_output[gs->info.output_semantic_index[i]] = i;
- }
- if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_CULLDIST) {
- debug_assert(gs->info.output_semantic_index[i] <
- PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT);
- gs->culldistance_output[gs->info.output_semantic_index[i]] = i;
+ gs->ccdistance_output[gs->info.output_semantic_index[i]] = i;
}
}