i965: Use sample barycentric coordinates with per sample shading
Current implementation of arb_sample_shading doesn't set 'Barycentric Interpolation Mode' correctly. We use pixel barycentric coordinates for per sample shading. Instead we should select perspective sample or non-perspective sample barycentric coordinates. It also enables using sample barycentric coordinates in case of a fragment shader variable declared with 'sample' qualifier. e.g. sample in vec4 pos; A piglit test to verify the implementation has been posted on piglit mailing list for review. V2: Do not interpolate all the 'in' variables at sample position if fragment shader uses 'sample' qualifier with one of them. For example we have a fragment shader: #version 330 #extension ARB_gpu_shader5: require sample in vec4 a; in vec4 b; main() { ... } Only 'a' should be sampled at sample location, not 'b'. Signed-off-by:Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by:
Chris Forbes <chrisf@ijw.co.nz> (cherry picked from commit a92e5f7c)
Showing
- src/mesa/drivers/dri/i965/brw_fs.cpp 11 additions, 3 deletionssrc/mesa/drivers/dri/i965/brw_fs.cpp
- src/mesa/drivers/dri/i965/brw_fs.h 1 addition, 1 deletionsrc/mesa/drivers/dri/i965/brw_fs.h
- src/mesa/drivers/dri/i965/brw_wm.c 16 additions, 2 deletionssrc/mesa/drivers/dri/i965/brw_wm.c
- src/mesa/drivers/dri/i965/brw_wm.h 1 addition, 0 deletionssrc/mesa/drivers/dri/i965/brw_wm.h
Loading
Please register or sign in to comment