summaryrefslogtreecommitdiffstats
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_pt_fetch_shade_pipeline.c26
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c22
2 files changed, 29 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
index a21373baa68..f518deef27d 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c
@@ -53,6 +53,14 @@ struct fetch_pipeline_middle_end {
};
+/** cast wrapper */
+static INLINE struct fetch_pipeline_middle_end *
+fetch_pipeline_middle_end(struct draw_pt_middle_end *middle)
+{
+ return (struct fetch_pipeline_middle_end *) middle;
+}
+
+
/**
* Prepare/validate middle part of the vertex pipeline.
* NOTE: if you change this function, also look at the LLVM
@@ -64,8 +72,7 @@ fetch_pipeline_prepare(struct draw_pt_middle_end *middle,
unsigned opt,
unsigned *max_vertices)
{
- struct fetch_pipeline_middle_end *fpme =
- (struct fetch_pipeline_middle_end *)middle;
+ struct fetch_pipeline_middle_end *fpme = fetch_pipeline_middle_end(middle);
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *vs = draw->vs.vertex_shader;
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
@@ -224,8 +231,7 @@ fetch_pipeline_generic(struct draw_pt_middle_end *middle,
const struct draw_fetch_info *fetch_info,
const struct draw_prim_info *in_prim_info)
{
- struct fetch_pipeline_middle_end *fpme =
- (struct fetch_pipeline_middle_end *) middle;
+ struct fetch_pipeline_middle_end *fpme = fetch_pipeline_middle_end(middle);
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *vshader = draw->vs.vertex_shader;
struct draw_geometry_shader *gshader = draw->gs.geometry_shader;
@@ -361,8 +367,7 @@ fetch_pipeline_run(struct draw_pt_middle_end *middle,
unsigned draw_count,
unsigned prim_flags)
{
- struct fetch_pipeline_middle_end *fpme =
- (struct fetch_pipeline_middle_end *) middle;
+ struct fetch_pipeline_middle_end *fpme = fetch_pipeline_middle_end(middle);
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
@@ -390,8 +395,7 @@ fetch_pipeline_linear_run(struct draw_pt_middle_end *middle,
unsigned count,
unsigned prim_flags)
{
- struct fetch_pipeline_middle_end *fpme =
- (struct fetch_pipeline_middle_end *) middle;
+ struct fetch_pipeline_middle_end *fpme = fetch_pipeline_middle_end(middle);
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
@@ -422,8 +426,7 @@ fetch_pipeline_linear_run_elts(struct draw_pt_middle_end *middle,
unsigned draw_count,
unsigned prim_flags )
{
- struct fetch_pipeline_middle_end *fpme =
- (struct fetch_pipeline_middle_end *) middle;
+ struct fetch_pipeline_middle_end *fpme = fetch_pipeline_middle_end(middle);
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
@@ -457,8 +460,7 @@ fetch_pipeline_finish( struct draw_pt_middle_end *middle )
static void
fetch_pipeline_destroy( struct draw_pt_middle_end *middle )
{
- struct fetch_pipeline_middle_end *fpme =
- (struct fetch_pipeline_middle_end *) middle;
+ struct fetch_pipeline_middle_end *fpme = fetch_pipeline_middle_end(middle);
if (fpme->fetch)
draw_pt_fetch_destroy( fpme->fetch );
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 21a8e443505..481553a78a4 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
@@ -59,6 +59,14 @@ struct llvm_middle_end {
};
+/** cast wrapper */
+static INLINE struct llvm_middle_end *
+llvm_middle_end(struct draw_pt_middle_end *middle)
+{
+ return (struct llvm_middle_end *) middle;
+}
+
+
static void
llvm_middle_end_prepare_gs(struct llvm_middle_end *fpme)
{
@@ -135,7 +143,7 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
unsigned opt,
unsigned *max_vertices )
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
struct draw_context *draw = fpme->draw;
struct draw_vertex_shader *vs = draw->vs.vertex_shader;
struct draw_geometry_shader *gs = draw->gs.geometry_shader;
@@ -276,7 +284,7 @@ llvm_middle_end_prepare( struct draw_pt_middle_end *middle,
static void
llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle)
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
struct draw_context *draw = fpme->draw;
unsigned i;
@@ -338,7 +346,7 @@ llvm_pipeline_generic(struct draw_pt_middle_end *middle,
const struct draw_fetch_info *fetch_info,
const struct draw_prim_info *in_prim_info)
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
struct draw_context *draw = fpme->draw;
struct draw_geometry_shader *gshader = draw->gs.geometry_shader;
struct draw_prim_info gs_prim_info;
@@ -475,7 +483,7 @@ llvm_middle_end_run(struct draw_pt_middle_end *middle,
unsigned draw_count,
unsigned prim_flags)
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
@@ -503,7 +511,7 @@ llvm_middle_end_linear_run(struct draw_pt_middle_end *middle,
unsigned count,
unsigned prim_flags)
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
@@ -533,7 +541,7 @@ llvm_middle_end_linear_run_elts(struct draw_pt_middle_end *middle,
unsigned draw_count,
unsigned prim_flags)
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
struct draw_fetch_info fetch_info;
struct draw_prim_info prim_info;
@@ -567,7 +575,7 @@ llvm_middle_end_finish(struct draw_pt_middle_end *middle)
static void
llvm_middle_end_destroy(struct draw_pt_middle_end *middle)
{
- struct llvm_middle_end *fpme = (struct llvm_middle_end *)middle;
+ struct llvm_middle_end *fpme = llvm_middle_end(middle);
if (fpme->fetch)
draw_pt_fetch_destroy( fpme->fetch );