Compare commits
32 Commits
bisect-tem
...
mesa-10.6.
Author | SHA1 | Date | |
---|---|---|---|
|
ffd133bdbe | ||
|
77b116f1d3 | ||
|
1eef92e336 | ||
|
317fa3e7ef | ||
|
580351d3d3 | ||
|
534f5e8d80 | ||
|
74e2db8a92 | ||
|
c288bf3b89 | ||
|
18e05588df | ||
|
407e20d45d | ||
|
5eef18390d | ||
|
34ff020aea | ||
|
8fc109160e | ||
|
cb0c057a31 | ||
|
60294f8c39 | ||
|
6319fd51fe | ||
|
08baacb6db | ||
|
c23bbfc007 | ||
|
aa326e4e22 | ||
|
1595955974 | ||
|
a760db21ec | ||
|
2cf0e748c3 | ||
|
564c56de12 | ||
|
45986bd391 | ||
|
90644f9217 | ||
|
61c6819d1a | ||
|
bf33fc653d | ||
|
e4f74121db | ||
|
62fda88080 | ||
|
4c83138e5f | ||
|
f02f25dcf7 | ||
|
7c5cca5ee2 |
@@ -649,6 +649,7 @@ if test "x$enable_asm" = xyes; then
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
|
||||
AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
|
||||
AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
|
||||
|
||||
dnl Check to see if dlopen is in default libraries (like Solaris, which
|
||||
|
@@ -300,6 +300,8 @@ void cso_destroy_context( struct cso_context *ctx )
|
||||
unsigned i, shader;
|
||||
|
||||
if (ctx->pipe) {
|
||||
ctx->pipe->set_index_buffer(ctx->pipe, NULL);
|
||||
|
||||
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
|
||||
ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
|
||||
|
||||
@@ -326,13 +328,18 @@ void cso_destroy_context( struct cso_context *ctx )
|
||||
|
||||
ctx->pipe->bind_depth_stencil_alpha_state( ctx->pipe, NULL );
|
||||
ctx->pipe->bind_fs_state( ctx->pipe, NULL );
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_FRAGMENT, 0, NULL);
|
||||
ctx->pipe->bind_vs_state( ctx->pipe, NULL );
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_VERTEX, 0, NULL);
|
||||
if (ctx->has_geometry_shader) {
|
||||
ctx->pipe->bind_gs_state(ctx->pipe, NULL);
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_GEOMETRY, 0, NULL);
|
||||
}
|
||||
if (ctx->has_tessellation) {
|
||||
ctx->pipe->bind_tcs_state(ctx->pipe, NULL);
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_TESS_CTRL, 0, NULL);
|
||||
ctx->pipe->bind_tes_state(ctx->pipe, NULL);
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_TESS_EVAL, 0, NULL);
|
||||
}
|
||||
ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL );
|
||||
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "pipe/p_compiler.h"
|
||||
|
||||
#include "c99_math.h"
|
||||
#include <assert.h>
|
||||
#include <float.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@@ -413,12 +413,15 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit,
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Figure out if there's a way to make it spit out 0's and
|
||||
* 1's for the .z and .w components.
|
||||
/* Replace the .xy coordinates with S/T from the point sprite. Set
|
||||
* interpolation bits for .zw such that they become .01
|
||||
*/
|
||||
if (emit->sprite_coord_enable & (1 << sem2idx(fp->inputs[j].semantic)))
|
||||
if (emit->sprite_coord_enable & (1 << sem2idx(fp->inputs[j].semantic))) {
|
||||
vpsrepl[inloc / 16] |= (emit->sprite_coord_mode ? 0x0d : 0x09)
|
||||
<< ((inloc % 16) * 2);
|
||||
vinterp[(inloc + 2) / 16] |= 2 << (((inloc + 2) % 16) * 2);
|
||||
vinterp[(inloc + 3) / 16] |= 3 << (((inloc + 3) % 16) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
OUT_PKT0(ring, REG_A3XX_VPC_ATTR, 2);
|
||||
|
@@ -1615,7 +1615,7 @@ trans_samp(const struct instr_translater *t,
|
||||
instr->cat1.src_type = type_mov;
|
||||
instr->cat1.dst_type = type_mov;
|
||||
add_dst_reg(ctx, instr, &tmp_dst, i);
|
||||
add_src_reg(ctx, instr, &zero, 0);
|
||||
add_src_reg(ctx, instr, &zero, zero.SwizzleX);
|
||||
i++;
|
||||
}
|
||||
if (tgt->array) {
|
||||
@@ -1669,15 +1669,18 @@ trans_samp(const struct instr_translater *t,
|
||||
*/
|
||||
if (inst->Instruction.Opcode == TGSI_OPCODE_TXD) {
|
||||
while (collect->regs_count < 5)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA), &zero, 0);
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
|
||||
&zero, zero.SwizzleX);
|
||||
for (i = 0; i < tgt->dims; i++)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA), dpdx, i);
|
||||
if (tgt->dims < 2)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA), &zero, 0);
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
|
||||
&zero, zero.SwizzleX);
|
||||
for (i = 0; i < tgt->dims; i++)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA), dpdy, i);
|
||||
if (tgt->dims < 2)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA), &zero, 0);
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
|
||||
&zero, zero.SwizzleX);
|
||||
tinf.src_wrmask |= ((1 << (2 * MAX2(tgt->dims, 2))) - 1) << 4;
|
||||
}
|
||||
|
||||
@@ -1700,7 +1703,8 @@ trans_samp(const struct instr_translater *t,
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
|
||||
offset, i);
|
||||
if (tgt->dims < 2)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA), &zero, 0);
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
|
||||
&zero, zero.SwizzleX);
|
||||
}
|
||||
if (inst->Instruction.Opcode == TGSI_OPCODE_TXB2)
|
||||
ssa_src(ctx, ir3_reg_create(collect, 0, IR3_REG_SSA),
|
||||
|
@@ -315,7 +315,7 @@ llvmpipe_check_render_cond(struct llvmpipe_context *lp)
|
||||
|
||||
b = pipe->get_query_result(pipe, lp->render_cond_query, wait, (void*)&result);
|
||||
if (b)
|
||||
return (!result == lp->render_cond_cond);
|
||||
return ((!result) == lp->render_cond_cond);
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -1356,18 +1356,20 @@ Converter::srcToSym(tgsi::Instruction::SrcRegister src, int c)
|
||||
{
|
||||
const int swz = src.getSwizzle(c);
|
||||
|
||||
/* TODO: Use Array ID when it's available for the index */
|
||||
return makeSym(src.getFile(),
|
||||
src.is2D() ? src.getIndex(1) : 0,
|
||||
src.isIndirect(0) ? -1 : src.getIndex(0), swz,
|
||||
src.getIndex(0), swz,
|
||||
src.getIndex(0) * 16 + swz * 4);
|
||||
}
|
||||
|
||||
Symbol *
|
||||
Converter::dstToSym(tgsi::Instruction::DstRegister dst, int c)
|
||||
{
|
||||
/* TODO: Use Array ID when it's available for the index */
|
||||
return makeSym(dst.getFile(),
|
||||
dst.is2D() ? dst.getIndex(1) : 0,
|
||||
dst.isIndirect(0) ? -1 : dst.getIndex(0), c,
|
||||
dst.getIndex(0), c,
|
||||
dst.getIndex(0) * 16 + c * 4);
|
||||
}
|
||||
|
||||
|
@@ -240,6 +240,7 @@ GM107LoweringPass::visit(Instruction *i)
|
||||
Value *ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
|
||||
i->getIndirect(0, 0), bld.mkImm(4));
|
||||
i->setIndirect(0, 0, ptr);
|
||||
i->op = OP_VFETCH;
|
||||
} else {
|
||||
i->op = OP_VFETCH;
|
||||
assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
|
||||
|
@@ -100,8 +100,7 @@ void
|
||||
NVC0LegalizeSSA::handleFTZ(Instruction *i)
|
||||
{
|
||||
// Only want to flush float inputs
|
||||
if (i->sType != TYPE_F32)
|
||||
return;
|
||||
assert(i->sType == TYPE_F32);
|
||||
|
||||
// If we're already flushing denorms (and NaN's) to zero, no need for this.
|
||||
if (i->dnz)
|
||||
@@ -129,7 +128,7 @@ NVC0LegalizeSSA::visit(BasicBlock *bb)
|
||||
Instruction *next;
|
||||
for (Instruction *i = bb->getEntry(); i; i = next) {
|
||||
next = i->next;
|
||||
if (i->dType == TYPE_F32) {
|
||||
if (i->sType == TYPE_F32) {
|
||||
if (prog->getType() != Program::TYPE_COMPUTE)
|
||||
handleFTZ(i);
|
||||
continue;
|
||||
@@ -1751,6 +1750,7 @@ NVC0LoweringPass::visit(Instruction *i)
|
||||
Value *ptr = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(),
|
||||
i->getIndirect(0, 0), bld.mkImm(4));
|
||||
i->setIndirect(0, 0, ptr);
|
||||
i->op = OP_VFETCH;
|
||||
} else {
|
||||
i->op = OP_VFETCH;
|
||||
assert(prog->getType() != Program::TYPE_FRAGMENT); // INTERP
|
||||
|
@@ -236,6 +236,9 @@ LoadPropagation::visit(BasicBlock *bb)
|
||||
if (i->op == OP_CALL) // calls have args as sources, they must be in regs
|
||||
continue;
|
||||
|
||||
if (i->op == OP_PFETCH) // pfetch expects arg1 to be a reg
|
||||
continue;
|
||||
|
||||
if (i->srcExists(1))
|
||||
checkSwapSrc01(i);
|
||||
|
||||
@@ -574,6 +577,11 @@ ConstantFolding::expr(Instruction *i,
|
||||
case OP_POPCNT:
|
||||
res.data.u32 = util_bitcount(a->data.u32 & b->data.u32);
|
||||
break;
|
||||
case OP_PFETCH:
|
||||
// The two arguments to pfetch are logically added together. Normally
|
||||
// the second argument will not be constant, but that can happen.
|
||||
res.data.u32 = a->data.u32 + b->data.u32;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -588,7 +596,9 @@ ConstantFolding::expr(Instruction *i,
|
||||
|
||||
i->getSrc(0)->reg.data = res.data;
|
||||
|
||||
if (i->op == OP_MAD || i->op == OP_FMA) {
|
||||
switch (i->op) {
|
||||
case OP_MAD:
|
||||
case OP_FMA: {
|
||||
i->op = OP_ADD;
|
||||
|
||||
i->setSrc(1, i->getSrc(0));
|
||||
@@ -603,8 +613,14 @@ ConstantFolding::expr(Instruction *i,
|
||||
bld.setPosition(i, false);
|
||||
i->setSrc(1, bld.loadImm(NULL, res.data.u32));
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
case OP_PFETCH:
|
||||
// Leave PFETCH alone... we just folded its 2 args into 1.
|
||||
break;
|
||||
default:
|
||||
i->op = i->saturate ? OP_SAT : OP_MOV; /* SAT handled by unary() */
|
||||
break;
|
||||
}
|
||||
i->subOp = 0;
|
||||
}
|
||||
|
@@ -71,12 +71,12 @@ nv30_render_allocate_vertices(struct vbuf_render *render,
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
struct nv30_context *nv30 = r->nv30;
|
||||
|
||||
r->length = vertex_size * nr_vertices;
|
||||
r->length = (uint32_t)vertex_size * (uint32_t)nr_vertices;
|
||||
|
||||
if (r->offset + r->length >= render->max_vertex_buffer_bytes) {
|
||||
pipe_resource_reference(&r->buffer, NULL);
|
||||
r->buffer = pipe_buffer_create(&nv30->screen->base.base,
|
||||
PIPE_BIND_VERTEX_BUFFER, 0,
|
||||
PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_STREAM,
|
||||
render->max_vertex_buffer_bytes);
|
||||
if (!r->buffer)
|
||||
return FALSE;
|
||||
@@ -91,10 +91,14 @@ static void *
|
||||
nv30_render_map_vertices(struct vbuf_render *render)
|
||||
{
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
char *map = pipe_buffer_map(&r->nv30->base.pipe, r->buffer,
|
||||
PIPE_TRANSFER_WRITE |
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED, &r->transfer);
|
||||
return map + r->offset;
|
||||
char *map = pipe_buffer_map_range(
|
||||
&r->nv30->base.pipe, r->buffer,
|
||||
r->offset, r->length,
|
||||
PIPE_TRANSFER_WRITE |
|
||||
PIPE_TRANSFER_DISCARD_RANGE,
|
||||
&r->transfer);
|
||||
assert(map);
|
||||
return map;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -103,6 +107,7 @@ nv30_render_unmap_vertices(struct vbuf_render *render,
|
||||
{
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer);
|
||||
r->transfer = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -126,7 +131,7 @@ nv30_render_draw_elements(struct vbuf_render *render,
|
||||
for (i = 0; i < r->vertex_info.num_attribs; i++) {
|
||||
PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
|
||||
nv04_resource(r->buffer), r->offset + r->vtxptr[i],
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, 0);
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
|
||||
}
|
||||
|
||||
if (!nv30_state_validate(nv30, FALSE))
|
||||
@@ -171,7 +176,7 @@ nv30_render_draw_arrays(struct vbuf_render *render, unsigned start, uint nr)
|
||||
for (i = 0; i < r->vertex_info.num_attribs; i++) {
|
||||
PUSH_RESRC(push, NV30_3D(VTXBUF(i)), BUFCTX_VTXTMP,
|
||||
nv04_resource(r->buffer), r->offset + r->vtxptr[i],
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, 0);
|
||||
NOUVEAU_BO_LOW | NOUVEAU_BO_RD, 0, NV30_3D_VTXBUF_DMA1);
|
||||
}
|
||||
|
||||
if (!nv30_state_validate(nv30, FALSE))
|
||||
@@ -213,22 +218,24 @@ static const struct {
|
||||
[TGSI_SEMANTIC_BCOLOR ] = { EMIT_4F, INTERP_LINEAR , 1, 3, 0x00000004 },
|
||||
[TGSI_SEMANTIC_FOG ] = { EMIT_4F, INTERP_PERSPECTIVE, 5, 5, 0x00000010 },
|
||||
[TGSI_SEMANTIC_PSIZE ] = { EMIT_1F_PSIZE, INTERP_POS , 6, 6, 0x00000020 },
|
||||
[TGSI_SEMANTIC_GENERIC ] = { EMIT_4F, INTERP_PERSPECTIVE, 8, 7, 0x00004000 }
|
||||
[TGSI_SEMANTIC_TEXCOORD] = { EMIT_4F, INTERP_PERSPECTIVE, 8, 7, 0x00004000 },
|
||||
};
|
||||
|
||||
static boolean
|
||||
vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
|
||||
{
|
||||
struct pipe_screen *pscreen = &r->nv30->screen->base.base;
|
||||
struct nv30_screen *screen = r->nv30->screen;
|
||||
struct nv30_fragprog *fp = r->nv30->fragprog.program;
|
||||
struct vertex_info *vinfo = &r->vertex_info;
|
||||
enum pipe_format format;
|
||||
uint emit = EMIT_OMIT;
|
||||
uint result = *idx;
|
||||
|
||||
if (sem == TGSI_SEMANTIC_GENERIC && result >= 8) {
|
||||
for (result = 0; result < 8; result++) {
|
||||
if (fp->texcoord[result] == *idx) {
|
||||
if (sem == TGSI_SEMANTIC_GENERIC) {
|
||||
uint num_texcoords = (screen->eng3d->oclass < NV40_3D_CLASS) ? 8 : 10;
|
||||
for (result = 0; result < num_texcoords; result++) {
|
||||
if (fp->texcoord[result] == *idx + 8) {
|
||||
sem = TGSI_SEMANTIC_TEXCOORD;
|
||||
emit = vroute[sem].emit;
|
||||
break;
|
||||
}
|
||||
@@ -243,11 +250,11 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
|
||||
draw_emit_vertex_attr(vinfo, emit, vroute[sem].interp, attrib);
|
||||
format = draw_translate_vinfo_format(emit);
|
||||
|
||||
r->vtxfmt[attrib] = nv30_vtxfmt(pscreen, format)->hw;
|
||||
r->vtxptr[attrib] = vinfo->size | NV30_3D_VTXBUF_DMA1;
|
||||
r->vtxfmt[attrib] = nv30_vtxfmt(&screen->base.base, format)->hw;
|
||||
r->vtxptr[attrib] = vinfo->size;
|
||||
vinfo->size += draw_translate_vinfo_size(emit);
|
||||
|
||||
if (nv30_screen(pscreen)->eng3d->oclass < NV40_3D_CLASS) {
|
||||
if (screen->eng3d->oclass < NV40_3D_CLASS) {
|
||||
r->vtxprog[attrib][0] = 0x001f38d8;
|
||||
r->vtxprog[attrib][1] = 0x0080001b | (attrib << 9);
|
||||
r->vtxprog[attrib][2] = 0x0836106c;
|
||||
@@ -259,7 +266,12 @@ vroute_add(struct nv30_render *r, uint attrib, uint sem, uint *idx)
|
||||
r->vtxprog[attrib][3] = 0x6041ff80 | (result + vroute[sem].vp40) << 2;
|
||||
}
|
||||
|
||||
*idx = vroute[sem].ow40 << result;
|
||||
if (result < 8)
|
||||
*idx = vroute[sem].ow40 << result;
|
||||
else {
|
||||
assert(sem == TGSI_SEMANTIC_TEXCOORD);
|
||||
*idx = 0x00001000 << (result - 8);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -313,7 +325,7 @@ nv30_render_validate(struct nv30_context *nv30)
|
||||
|
||||
while (pntc && attrib < 16) {
|
||||
uint index = ffs(pntc) - 1; pntc &= ~(1 << index);
|
||||
if (vroute_add(r, attrib, TGSI_SEMANTIC_GENERIC, &index)) {
|
||||
if (vroute_add(r, attrib, TGSI_SEMANTIC_TEXCOORD, &index)) {
|
||||
vp_attribs |= (1 << attrib++);
|
||||
vp_results |= index;
|
||||
}
|
||||
@@ -398,17 +410,17 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
if (nv30->vertprog.constbuf) {
|
||||
void *map = nv04_resource(nv30->vertprog.constbuf)->data;
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
|
||||
map, nv30->vertprog.constbuf_nr);
|
||||
map, nv30->vertprog.constbuf_nr * 16);
|
||||
} else {
|
||||
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nv30->num_vtxbufs; i++) {
|
||||
const void *map = nv30->vtxbuf[i].user_buffer;
|
||||
if (!map) {
|
||||
if (!nv30->vtxbuf[i].buffer) {
|
||||
continue;
|
||||
}
|
||||
map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
|
||||
if (nv30->vtxbuf[i].buffer)
|
||||
map = pipe_buffer_map(pipe, nv30->vtxbuf[i].buffer,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_READ, &transfer[i]);
|
||||
}
|
||||
@@ -418,9 +430,9 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
if (info->indexed) {
|
||||
const void *map = nv30->idxbuf.user_buffer;
|
||||
if (!map)
|
||||
pipe_buffer_map(pipe, nv30->idxbuf.buffer,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_READ, &transferi);
|
||||
map = pipe_buffer_map(pipe, nv30->idxbuf.buffer,
|
||||
PIPE_TRANSFER_UNSYNCHRONIZED |
|
||||
PIPE_TRANSFER_READ, &transferi);
|
||||
draw_set_indexes(draw,
|
||||
(ubyte *) map + nv30->idxbuf.offset,
|
||||
nv30->idxbuf.index_size, ~0);
|
||||
@@ -444,6 +456,12 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
static void
|
||||
nv30_render_destroy(struct vbuf_render *render)
|
||||
{
|
||||
struct nv30_render *r = nv30_render(render);
|
||||
|
||||
if (r->transfer)
|
||||
pipe_buffer_unmap(&r->nv30->base.pipe, r->transfer);
|
||||
pipe_resource_reference(&r->buffer, NULL);
|
||||
nouveau_heap_free(&r->vertprog);
|
||||
FREE(render);
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "draw/draw_context.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
|
||||
#include "nv_object.xml.h"
|
||||
@@ -147,8 +148,12 @@ nv30_fp_state_delete(struct pipe_context *pipe, void *hwcso)
|
||||
|
||||
pipe_resource_reference(&fp->buffer, NULL);
|
||||
|
||||
if (fp->draw)
|
||||
draw_delete_fragment_shader(nv30_context(pipe)->draw, fp->draw);
|
||||
|
||||
FREE((void *)fp->pipe.tokens);
|
||||
FREE(fp->insn);
|
||||
FREE(fp->consts);
|
||||
FREE(fp);
|
||||
}
|
||||
|
||||
|
@@ -272,15 +272,13 @@ nv30_validate_clip(struct nv30_context *nv30)
|
||||
uint32_t clpd_enable = 0;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (nv30->rast->pipe.clip_plane_enable & (1 << i)) {
|
||||
if (nv30->dirty & NV30_NEW_CLIP) {
|
||||
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 5);
|
||||
PUSH_DATA (push, i);
|
||||
PUSH_DATAp(push, nv30->clip.ucp[i], 4);
|
||||
}
|
||||
|
||||
clpd_enable |= 1 << (1 + 4*i);
|
||||
if (nv30->dirty & NV30_NEW_CLIP) {
|
||||
BEGIN_NV04(push, NV30_3D(VP_UPLOAD_CONST_ID), 5);
|
||||
PUSH_DATA (push, i);
|
||||
PUSH_DATAp(push, nv30->clip.ucp[i], 4);
|
||||
}
|
||||
if (nv30->rast->pipe.clip_plane_enable & (1 << i))
|
||||
clpd_enable |= 2 << (4*i);
|
||||
}
|
||||
|
||||
BEGIN_NV04(push, NV30_3D(VP_CLIP_PLANES_ENABLE), 1);
|
||||
@@ -389,7 +387,7 @@ static struct state_validate hwtnl_validate_list[] = {
|
||||
{ nv30_validate_stipple, NV30_NEW_STIPPLE },
|
||||
{ nv30_validate_scissor, NV30_NEW_SCISSOR | NV30_NEW_RASTERIZER },
|
||||
{ nv30_validate_viewport, NV30_NEW_VIEWPORT },
|
||||
{ nv30_validate_clip, NV30_NEW_CLIP },
|
||||
{ nv30_validate_clip, NV30_NEW_CLIP | NV30_NEW_RASTERIZER },
|
||||
{ nv30_fragprog_validate, NV30_NEW_FRAGPROG | NV30_NEW_FRAGCONST },
|
||||
{ nv30_vertprog_validate, NV30_NEW_VERTPROG | NV30_NEW_VERTCONST |
|
||||
NV30_NEW_FRAGPROG | NV30_NEW_RASTERIZER },
|
||||
|
@@ -23,6 +23,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "draw/draw_context.h"
|
||||
#include "util/u_dynarray.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
|
||||
@@ -237,6 +238,10 @@ nv30_vp_state_delete(struct pipe_context *pipe, void *hwcso)
|
||||
|
||||
if (vp->translated)
|
||||
nv30_vertprog_destroy(vp);
|
||||
|
||||
if (vp->draw)
|
||||
draw_delete_vertex_shader(nv30_context(pipe)->draw, vp->draw);
|
||||
|
||||
FREE((void *)vp->pipe.tokens);
|
||||
FREE(vp);
|
||||
}
|
||||
|
@@ -872,9 +872,8 @@ nvfx_vertprog_parse_decl_output(struct nvfx_vpc *vpc,
|
||||
}
|
||||
break;
|
||||
case TGSI_SEMANTIC_EDGEFLAG:
|
||||
/* not really an error just a fallback */
|
||||
NOUVEAU_ERR("cannot handle edgeflag output\n");
|
||||
return FALSE;
|
||||
vpc->r_result[idx] = nvfx_reg(NVFXSR_NONE, 0);
|
||||
return TRUE;
|
||||
default:
|
||||
NOUVEAU_ERR("bad output semantic\n");
|
||||
return FALSE;
|
||||
|
@@ -392,7 +392,7 @@ nvc0_gp_gen_header(struct nvc0_program *gp, struct nv50_ir_prog_info *info)
|
||||
break;
|
||||
}
|
||||
|
||||
gp->hdr[4] = info->prop.gp.maxVertices & 0x1ff;
|
||||
gp->hdr[4] = MIN2(info->prop.gp.maxVertices, 1024);
|
||||
|
||||
return nvc0_vtgp_gen_header(gp, info);
|
||||
}
|
||||
|
@@ -835,8 +835,15 @@ static void si_update_spi_tmpring_size(struct si_context *sctx)
|
||||
si_pm4_bind_state(sctx, ps, sctx->ps_shader->current->pm4);
|
||||
if (si_update_scratch_buffer(sctx, sctx->gs_shader))
|
||||
si_pm4_bind_state(sctx, gs, sctx->gs_shader->current->pm4);
|
||||
if (si_update_scratch_buffer(sctx, sctx->vs_shader))
|
||||
si_pm4_bind_state(sctx, vs, sctx->vs_shader->current->pm4);
|
||||
|
||||
/* VS can be bound as ES or VS. */
|
||||
if (sctx->gs_shader) {
|
||||
if (si_update_scratch_buffer(sctx, sctx->vs_shader))
|
||||
si_pm4_bind_state(sctx, es, sctx->vs_shader->current->pm4);
|
||||
} else {
|
||||
if (si_update_scratch_buffer(sctx, sctx->vs_shader))
|
||||
si_pm4_bind_state(sctx, vs, sctx->vs_shader->current->pm4);
|
||||
}
|
||||
}
|
||||
|
||||
/* The LLVM shader backend should be reporting aligned scratch_sizes. */
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "CL/cl.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace clover {
|
||||
class command_queue;
|
||||
|
@@ -42,7 +42,6 @@ nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
|
||||
lib@OSMESA_LIB@_la_SOURCES = target.c
|
||||
|
||||
lib@OSMESA_LIB@_la_LDFLAGS = \
|
||||
-module \
|
||||
-no-undefined \
|
||||
-version-number @OSMESA_VERSION@ \
|
||||
$(GC_SECTIONS) \
|
||||
|
@@ -2829,8 +2829,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
link_intrastage_shaders(mem_ctx, ctx, prog, shader_list[stage],
|
||||
num_shaders[stage]);
|
||||
|
||||
if (!prog->LinkStatus)
|
||||
if (!prog->LinkStatus) {
|
||||
if (sh)
|
||||
ctx->Driver.DeleteShader(ctx, sh);
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch (stage) {
|
||||
case MESA_SHADER_VERTEX:
|
||||
@@ -2843,8 +2846,11 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
validate_fragment_shader_executable(prog, sh);
|
||||
break;
|
||||
}
|
||||
if (!prog->LinkStatus)
|
||||
if (!prog->LinkStatus) {
|
||||
if (sh)
|
||||
ctx->Driver.DeleteShader(ctx, sh);
|
||||
goto done;
|
||||
}
|
||||
|
||||
_mesa_reference_shader(ctx, &prog->_LinkedShaders[stage], sh);
|
||||
}
|
||||
|
@@ -1050,7 +1050,7 @@ fs_visitor::implied_mrf_writes(fs_inst *inst)
|
||||
case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD:
|
||||
return inst->mlen;
|
||||
case SHADER_OPCODE_GEN4_SCRATCH_WRITE:
|
||||
return 2;
|
||||
return inst->mlen;
|
||||
case SHADER_OPCODE_UNTYPED_ATOMIC:
|
||||
case SHADER_OPCODE_UNTYPED_SURFACE_READ:
|
||||
case SHADER_OPCODE_UNTYPED_SURFACE_WRITE:
|
||||
|
@@ -2460,11 +2460,27 @@ vec4_visitor::emit_mcs_fetch(ir_texture *ir, src_reg coordinate, src_reg sampler
|
||||
new(mem_ctx) vec4_instruction(SHADER_OPCODE_TXF_MCS,
|
||||
dst_reg(this, glsl_type::uvec4_type));
|
||||
inst->base_mrf = 2;
|
||||
inst->mlen = 1;
|
||||
inst->src[1] = sampler;
|
||||
|
||||
int param_base;
|
||||
|
||||
if (devinfo->gen >= 9) {
|
||||
/* Gen9+ needs a message header in order to use SIMD4x2 mode */
|
||||
vec4_instruction *header_inst = new(mem_ctx)
|
||||
vec4_instruction(VS_OPCODE_SET_SIMD4X2_HEADER_GEN9,
|
||||
dst_reg(MRF, inst->base_mrf));
|
||||
|
||||
emit(header_inst);
|
||||
|
||||
inst->mlen = 2;
|
||||
inst->header_size = 1;
|
||||
param_base = inst->base_mrf + 1;
|
||||
} else {
|
||||
inst->mlen = 1;
|
||||
param_base = inst->base_mrf;
|
||||
}
|
||||
|
||||
/* parameters are: u, v, r, lod; lod will always be zero due to api restrictions */
|
||||
int param_base = inst->base_mrf;
|
||||
int coord_mask = (1 << ir->coordinate->type->vector_elements) - 1;
|
||||
int zero_mask = 0xf & ~coord_mask;
|
||||
|
||||
|
@@ -62,7 +62,9 @@
|
||||
#include "swrast/s_context.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#ifdef HAVE_SYS_SYSCTL_H
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
const __DRIextension **__driDriverGetExtensions_swrast(void);
|
||||
|
||||
|
@@ -39,7 +39,6 @@ nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
|
||||
lib@OSMESA_LIB@_la_SOURCES = osmesa.c
|
||||
|
||||
lib@OSMESA_LIB@_la_LDFLAGS = \
|
||||
-module \
|
||||
-no-undefined \
|
||||
-version-number @OSMESA_VERSION@ \
|
||||
$(GC_SECTIONS) \
|
||||
|
@@ -38,6 +38,9 @@ _mesa_initialize_exec_table(struct gl_context *ctx);
|
||||
extern void
|
||||
_mesa_initialize_dispatch_tables(struct gl_context *ctx);
|
||||
|
||||
extern struct _glapi_table *
|
||||
_mesa_new_nop_table(unsigned numEntries);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
@@ -883,6 +883,19 @@ update_default_objects(struct gl_context *ctx)
|
||||
}
|
||||
|
||||
|
||||
/* XXX this is temporary and should be removed at some point in the
|
||||
* future when there's a reasonable expectation that the libGL library
|
||||
* contains the _glapi_new_nop_table() and _glapi_set_nop_handler()
|
||||
* functions which were added in Mesa 10.6.
|
||||
*/
|
||||
#if !defined(_WIN32)
|
||||
/* Avoid libGL / driver ABI break */
|
||||
#define USE_GLAPI_NOP_FEATURES 0
|
||||
#else
|
||||
#define USE_GLAPI_NOP_FEATURES 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* This function is called by the glapi no-op functions. For each OpenGL
|
||||
* function/entrypoint there's a simple no-op function. These "no-op"
|
||||
@@ -898,6 +911,7 @@ update_default_objects(struct gl_context *ctx)
|
||||
*
|
||||
* \param name the name of the OpenGL function
|
||||
*/
|
||||
#if USE_GLAPI_NOP_FEATURES
|
||||
static void
|
||||
nop_handler(const char *name)
|
||||
{
|
||||
@@ -914,6 +928,7 @@ nop_handler(const char *name)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
@@ -923,11 +938,51 @@ nop_handler(const char *name)
|
||||
static void GLAPIENTRY
|
||||
nop_glFlush(void)
|
||||
{
|
||||
/* don't record an error like we do in _mesa_generic_nop() */
|
||||
/* don't record an error like we do in nop_handler() */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !USE_GLAPI_NOP_FEATURES
|
||||
static int
|
||||
generic_nop(void)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"unsupported function called "
|
||||
"(unsupported extension or deprecated function?)");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Create a new API dispatch table in which all entries point to the
|
||||
* generic_nop() function. This will not work on Windows because of
|
||||
* the __stdcall convention which requires the callee to clean up the
|
||||
* call stack. That's impossible with one generic no-op function.
|
||||
*/
|
||||
struct _glapi_table *
|
||||
_mesa_new_nop_table(unsigned numEntries)
|
||||
{
|
||||
struct _glapi_table *table;
|
||||
|
||||
#if !USE_GLAPI_NOP_FEATURES
|
||||
table = malloc(numEntries * sizeof(_glapi_proc));
|
||||
if (table) {
|
||||
_glapi_proc *entry = (_glapi_proc *) table;
|
||||
unsigned i;
|
||||
for (i = 0; i < numEntries; i++) {
|
||||
entry[i] = (_glapi_proc) generic_nop;
|
||||
}
|
||||
}
|
||||
#else
|
||||
table = _glapi_new_nop_table(numEntries);
|
||||
#endif
|
||||
return table;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allocate and initialize a new dispatch table. The table will be
|
||||
* populated with pointers to "no-op" functions. In turn, the no-op
|
||||
@@ -941,8 +996,9 @@ alloc_dispatch_table(void)
|
||||
* Mesa we do this to accommodate different versions of libGL and various
|
||||
* DRI drivers.
|
||||
*/
|
||||
GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT);
|
||||
struct _glapi_table *table = _glapi_new_nop_table(numEntries);
|
||||
int numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT);
|
||||
|
||||
struct _glapi_table *table = _mesa_new_nop_table(numEntries);
|
||||
|
||||
#if defined(_WIN32)
|
||||
if (table) {
|
||||
@@ -966,7 +1022,9 @@ alloc_dispatch_table(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if USE_GLAPI_NOP_FEATURES
|
||||
_glapi_set_nop_handler(nop_handler);
|
||||
#endif
|
||||
|
||||
return table;
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ DispatchSanity_test::SetUp()
|
||||
_mesa_init_driver_functions(&driver_functions);
|
||||
|
||||
const unsigned size = _glapi_get_dispatch_table_size();
|
||||
nop_table = (_glapi_proc *) _glapi_new_nop_table(size);
|
||||
nop_table = (_glapi_proc *) _mesa_new_nop_table(size);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -376,12 +376,6 @@ void st_destroy_context( struct st_context *st )
|
||||
}
|
||||
pipe_surface_reference(&st->state.framebuffer.zsbuf, NULL);
|
||||
|
||||
pipe->set_index_buffer(pipe, NULL);
|
||||
|
||||
for (i = 0; i < PIPE_SHADER_TYPES; i++) {
|
||||
pipe->set_constant_buffer(pipe, i, 0, NULL);
|
||||
}
|
||||
|
||||
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
|
||||
|
||||
_vbo_DestroyContext(st->ctx);
|
||||
|
@@ -5549,6 +5549,7 @@ get_mesa_program(struct gl_context *ctx,
|
||||
*/
|
||||
_mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters);
|
||||
if (!shader_program->LinkStatus) {
|
||||
free_glsl_to_tgsi_visitor(v);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user