summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/sb
diff options
context:
space:
mode:
authorGlenn Kennard <[email protected]>2014-09-10 11:54:40 +0200
committerMarek Olšák <[email protected]>2014-10-12 23:53:57 +0200
commita327fa3a068af49bb7ae00a4b03abcb91906e0d2 (patch)
tree73099704bc1d26aab47982aaa80165e20028634d /src/gallium/drivers/r600/sb
parent75e97e2e3f317c79124116f596bdf0fde9f70ef8 (diff)
r600g: Implement GL_ARB_sample_shading
Also fixes two sided lighting which was broken at least on pre-evergreen by commit b1eb00. Signed-off-by: Glenn Kennard <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/sb')
-rw-r--r--src/gallium/drivers/r600/sb/sb_bc_parser.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
index 346ccc9dbc5..d787e5b1238 100644
--- a/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
+++ b/src/gallium/drivers/r600/sb/sb_bc_parser.cpp
@@ -147,25 +147,28 @@ int bc_parser::parse_decls() {
bool ps_interp = ctx.hw_class >= HW_CLASS_EVERGREEN
&& sh->target == TARGET_PS;
- unsigned linear = 0, persp = 0, centroid = 1;
+ bool ij_interpolators[6];
+ memset(ij_interpolators, 0, sizeof(ij_interpolators));
for (unsigned i = 0; i < pshader->ninput; ++i) {
r600_shader_io & in = pshader->input[i];
bool preloaded = sh->target == TARGET_PS && !(ps_interp && in.spi_sid);
sh->add_input(in.gpr, preloaded, /*in.write_mask*/ 0x0F);
if (ps_interp && in.spi_sid) {
- if (in.interpolate == TGSI_INTERPOLATE_LINEAR ||
- in.interpolate == TGSI_INTERPOLATE_COLOR)
- linear = 1;
- else if (in.interpolate == TGSI_INTERPOLATE_PERSPECTIVE)
- persp = 1;
- if (in.centroid)
- centroid = 2;
+ int k = eg_get_interpolator_index(in.interpolate, in.interpolate_location);
+ if (k >= 0)
+ ij_interpolators[k] |= true;
}
}
if (ps_interp) {
- unsigned mask = (1 << (2 * (linear + persp) * centroid)) - 1;
+ /* add the egcm ij interpolators to live inputs */
+ unsigned num_ij = 0;
+ for (unsigned i = 0; i < Elements(ij_interpolators); i++) {
+ num_ij += ij_interpolators[i];
+ }
+
+ unsigned mask = (1 << (2 * num_ij)) - 1;
unsigned gpr = 0;
while (mask) {