diff options
author | Yuanhan Liu <yuanhan.liu@linux.intel.com> | 2012-02-27 15:46:32 +0800 |
---|---|---|
committer | Yuanhan Liu <yuanhan.liu@linux.intel.com> | 2012-03-07 13:30:01 +0800 |
commit | 43af02ac731dac7d80f7e47feb0c80e4da156769 (patch) | |
tree | 36e5900c29ab63e9b7fee750858cb287b093e300 /src/mesa/drivers/dri/i965/brw_sf.h | |
parent | cf2f9ef015c312ecaa6656519602ae535f7ce9d7 (diff) | |
download | external_mesa3d-43af02ac731dac7d80f7e47feb0c80e4da156769.zip external_mesa3d-43af02ac731dac7d80f7e47feb0c80e4da156769.tar.gz external_mesa3d-43af02ac731dac7d80f7e47feb0c80e4da156769.tar.bz2 |
i965: handle gl_PointCoord for Gen4 and Gen5 platforms
This patch add the support of gl_PointCoord gl builtin variable for
platform gen4 and gen5(ILK).
Unlike gen6+, we don't have a hardware support of gl_PointCoord, means
hardware will not calculate the interpolation coefficient for you.
Instead, you should handle it yourself in sf shader stage.
But badly, gl_PointCoord is a FS instead of VS builtin variable, thus
it's not included in c.vue_map generated in VS stage. Thus the current
code doesn't aware of this attribute. And to handle it correctly, we
need add it to c.vue_map manually to let SF shader generate the needed
interpolation coefficient for FS shader. SF stage has it's own copy of
vue_map, thus I think it's safe to do it manually.
Since handling gl_PointCoord for gen4 and gen5 platforms is somehow a
little special, I added a lot of comments and hope I didn't overdo it ;)
v2: add a /* _NEW_BUFFERS */ comment to note the state flag dependency
and also add the _NEW_BUFFERS dirty mask (Eric).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45975
Piglit: glsl-fs-pointcoord and fbo-gl_pointcoord
NOTE: This is a candidate for stable release branches.
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sf.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_sf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h index 4ef0240..f908fc0 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.h +++ b/src/mesa/drivers/dri/i965/brw_sf.h @@ -52,6 +52,7 @@ struct brw_sf_prog_key { GLuint do_flat_shading:1; GLuint frontface_ccw:1; GLuint do_point_sprite:1; + GLuint do_point_coord:1; GLuint sprite_origin_lower_left:1; GLuint userclip_active:1; }; |