summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2015-12-19 03:43:14 +0100
committerRoland Scheidegger <sroland@vmware.com>2016-01-07 01:58:05 +0100
commit2dbc20e45689e09766552517a74e2270e49817b5 (patch)
tree89b68999153a1304a66923d4ced241fd9beddaba /src/gallium/drivers/softpipe
parent892e2d1395375c6f904af5250371c8d2784c8762 (diff)
downloadexternal_mesa3d-2dbc20e45689e09766552517a74e2270e49817b5.zip
external_mesa3d-2dbc20e45689e09766552517a74e2270e49817b5.tar.gz
external_mesa3d-2dbc20e45689e09766552517a74e2270e49817b5.tar.bz2
draw: nuke the interp parameter from vertex_info
draw emit couldn't care less what the interpolation mode is... This somehow looked like it would matter, all drivers more or less dutifully filled that in correctly. But this is only used for emit, if draw needs to know about interpolation mode (for clipping for instance) it will get that information from the vs anyway. softpipe actually used to depend on that interpolation parameter, as it abused that structure quite a bit but no longer. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c25
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.h13
-rw-r--r--src/gallium/drivers/softpipe/sp_state_derived.c16
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 28f163b..ffe4926 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 8bb50b9..9efae1c 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 3fb1dae..ca29d76 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;
}