diff options
author | Brian Paul <[email protected]> | 2017-07-31 21:12:07 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-09-10 13:07:30 -0600 |
commit | 36c84bcd7709d760fe30151d2c78a8d3c300978a (patch) | |
tree | a8a37141a58b6b85bc02fb066c3ea006dbcc1657 /src/gallium/drivers/svga | |
parent | bcf7aaa9f7a848f4acae5fa68ac9a422deb6181a (diff) |
svga: add support for interpolation at sample position
Vs. sampling at the centroid or the fragment center.
Note that this does not fix failures with the Piglit
arb_sample_shading-interpolate-at-sample-position or
arb_sample_shading-ignore-centroid-qualifier.exe tests at this time.
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index 1b6e9cf0bae..fa27edcd7cf 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -1958,13 +1958,25 @@ translate_interpolation(const struct svga_shader_emitter_v10 *emit, case TGSI_INTERPOLATE_CONSTANT: return VGPU10_INTERPOLATION_CONSTANT; case TGSI_INTERPOLATE_LINEAR: - return interpolate_loc == TGSI_INTERPOLATE_LOC_CENTROID ? - VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID : - VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE; + if (interpolate_loc == TGSI_INTERPOLATE_LOC_CENTROID) { + return VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID; + } else if (interpolate_loc == TGSI_INTERPOLATE_LOC_SAMPLE && + emit->version >= 41) { + return VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE; + } else { + return VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE; + } + break; case TGSI_INTERPOLATE_PERSPECTIVE: - return interpolate_loc == TGSI_INTERPOLATE_LOC_CENTROID ? - VGPU10_INTERPOLATION_LINEAR_CENTROID : - VGPU10_INTERPOLATION_LINEAR; + if (interpolate_loc == TGSI_INTERPOLATE_LOC_CENTROID) { + return VGPU10_INTERPOLATION_LINEAR_CENTROID; + } else if (interpolate_loc == TGSI_INTERPOLATE_LOC_SAMPLE && + emit->version >= 41) { + return VGPU10_INTERPOLATION_LINEAR_SAMPLE; + } else { + return VGPU10_INTERPOLATION_LINEAR; + } + break; default: assert(!"Unexpected interpolation mode"); return VGPU10_INTERPOLATION_CONSTANT; @@ -2192,7 +2204,9 @@ emit_input_declaration(struct svga_shader_emitter_v10 *emit, interpMode == VGPU10_INTERPOLATION_LINEAR || interpMode == VGPU10_INTERPOLATION_LINEAR_CENTROID || interpMode == VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE || - interpMode == VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID); + interpMode == VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID || + interpMode == VGPU10_INTERPOLATION_LINEAR_SAMPLE || + interpMode == VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE); check_register_index(emit, opcodeType, index); |