diff options
author | Maciej Cencora <[email protected]> | 2009-07-11 15:53:01 +0200 |
---|---|---|
committer | Maciej Cencora <[email protected]> | 2009-07-13 19:28:13 +0200 |
commit | 48cc352a71c728e0ce092dd7d7ec0945db304907 (patch) | |
tree | a94a8d2da5576d9eeeca9f734a3813790ce49f18 /src | |
parent | 4eff323731b0d65e1f2817e96435807418d833cc (diff) |
r300: fix StrideB == 0 case when converting data format
Reported-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_draw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index 5420293b919..9769ff53994 100644 --- a/src/mesa/drivers/dri/r300/r300_draw.c +++ b/src/mesa/drivers/dri/r300/r300_draw.c @@ -195,6 +195,11 @@ static void r300TranslateAttrib(GLcontext *ctx, GLuint attr, int count, const st } GLfloat *dst_ptr, *tmp; + + /* Convert value for first element only */ + if (input->StrideB == 0) + count = 1; + tmp = dst_ptr = _mesa_malloc(sizeof(GLfloat) * input->Size * count); switch (input->Type) { @@ -228,7 +233,11 @@ static void r300TranslateAttrib(GLcontext *ctx, GLuint attr, int count, const st type = GL_FLOAT; r300_attr.free_needed = GL_TRUE; r300_attr.data = tmp; - r300_attr.stride = sizeof(GLfloat) * input->Size; + if (input->StrideB == 0) { + r300_attr.stride = 0; + } else { + r300_attr.stride = sizeof(GLfloat) * input->Size; + } r300_attr.dwords = input->Size; } else { type = input->Type; |