aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c5
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.h3
-rw-r--r--src/gallium/auxiliary/draw/draw_private.h1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c2
5 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 4a3bada06e0..2c78e4709d9 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1622,7 +1622,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
struct gallivm_state *gallivm = variant->gallivm;
LLVMContextRef context = gallivm->context;
LLVMTypeRef int32_type = LLVMInt32TypeInContext(context);
- LLVMTypeRef arg_types[11];
+ LLVMTypeRef arg_types[12];
unsigned num_arg_types = ARRAY_SIZE(arg_types);
LLVMTypeRef func_type;
LLVMValueRef context_ptr;
@@ -1689,6 +1689,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
arg_types[i++] = int32_type; /* vertex_id_offset */
arg_types[i++] = int32_type; /* start_instance */
arg_types[i++] = LLVMPointerType(int32_type, 0); /* fetch_elts */
+ arg_types[i++] = int32_type; /* draw_id */
func_type = LLVMFunctionType(LLVMInt8TypeInContext(context),
arg_types, num_arg_types, 0);
@@ -1723,6 +1724,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
vertex_id_offset = LLVMGetParam(variant_func, 8);
system_values.base_instance = LLVMGetParam(variant_func, 9);
fetch_elts = LLVMGetParam(variant_func, 10);
+ system_values.draw_id = LLVMGetParam(variant_func, 11);
lp_build_name(context_ptr, "context");
lp_build_name(io_ptr, "io");
@@ -1735,6 +1737,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant)
lp_build_name(vertex_id_offset, "vertex_id_offset");
lp_build_name(system_values.base_instance, "start_instance");
lp_build_name(fetch_elts, "fetch_elts");
+ lp_build_name(system_values.draw_id, "draw_id");
/*
* Function body
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index 914f783fd00..6edc89b63ba 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -328,7 +328,8 @@ typedef boolean
unsigned instance_id,
unsigned vertex_id_offset,
unsigned start_instance,
- const unsigned *fetch_elts);
+ const unsigned *fetch_elts,
+ unsigned draw_id);
typedef int
diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h
index 86e90c76f88..0fd0caab31b 100644
--- a/src/gallium/auxiliary/draw/draw_private.h
+++ b/src/gallium/auxiliary/draw/draw_private.h
@@ -196,6 +196,7 @@ struct draw_context
int eltBias;
unsigned min_index;
unsigned max_index;
+ unsigned drawid;
/** vertex arrays */
struct draw_vertex_buffer vbuffer[PIPE_MAX_ATTRIBS];
diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c
index f6918976310..24ac0542726 100644
--- a/src/gallium/auxiliary/draw/draw_pt.c
+++ b/src/gallium/auxiliary/draw/draw_pt.c
@@ -485,6 +485,7 @@ draw_vbo(struct draw_context *draw,
draw->pt.user.min_index = info->min_index;
draw->pt.user.max_index = info->max_index;
draw->pt.user.eltSize = info->index_size ? draw->pt.user.eltSizeIB : 0;
+ draw->pt.user.drawid = info->drawid;
if (0)
debug_printf("draw_vbo(mode=%u start=%u count=%u):\n",
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index 0eeaf780af0..c19eda2ede4 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -429,7 +429,7 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle,
draw->instance_id,
vid_base,
draw->start_instance,
- elts);
+ elts, draw->pt.user.drawid);
/* Finished with fetch and vs:
*/