summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_shader.cpp
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-06-01 09:56:26 -0500
committerTim Rowley <[email protected]>2016-06-07 11:47:52 -0500
commit87f0a0448fba898a7ab2a36eed9682ff8c1c6d5c (patch)
tree0b58bdbd4f96ec9c25a91e900bb4d916d448f40c /src/gallium/drivers/swr/swr_shader.cpp
parentc81b090c920f90bf86a34c978e10ff336d1edbc0 (diff)
swr: fix provoking vertex
Use rasterizer provoking vertex API. Fix rasterizer provoking vertex for tristrips and quad list/strips. v2: make provoking vertex tables static const Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_shader.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_shader.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index f693f51bb49..f26467e078e 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -102,7 +102,6 @@ swr_generate_fs_key(struct swr_jit_fs_key &key,
key.nr_cbufs = ctx->framebuffer.nr_cbufs;
key.light_twoside = ctx->rasterizer->light_twoside;
- key.flatshade = ctx->rasterizer->flatshade;
memcpy(&key.vs_output_semantic_name,
&ctx->vs->info.base.output_semantic_name,
sizeof(key.vs_output_semantic_name));
@@ -351,15 +350,13 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
GEP(hPrivateData, {0, swr_draw_context_num_constantsFS});
const_sizes_ptr->setName("num_fs_constants");
- // xxx should check for flat shading versus interpolation
-
-
// load *pAttribs, *pPerspAttribs
Value *pRawAttribs = LOAD(pPS, {0, SWR_PS_CONTEXT_pAttribs}, "pRawAttribs");
Value *pPerspAttribs =
LOAD(pPS, {0, SWR_PS_CONTEXT_pPerspAttribs}, "pPerspAttribs");
swr_fs->constantMask = 0;
+ swr_fs->flatConstantMask = 0;
swr_fs->pointSpriteMask = 0;
for (int attrib = 0; attrib < PIPE_MAX_SHADER_INPUTS; attrib++) {
@@ -457,6 +454,8 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
if (interpMode == TGSI_INTERPOLATE_CONSTANT) {
swr_fs->constantMask |= 1 << linkedAttrib;
+ } else if (interpMode == TGSI_INTERPOLATE_COLOR) {
+ swr_fs->flatConstantMask |= 1 << linkedAttrib;
}
for (int channel = 0; channel < TGSI_NUM_CHANNELS; channel++) {
@@ -484,6 +483,8 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
if (interpMode == TGSI_INTERPOLATE_CONSTANT) {
swr_fs->constantMask |= 1 << bcolorAttrib;
+ } else if (interpMode == TGSI_INTERPOLATE_COLOR) {
+ swr_fs->flatConstantMask |= 1 << bcolorAttrib;
}
}
@@ -493,9 +494,6 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
if (interpMode == TGSI_INTERPOLATE_CONSTANT) {
inputs[attrib][channel] = wrap(va);
- } else if ((interpMode == TGSI_INTERPOLATE_COLOR) &&
- (key.flatshade == true)) {
- inputs[attrib][channel] = wrap(vc);
} else {
Value *vk = FSUB(FSUB(VIMMED1(1.0f), vi), vj);