Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa

regenerated lex.yy.c
This commit is contained in:
Alex Deucher
2009-10-19 12:10:59 -04:00
11 changed files with 251 additions and 231 deletions

View File

@@ -44,6 +44,7 @@ tbd
<li>r300: Work around an issue with very large fragment programs on R500. <li>r300: Work around an issue with very large fragment programs on R500.
<li>Fake glXQueryDrawable() didn't return good values (bug 24320) <li>Fake glXQueryDrawable() didn't return good values (bug 24320)
<li>Fixed AUX buffer breakage (bug 24426). <li>Fixed AUX buffer breakage (bug 24426).
<li>Fixed locale-dependent float parsing bug in GLSL compiler (bug 24531)
</ul> </ul>
</body> </body>

View File

@@ -225,10 +225,10 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t)
if (t->image_override && t->bo) if (t->image_override && t->bo)
return; return;
t->pp_txsize = (((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT) t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT)))
| ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT) | ((R300_TX_HEIGHTMASK_MASK & ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)))
| ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT) | ((R300_TX_DEPTHMASK_MASK & ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT)))
| ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT)); | ((R300_TX_MAX_MIP_LEVEL_MASK & ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT))));
t->tile_bits = 0; t->tile_bits = 0;
@@ -248,8 +248,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t)
if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
if (firstImage->Width > 2048) if (firstImage->Width > 2048)
t->pp_txpitch |= R500_TXWIDTH_BIT11; t->pp_txpitch |= R500_TXWIDTH_BIT11;
else
t->pp_txpitch &= ~R500_TXWIDTH_BIT11;
if (firstImage->Height > 2048) if (firstImage->Height > 2048)
t->pp_txpitch |= R500_TXHEIGHT_BIT11; t->pp_txpitch |= R500_TXHEIGHT_BIT11;
else
t->pp_txpitch &= ~R500_TXHEIGHT_BIT11;
} }
} }
@@ -479,16 +483,20 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
break; break;
} }
pitch_val--; pitch_val--;
t->pp_txsize = ((rb->base.Width - 1) << R300_TX_WIDTHMASK_SHIFT) | t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((rb->base.Width - 1) << R300_TX_WIDTHMASK_SHIFT)))
((rb->base.Height - 1) << R300_TX_HEIGHTMASK_SHIFT); | ((R300_TX_HEIGHTMASK_MASK & ((rb->base.Height - 1) << R300_TX_HEIGHTMASK_SHIFT))));
t->pp_txsize |= R300_TX_SIZE_TXPITCH_EN; t->pp_txsize |= R300_TX_SIZE_TXPITCH_EN;
t->pp_txpitch |= pitch_val; t->pp_txpitch |= pitch_val;
if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
if (rb->base.Width > 2048) if (rb->base.Width > 2048)
t->pp_txpitch |= R500_TXWIDTH_BIT11; t->pp_txpitch |= R500_TXWIDTH_BIT11;
else
t->pp_txpitch &= ~R500_TXWIDTH_BIT11;
if (rb->base.Height > 2048) if (rb->base.Height > 2048)
t->pp_txpitch |= R500_TXHEIGHT_BIT11; t->pp_txpitch |= R500_TXHEIGHT_BIT11;
else
t->pp_txpitch &= ~R500_TXHEIGHT_BIT11;
} }
t->validated = GL_TRUE; t->validated = GL_TRUE;
_mesa_unlock_texture(radeon->glCtx, texObj); _mesa_unlock_texture(radeon->glCtx, texObj);

View File

@@ -62,12 +62,6 @@ static int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_progra
} }
} }
if (vp->code.constants.Count * 4 > VSF_MAX_FRAGMENT_LENGTH) {
/* Should have checked this earlier... */
fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__);
_mesa_exit(-1);
}
for(i = 0; i < vp->code.constants.Count; ++i) { for(i = 0; i < vp->code.constants.Count; ++i) {
const float * src = 0; const float * src = 0;
const struct rc_constant * constant = &vp->code.constants.Constants[i]; const struct rc_constant * constant = &vp->code.constants.Constants[i];
@@ -281,6 +275,11 @@ static struct r300_vertex_program *build_program(GLcontext *ctx,
} }
r3xx_compile_vertex_program(&compiler); r3xx_compile_vertex_program(&compiler);
if (vp->code.constants.Count > ctx->Const.VertexProgram.MaxParameters) {
rc_error(&compiler.Base, "Program exceeds constant buffer size limit\n");
}
vp->error = compiler.Base.Error; vp->error = compiler.Base.Error;
vp->Base->Base.InputsRead = vp->code.InputsRead; vp->Base->Base.InputsRead = vp->code.InputsRead;
@@ -334,7 +333,6 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx)
#define bump_vpu_count(ptr, new_count) do { \ #define bump_vpu_count(ptr, new_count) do { \
drm_r300_cmd_header_t* _p=((drm_r300_cmd_header_t*)(ptr)); \ drm_r300_cmd_header_t* _p=((drm_r300_cmd_header_t*)(ptr)); \
int _nc=(new_count)/4; \ int _nc=(new_count)/4; \
assert(_nc < 256); \
if(_nc>_p->vpu.count)_p->vpu.count=_nc; \ if(_nc>_p->vpu.count)_p->vpu.count=_nc; \
} while(0) } while(0)

View File

@@ -254,7 +254,7 @@ static int r600_cs_process_relocs(struct radeon_cs *cs,
relocs = (struct r600_cs_reloc_legacy *)cs->relocs; relocs = (struct r600_cs_reloc_legacy *)cs->relocs;
restart: restart:
for (i = 0; i < cs->crelocs; i++) { for (i = 0; i < cs->crelocs; i++) {
uint32_t soffset, eoffset, asicoffset; uint32_t soffset, eoffset;
r = radeon_bo_legacy_validate(relocs[i].base.bo, r = radeon_bo_legacy_validate(relocs[i].base.bo,
&soffset, &eoffset); &soffset, &eoffset);
@@ -262,24 +262,12 @@ restart:
goto restart; goto restart;
} }
if (r) { if (r) {
fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n", fprintf(stderr, "invalid bo(%p) [0x%08X, 0x%08X]\n",
relocs[i].base.bo, soffset, eoffset); relocs[i].base.bo, soffset, eoffset);
return r; return r;
} }
asicoffset = soffset;
for (j = 0; j < relocs[i].cindices; j++) { for (j = 0; j < relocs[i].cindices; j++) {
if (asicoffset >= eoffset) {
/* radeon_bo_debug(relocs[i].base.bo, 12); */
fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n",
relocs[i].base.bo, soffset, eoffset);
fprintf(stderr, "above end: %p 0x%08X 0x%08X\n",
relocs[i].base.bo,
cs->packets[relocs[i].indices[j]],
eoffset);
exit(0);
return -EINVAL;
}
/* pkt3 nop header in ib chunk */ /* pkt3 nop header in ib chunk */
cs->packets[relocs[i].reloc_indices[j]] = 0xC0001000; cs->packets[relocs[i].reloc_indices[j]] = 0xC0001000;
/* reloc index in ib chunk */ /* reloc index in ib chunk */
@@ -287,7 +275,7 @@ restart:
} }
/* asic offset in reloc chunk */ /* see alex drm r600_nomm_relocate */ /* asic offset in reloc chunk */ /* see alex drm r600_nomm_relocate */
reloc_chunk[offset_dw] = asicoffset; reloc_chunk[offset_dw] = soffset;
reloc_chunk[offset_dw + 3] = 0; reloc_chunk[offset_dw + 3] = 0;
offset_dw += 4; offset_dw += 4;

View File

@@ -764,7 +764,9 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
struct gl_texture_object *tObj = struct gl_texture_object *tObj =
_mesa_lookup_texture(rmesa->radeon.glCtx, texname); _mesa_lookup_texture(rmesa->radeon.glCtx, texname);
radeonTexObjPtr t = radeon_tex_obj(tObj); radeonTexObjPtr t = radeon_tex_obj(tObj);
uint32_t pitch_val, size; int firstlevel = t->mt ? t->mt->firstLevel : 0;
const struct gl_texture_image *firstImage;
uint32_t pitch_val, size, row_align, bpp;
if (!tObj) if (!tObj)
return; return;
@@ -774,7 +776,13 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname,
if (!offset) if (!offset)
return; return;
size = pitch;//h * w * (depth / 8); bpp = depth / 8;
if (bpp == 3)
bpp = 4;
firstImage = t->base.Image[0][firstlevel];
row_align = rmesa->radeon.texture_row_align - 1;
size = ((firstImage->Width * bpp + row_align) & ~row_align) * firstImage->Height;
if (t->bo) { if (t->bo) {
radeon_bo_unref(t->bo); radeon_bo_unref(t->bo);
t->bo = NULL; t->bo = NULL;

View File

@@ -1307,8 +1307,10 @@ GLboolean tex_src(r700_AssemblerBase *pAsm)
case PROGRAM_INPUT: case PROGRAM_INPUT:
switch (pILInst->SrcReg[0].Index) switch (pILInst->SrcReg[0].Index)
{ {
case FRAG_ATTRIB_WPOS:
case FRAG_ATTRIB_COL0: case FRAG_ATTRIB_COL0:
case FRAG_ATTRIB_COL1: case FRAG_ATTRIB_COL1:
case FRAG_ATTRIB_FOGC:
case FRAG_ATTRIB_TEX0: case FRAG_ATTRIB_TEX0:
case FRAG_ATTRIB_TEX1: case FRAG_ATTRIB_TEX1:
case FRAG_ATTRIB_TEX2: case FRAG_ATTRIB_TEX2:
@@ -1322,6 +1324,15 @@ GLboolean tex_src(r700_AssemblerBase *pAsm)
pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index];
pAsm->S[0].src.rtype = SRC_REG_INPUT; pAsm->S[0].src.rtype = SRC_REG_INPUT;
break; break;
case FRAG_ATTRIB_FACE:
fprintf(stderr, "FRAG_ATTRIB_FACE unsupported\n");
break;
case FRAG_ATTRIB_PNTC:
fprintf(stderr, "FRAG_ATTRIB_PNTC unsupported\n");
break;
case FRAG_ATTRIB_VAR0:
fprintf(stderr, "FRAG_ATTRIB_VAR0 unsupported\n");
break;
} }
break; break;
} }

View File

@@ -710,6 +710,10 @@ int radeon_bo_legacy_validate(struct radeon_bo *bo,
bo, bo->size, bo_legacy->map_count); bo, bo->size, bo_legacy->map_count);
return -EINVAL; return -EINVAL;
} }
if(bo->size == 0) {
fprintf(stderr, "bo(%p) has size 0.\n", bo);
return -EINVAL;
}
if (bo_legacy->static_bo || bo_legacy->validated) { if (bo_legacy->static_bo || bo_legacy->validated) {
*soffset = bo_legacy->offset; *soffset = bo_legacy->offset;
*eoffset = bo_legacy->offset + bo->size; *eoffset = bo_legacy->offset + bo->size;

View File

@@ -445,7 +445,6 @@ restart:
goto restart; goto restart;
} }
rrb->pitch = texImage->Width * rrb->cpp;
rrb->base.InternalFormat = rrb->base._ActualFormat; rrb->base.InternalFormat = rrb->base._ActualFormat;
rrb->base.Width = texImage->Width; rrb->base.Width = texImage->Width;
rrb->base.Height = texImage->Height; rrb->base.Height = texImage->Height;
@@ -555,8 +554,10 @@ radeon_render_texture(GLcontext * ctx,
imageOffset += offsets[att->Zoffset]; imageOffset += offsets[att->Zoffset];
} }
/* store that offset in the region */ /* store that offset in the region, along with the correct pitch for
* the image we are rendering to */
rrb->draw_offset = imageOffset; rrb->draw_offset = imageOffset;
rrb->pitch = radeon_image->mt->levels[att->TextureLevel].rowstride;
/* update drawing region, etc */ /* update drawing region, etc */
radeon_draw_buffer(ctx, fb); radeon_draw_buffer(ctx, fb);

View File

@@ -48,6 +48,10 @@
#include "context.h" #include "context.h"
#include "version.h" #include "version.h"
#ifdef _GNU_SOURCE
#include <locale.h>
#endif
#define MAXSTRING 4000 /* for vsnprintf() */ #define MAXSTRING 4000 /* for vsnprintf() */
@@ -908,7 +912,15 @@ _mesa_atoi(const char *s)
double double
_mesa_strtod( const char *s, char **end ) _mesa_strtod( const char *s, char **end )
{ {
#ifdef _GNU_SOURCE
static locale_t loc = NULL;
if (!loc) {
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
}
return strtod_l(s, end, loc);
#else
return strtod(s, end); return strtod(s, end);
#endif
} }
/** Compute simple checksum/hash for a string */ /** Compute simple checksum/hash for a string */

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,7 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include "main/glheader.h" #include "main/glheader.h"
#include "main/imports.h"
#include "prog_instruction.h" #include "prog_instruction.h"
#include "prog_statevars.h" #include "prog_statevars.h"
@@ -323,19 +324,19 @@ ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require
return INTEGER; return INTEGER;
} }
{num}?{frac}{exp}? { {num}?{frac}{exp}? {
yylval->real = strtod(yytext, NULL); yylval->real = _mesa_strtod(yytext, NULL);
return REAL; return REAL;
} }
{num}"."/[^.] { {num}"."/[^.] {
yylval->real = strtod(yytext, NULL); yylval->real = _mesa_strtod(yytext, NULL);
return REAL; return REAL;
} }
{num}{exp} { {num}{exp} {
yylval->real = strtod(yytext, NULL); yylval->real = _mesa_strtod(yytext, NULL);
return REAL; return REAL;
} }
{num}"."{exp} { {num}"."{exp} {
yylval->real = strtod(yytext, NULL); yylval->real = _mesa_strtod(yytext, NULL);
return REAL; return REAL;
} }