diff options
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_setup.c | 25 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_setup.h | 13 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_derived.c | 16 |
3 files changed, 32 insertions, 22 deletions
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index 28f163b4d8f..ffe49260b9a 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -38,7 +38,6 @@ #include "sp_setup.h" #include "sp_state.h" #include "draw/draw_context.h" -#include "draw/draw_vertex.h" #include "pipe/p_shader_tokens.h" #include "util/u_math.h" #include "util/u_memory.h" @@ -624,12 +623,12 @@ setup_tri_coefficients(struct setup_context *setup) uint j; switch (sinfo->attrib[fragSlot].interp) { - case INTERP_CONSTANT: + case SP_INTERP_CONSTANT: for (j = 0; j < TGSI_NUM_CHANNELS; j++) { const_coeff(setup, &setup->coef[fragSlot], vertSlot, j); } break; - case INTERP_LINEAR: + case SP_INTERP_LINEAR: for (j = 0; j < TGSI_NUM_CHANNELS; j++) { tri_apply_cylindrical_wrap(setup->vmin[vertSlot][j], setup->vmid[vertSlot][j], @@ -639,7 +638,7 @@ setup_tri_coefficients(struct setup_context *setup) tri_linear_coeff(setup, &setup->coef[fragSlot], j, v); } break; - case INTERP_PERSPECTIVE: + case SP_INTERP_PERSPECTIVE: for (j = 0; j < TGSI_NUM_CHANNELS; j++) { tri_apply_cylindrical_wrap(setup->vmin[vertSlot][j], setup->vmid[vertSlot][j], @@ -649,7 +648,7 @@ setup_tri_coefficients(struct setup_context *setup) tri_persp_coeff(setup, &setup->coef[fragSlot], j, v); } break; - case INTERP_POS: + case SP_INTERP_POS: setup_fragcoord_coeff(setup, fragSlot); break; default: @@ -1010,11 +1009,11 @@ setup_line_coefficients(struct setup_context *setup, uint j; switch (sinfo->attrib[fragSlot].interp) { - case INTERP_CONSTANT: + case SP_INTERP_CONSTANT: for (j = 0; j < TGSI_NUM_CHANNELS; j++) const_coeff(setup, &setup->coef[fragSlot], vertSlot, j); break; - case INTERP_LINEAR: + case SP_INTERP_LINEAR: for (j = 0; j < TGSI_NUM_CHANNELS; j++) { line_apply_cylindrical_wrap(setup->vmin[vertSlot][j], setup->vmax[vertSlot][j], @@ -1023,7 +1022,7 @@ setup_line_coefficients(struct setup_context *setup, line_linear_coeff(setup, &setup->coef[fragSlot], j, v); } break; - case INTERP_PERSPECTIVE: + case SP_INTERP_PERSPECTIVE: for (j = 0; j < TGSI_NUM_CHANNELS; j++) { line_apply_cylindrical_wrap(setup->vmin[vertSlot][j], setup->vmax[vertSlot][j], @@ -1032,7 +1031,7 @@ setup_line_coefficients(struct setup_context *setup, line_persp_coeff(setup, &setup->coef[fragSlot], j, v); } break; - case INTERP_POS: + case SP_INTERP_POS: setup_fragcoord_coeff(setup, fragSlot); break; default: @@ -1296,18 +1295,18 @@ sp_setup_point(struct setup_context *setup, uint j; switch (sinfo->attrib[fragSlot].interp) { - case INTERP_CONSTANT: + case SP_INTERP_CONSTANT: /* fall-through */ - case INTERP_LINEAR: + case SP_INTERP_LINEAR: for (j = 0; j < TGSI_NUM_CHANNELS; j++) const_coeff(setup, &setup->coef[fragSlot], vertSlot, j); break; - case INTERP_PERSPECTIVE: + case SP_INTERP_PERSPECTIVE: for (j = 0; j < TGSI_NUM_CHANNELS; j++) point_persp_coeff(setup, setup->vprovoke, &setup->coef[fragSlot], vertSlot, j); break; - case INTERP_POS: + case SP_INTERP_POS: setup_fragcoord_coeff(setup, fragSlot); break; default: diff --git a/src/gallium/drivers/softpipe/sp_setup.h b/src/gallium/drivers/softpipe/sp_setup.h index 8bb50b98fec..9efae1cb5ed 100644 --- a/src/gallium/drivers/softpipe/sp_setup.h +++ b/src/gallium/drivers/softpipe/sp_setup.h @@ -30,10 +30,21 @@ struct setup_context; struct softpipe_context; +/** + * Attribute interpolation mode + */ +enum sp_interp_mode { + SP_INTERP_POS, /**< special case for frag position */ + SP_INTERP_CONSTANT, + SP_INTERP_LINEAR, + SP_INTERP_PERSPECTIVE +}; + + struct sp_setup_info { unsigned valid; struct { - unsigned interp:8; /**< INTERP_X */ + unsigned interp:8; /**< SP_INTERP_X */ unsigned src_index:8; } attrib[PIPE_MAX_SHADER_OUTPUTS]; }; diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c index 3fb1daee2c1..ca29d76f8c2 100644 --- a/src/gallium/drivers/softpipe/sp_state_derived.c +++ b/src/gallium/drivers/softpipe/sp_state_derived.c @@ -78,7 +78,7 @@ softpipe_compute_vertex_info(struct softpipe_context *softpipe) */ vinfo_vbuf->num_attribs = 0; for (i = 0; i < num; i++) { - draw_emit_vertex_attr(vinfo_vbuf, EMIT_4F, INTERP_PERSPECTIVE, i); + draw_emit_vertex_attr(vinfo_vbuf, EMIT_4F, i); } draw_compute_vertex_size(vinfo_vbuf); @@ -92,17 +92,17 @@ softpipe_compute_vertex_info(struct softpipe_context *softpipe) */ for (i = 0; i < fsInfo->num_inputs; i++) { int src; - enum interp_mode interp = INTERP_LINEAR; + enum sp_interp_mode interp = SP_INTERP_LINEAR; switch (fsInfo->input_interpolate[i]) { case TGSI_INTERPOLATE_CONSTANT: - interp = INTERP_CONSTANT; + interp = SP_INTERP_CONSTANT; break; case TGSI_INTERPOLATE_LINEAR: - interp = INTERP_LINEAR; + interp = SP_INTERP_LINEAR; break; case TGSI_INTERPOLATE_PERSPECTIVE: - interp = INTERP_PERSPECTIVE; + interp = SP_INTERP_PERSPECTIVE; break; case TGSI_INTERPOLATE_COLOR: assert(fsInfo->input_semantic_name[i] == TGSI_SEMANTIC_COLOR); @@ -113,15 +113,15 @@ softpipe_compute_vertex_info(struct softpipe_context *softpipe) switch (fsInfo->input_semantic_name[i]) { case TGSI_SEMANTIC_POSITION: - interp = INTERP_POS; + interp = SP_INTERP_POS; break; case TGSI_SEMANTIC_COLOR: if (fsInfo->input_interpolate[i] == TGSI_INTERPOLATE_COLOR) { if (softpipe->rasterizer->flatshade) - interp = INTERP_CONSTANT; + interp = SP_INTERP_CONSTANT; else - interp = INTERP_PERSPECTIVE; + interp = SP_INTERP_PERSPECTIVE; } break; } |