summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2008-03-19 16:29:47 +0800
committerZou Nan hai <nanhai.zou@intel.com>2008-03-19 16:29:47 +0800
commitc62f504eb6030097b679233a75f87cca1b0e617d (patch)
treeb915eff368216762ab9a4d4a02e39db6c5ef501b /src/mesa/drivers
parentb790b24ff9204eb6f305b14bd40bb903e65dd541 (diff)
[i915] fix fragment.position
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index 29f0b51ba6..bbb4e0f3cd 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -311,10 +311,18 @@ intel_wpos_triangle(struct intel_context *intel,
{
GLuint offset = intel->wpos_offset;
GLuint size = intel->wpos_size;
+ GLfloat *v0_wpos = (GLfloat *)((char *)v0 + offset);
+ GLfloat *v1_wpos = (GLfloat *)((char *)v1 + offset);
+ GLfloat *v2_wpos = (GLfloat *)((char *)v2 + offset);
+
+ __memcpy(v0_wpos, v0, size);
+ __memcpy(v1_wpos, v1, size);
+ __memcpy(v2_wpos, v2, size);
+
+ v0_wpos[1] = -v0_wpos[1] + intel->driDrawable->h;
+ v1_wpos[1] = -v1_wpos[1] + intel->driDrawable->h;
+ v2_wpos[1] = -v2_wpos[1] + intel->driDrawable->h;
- __memcpy(((char *) v0) + offset, v0, size);
- __memcpy(((char *) v1) + offset, v1, size);
- __memcpy(((char *) v2) + offset, v2, size);
intel_draw_triangle(intel, v0, v1, v2);
}
@@ -326,9 +334,14 @@ intel_wpos_line(struct intel_context *intel,
{
GLuint offset = intel->wpos_offset;
GLuint size = intel->wpos_size;
+ GLfloat *v0_wpos = (GLfloat *)((char *)v0 + offset);
+ GLfloat *v1_wpos = (GLfloat *)((char *)v1 + offset);
+
+ __memcpy(v0_wpos, v0, size);
+ __memcpy(v1_wpos, v1, size);
- __memcpy(((char *) v0) + offset, v0, size);
- __memcpy(((char *) v1) + offset, v1, size);
+ v0_wpos[1] = -v0_wpos[1] + intel->driDrawable->h;
+ v1_wpos[1] = -v1_wpos[1] + intel->driDrawable->h;
intel_draw_line(intel, v0, v1);
}
@@ -339,8 +352,10 @@ intel_wpos_point(struct intel_context *intel, intelVertexPtr v0)
{
GLuint offset = intel->wpos_offset;
GLuint size = intel->wpos_size;
+ GLfloat *v0_wpos = (GLfloat *)((char *)v0 + offset);
- __memcpy(((char *) v0) + offset, v0, size);
+ __memcpy(v0_wpos, v0, size);
+ v0_wpos[1] = -v0_wpos[1] + intel->driDrawable->h;
intel_draw_point(intel, v0);
}