Compare commits
32 Commits
mesa-11.1.
...
mesa-11.1.
Author | SHA1 | Date | |
---|---|---|---|
|
20db46c227 | ||
|
b2a5efb56f | ||
|
38c645b60a | ||
|
2dff4c6fa7 | ||
|
d81ddb3ed8 | ||
|
c25c1dbf51 | ||
|
bed982c4b7 | ||
|
dcaf3989d1 | ||
|
996a4958da | ||
|
0cf5a8159f | ||
|
6cc9a53d84 | ||
|
0a51e77fa1 | ||
|
ca6d0a3dbe | ||
|
4ae9142f8b | ||
|
aff9f8a6f7 | ||
|
b0b163c82a | ||
|
f70574c835 | ||
|
26dff8a7bb | ||
|
ea21336d15 | ||
|
7f6e9c5f59 | ||
|
0828391a34 | ||
|
75b6f14ab8 | ||
|
69df6ac272 | ||
|
0f53b2010c | ||
|
67be605b96 | ||
|
be20f1d7c1 | ||
|
15344c978b | ||
|
f1bb27acc5 | ||
|
dd37db0c80 | ||
|
8e3fbb90a9 | ||
|
79f3aaca4f | ||
|
f9a2bd212a |
2
bin/.cherry-ignore
Normal file
2
bin/.cherry-ignore
Normal file
@@ -0,0 +1,2 @@
|
||||
# The introduced definitions are not used/implemented by mesa
|
||||
1d5b88e33b07bc26d612720e6cb197a6917ba75f gles2: Update gl2ext.h to revision: 32120
|
@@ -115,7 +115,7 @@ vl_video_buffer_formats(struct pipe_screen *screen, enum pipe_format format)
|
||||
return const_resource_formats_VUYA;
|
||||
|
||||
case PIPE_FORMAT_R8G8B8X8_UNORM:
|
||||
return const_resource_formats_VUYX;
|
||||
return const_resource_formats_YUVX;
|
||||
|
||||
case PIPE_FORMAT_B8G8R8X8_UNORM:
|
||||
return const_resource_formats_VUYX;
|
||||
|
@@ -291,7 +291,7 @@ void BasicBlock::permuteAdjacent(Instruction *a, Instruction *b)
|
||||
|
||||
if (b->prev)
|
||||
b->prev->next = b;
|
||||
if (a->prev)
|
||||
if (a->next)
|
||||
a->next->prev = a;
|
||||
}
|
||||
|
||||
|
@@ -2893,6 +2893,12 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
|
||||
bb->cfg.attach(&loopBB->cfg, Graph::Edge::BACK);
|
||||
}
|
||||
setPosition(reinterpret_cast<BasicBlock *>(breakBBs.pop().u.p), true);
|
||||
|
||||
// If the loop never breaks (e.g. only has RET's inside), then there
|
||||
// will be no way to get to the break bb. However BGNLOOP will have
|
||||
// already made a PREBREAK to it, so it must be in the CFG.
|
||||
if (getBB()->cfg.incidentCount() == 0)
|
||||
loopBB->cfg.attach(&getBB()->cfg, Graph::Edge::TREE);
|
||||
}
|
||||
break;
|
||||
case TGSI_OPCODE_BRK:
|
||||
|
@@ -832,7 +832,7 @@ NV50LoweringPreSSA::handleTXB(TexInstruction *i)
|
||||
}
|
||||
Value *flags = bld.getScratch(1, FILE_FLAGS);
|
||||
bld.setPosition(cond, true);
|
||||
bld.mkCvt(OP_CVT, TYPE_U8, flags, TYPE_U32, cond->getDef(0));
|
||||
bld.mkCvt(OP_CVT, TYPE_U8, flags, TYPE_U32, cond->getDef(0))->flagsDef = 0;
|
||||
|
||||
Instruction *tex[4];
|
||||
for (l = 0; l < 4; ++l) {
|
||||
|
@@ -858,6 +858,12 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
|
||||
i->src(0).mod = i->src(t).mod;
|
||||
i->setSrc(1, new_ImmediateValue(prog, imm0.reg.data.u32));
|
||||
i->src(1).mod = 0;
|
||||
} else
|
||||
if (i->postFactor && i->sType == TYPE_F32) {
|
||||
/* Can't emit a postfactor with an immediate, have to fold it in */
|
||||
i->setSrc(s, new_ImmediateValue(
|
||||
prog, imm0.reg.data.f32 * exp2f(i->postFactor)));
|
||||
i->postFactor = 0;
|
||||
}
|
||||
break;
|
||||
case OP_MAD:
|
||||
@@ -2654,7 +2660,7 @@ NV50PostRaConstantFolding::visit(BasicBlock *bb)
|
||||
break;
|
||||
|
||||
def = i->getSrc(1)->getInsn();
|
||||
if (def->op == OP_MOV && def->src(0).getFile() == FILE_IMMEDIATE) {
|
||||
if (def && def->op == OP_MOV && def->src(0).getFile() == FILE_IMMEDIATE) {
|
||||
vtmp = i->getSrc(1);
|
||||
i->setSrc(1, def->getSrc(0));
|
||||
|
||||
@@ -2956,6 +2962,16 @@ DeadCodeElim::visit(BasicBlock *bb)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Each load can go into up to 4 destinations, any of which might potentially
|
||||
// be dead (i.e. a hole). These can always be split into 2 loads, independent
|
||||
// of where the holes are. We find the first contiguous region, put it into
|
||||
// the first load, and then put the second contiguous region into the second
|
||||
// load. There can be at most 2 contiguous regions.
|
||||
//
|
||||
// Note that there are some restrictions, for example it's not possible to do
|
||||
// a 64-bit load that's not 64-bit aligned, so such a load has to be split
|
||||
// up. Also hardware doesn't support 96-bit loads, so those also have to be
|
||||
// split into a 64-bit and 32-bit load.
|
||||
void
|
||||
DeadCodeElim::checkSplitLoad(Instruction *ld1)
|
||||
{
|
||||
@@ -2976,6 +2992,8 @@ DeadCodeElim::checkSplitLoad(Instruction *ld1)
|
||||
addr1 = ld1->getSrc(0)->reg.data.offset;
|
||||
n1 = n2 = 0;
|
||||
size1 = size2 = 0;
|
||||
|
||||
// Compute address/width for first load
|
||||
for (d = 0; ld1->defExists(d); ++d) {
|
||||
if (mask & (1 << d)) {
|
||||
if (size1 && (addr1 & 0x7))
|
||||
@@ -2989,16 +3007,34 @@ DeadCodeElim::checkSplitLoad(Instruction *ld1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Scale back the size of the first load until it can be loaded. This
|
||||
// typically happens for TYPE_B96 loads.
|
||||
while (n1 &&
|
||||
!prog->getTarget()->isAccessSupported(ld1->getSrc(0)->reg.file,
|
||||
typeOfSize(size1))) {
|
||||
size1 -= def1[--n1]->reg.size;
|
||||
d--;
|
||||
}
|
||||
|
||||
// Compute address/width for second load
|
||||
for (addr2 = addr1 + size1; ld1->defExists(d); ++d) {
|
||||
if (mask & (1 << d)) {
|
||||
assert(!size2 || !(addr2 & 0x7));
|
||||
def2[n2] = ld1->getDef(d);
|
||||
size2 += def2[n2++]->reg.size;
|
||||
} else {
|
||||
} else if (!n2) {
|
||||
assert(!n2);
|
||||
addr2 += ld1->getDef(d)->reg.size;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure that we've processed all the values
|
||||
for (; ld1->defExists(d); ++d)
|
||||
assert(!(mask & (1 << d)));
|
||||
|
||||
updateLdStOffset(ld1, addr1, func);
|
||||
ld1->setType(typeOfSize(size1));
|
||||
for (d = 0; d < 4; ++d)
|
||||
|
@@ -454,7 +454,7 @@ TargetNV50::isModSupported(const Instruction *insn, int s, Modifier mod) const
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (s >= 3)
|
||||
if (s >= opInfo[insn->op].srcNr || s >= 3)
|
||||
return false;
|
||||
return (mod & Modifier(opInfo[insn->op].srcMods[s])) == mod;
|
||||
}
|
||||
|
@@ -439,7 +439,7 @@ TargetNVC0::isModSupported(const Instruction *insn, int s, Modifier mod) const
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (s >= 3)
|
||||
if (s >= opInfo[insn->op].srcNr || s >= 3)
|
||||
return false;
|
||||
return (mod & Modifier(opInfo[insn->op].srcMods[s])) == mod;
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@
|
||||
|
||||
/* the number of CS dwords for flushing and drawing */
|
||||
#define R600_MAX_FLUSH_CS_DWORDS 16
|
||||
#define R600_MAX_DRAW_CS_DWORDS 47
|
||||
#define R600_MAX_DRAW_CS_DWORDS 52
|
||||
#define R600_TRACE_CS_DWORDS 7
|
||||
|
||||
#define R600_MAX_USER_CONST_BUFFERS 13
|
||||
|
@@ -2206,6 +2206,11 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
|
||||
if (ctx.type == TGSI_PROCESSOR_GEOMETRY) {
|
||||
struct r600_bytecode_alu alu;
|
||||
int r;
|
||||
|
||||
/* GS thread with no output workaround - emit a cut at start of GS */
|
||||
if (ctx.bc->chip_class == R600)
|
||||
r600_bytecode_add_cfinst(ctx.bc, CF_OP_CUT_VERTEX);
|
||||
|
||||
for (j = 0; j < 4; j++) {
|
||||
memset(&alu, 0, sizeof(struct r600_bytecode_alu));
|
||||
alu.op = ALU_OP1_MOV;
|
||||
|
@@ -2213,10 +2213,11 @@ void r600_init_atom_start_cs(struct r600_context *rctx)
|
||||
num_temp_gprs = 4;
|
||||
num_gs_gprs = 0;
|
||||
num_es_gprs = 0;
|
||||
num_ps_threads = 136;
|
||||
num_vs_threads = 48;
|
||||
num_gs_threads = 4;
|
||||
num_es_threads = 4;
|
||||
/* use limits 40 VS and at least 16 ES/GS */
|
||||
num_ps_threads = 120;
|
||||
num_vs_threads = 40;
|
||||
num_gs_threads = 16;
|
||||
num_es_threads = 16;
|
||||
num_ps_stack_entries = 40;
|
||||
num_vs_stack_entries = 40;
|
||||
num_gs_stack_entries = 32;
|
||||
@@ -2675,6 +2676,9 @@ void r600_update_vs_state(struct pipe_context *ctx, struct r600_pipe_shader *sha
|
||||
S_02881C_USE_VTX_VIEWPORT_INDX(rshader->vs_out_viewport);
|
||||
}
|
||||
|
||||
#define RV610_GSVS_ALIGN 32
|
||||
#define R600_GSVS_ALIGN 16
|
||||
|
||||
void r600_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader *shader)
|
||||
{
|
||||
struct r600_context *rctx = (struct r600_context *)ctx;
|
||||
@@ -2684,6 +2688,23 @@ void r600_update_gs_state(struct pipe_context *ctx, struct r600_pipe_shader *sha
|
||||
unsigned gsvs_itemsize =
|
||||
(cp_shader->ring_item_sizes[0] * shader->selector->gs_max_out_vertices) >> 2;
|
||||
|
||||
/* some r600s needs gsvs itemsize aligned to cacheline size
|
||||
this was fixed in rs780 and above. */
|
||||
switch (rctx->b.family) {
|
||||
case CHIP_RV610:
|
||||
gsvs_itemsize = align(gsvs_itemsize, RV610_GSVS_ALIGN);
|
||||
break;
|
||||
case CHIP_R600:
|
||||
case CHIP_RV630:
|
||||
case CHIP_RV670:
|
||||
case CHIP_RV620:
|
||||
case CHIP_RV635:
|
||||
gsvs_itemsize = align(gsvs_itemsize, R600_GSVS_ALIGN);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
r600_init_command_buffer(cb, 64);
|
||||
|
||||
/* VGT_GS_MODE is written by r600_emit_shader_stages */
|
||||
|
@@ -1770,6 +1770,24 @@ static void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
|
||||
(info.count_from_stream_output ? S_0287F0_USE_OPAQUE(1) : 0);
|
||||
}
|
||||
|
||||
/* SMX returns CONTEXT_DONE too early workaround */
|
||||
if (rctx->b.family == CHIP_R600 ||
|
||||
rctx->b.family == CHIP_RV610 ||
|
||||
rctx->b.family == CHIP_RV630 ||
|
||||
rctx->b.family == CHIP_RV635) {
|
||||
/* if we have gs shader or streamout
|
||||
we need to do a wait idle after every draw */
|
||||
if (rctx->gs_shader || rctx->b.streamout.streamout_enabled) {
|
||||
radeon_set_config_reg(cs, R_008040_WAIT_UNTIL, S_008040_WAIT_3D_IDLE(1));
|
||||
}
|
||||
}
|
||||
|
||||
/* ES ring rolling over at EOP - workaround */
|
||||
if (rctx->b.chip_class == R600) {
|
||||
cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 0, 0);
|
||||
cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_SQ_NON_EVENT);
|
||||
}
|
||||
|
||||
if (rctx->screen->b.trace_bo) {
|
||||
r600_trace_emit(rctx);
|
||||
}
|
||||
|
@@ -130,6 +130,7 @@
|
||||
#define EVENT_TYPE_SAMPLE_STREAMOUTSTATS 0x20
|
||||
#define EVENT_TYPE_FLUSH_AND_INV_DB_META 0x2c /* supported on r700+ */
|
||||
#define EVENT_TYPE_VGT_FLUSH 0x24
|
||||
#define EVENT_TYPE_SQ_NON_EVENT 0x26
|
||||
#define EVENT_TYPE_FLUSH_AND_INV_CB_META 46 /* supported on r700+ */
|
||||
#define EVENT_TYPE(x) ((x) << 0)
|
||||
#define EVENT_INDEX(x) ((x) << 8)
|
||||
|
@@ -556,10 +556,11 @@ const char *r600_get_llvm_processor_name(enum radeon_family family)
|
||||
case CHIP_TONGA: return "tonga";
|
||||
case CHIP_ICELAND: return "iceland";
|
||||
case CHIP_CARRIZO: return "carrizo";
|
||||
case CHIP_FIJI: return "fiji";
|
||||
#if HAVE_LLVM <= 0x0307
|
||||
case CHIP_FIJI: return "tonga";
|
||||
case CHIP_STONEY: return "carrizo";
|
||||
#else
|
||||
case CHIP_FIJI: return "fiji";
|
||||
case CHIP_STONEY: return "stoney";
|
||||
#endif
|
||||
default: return "";
|
||||
|
@@ -1539,7 +1539,7 @@ void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
|
||||
bld_base->op_actions[TGSI_OPCODE_ENDIF].emit = endif_emit;
|
||||
bld_base->op_actions[TGSI_OPCODE_ENDLOOP].emit = endloop_emit;
|
||||
bld_base->op_actions[TGSI_OPCODE_EX2].emit = build_tgsi_intrinsic_nomem;
|
||||
bld_base->op_actions[TGSI_OPCODE_EX2].intr_name = "llvm.exp2.f32";
|
||||
bld_base->op_actions[TGSI_OPCODE_EX2].intr_name = "llvm.AMDIL.exp.";
|
||||
bld_base->op_actions[TGSI_OPCODE_FLR].emit = build_tgsi_intrinsic_nomem;
|
||||
bld_base->op_actions[TGSI_OPCODE_FLR].intr_name = "llvm.floor.f32";
|
||||
bld_base->op_actions[TGSI_OPCODE_FMA].emit = build_tgsi_intrinsic_nomem;
|
||||
|
@@ -32,7 +32,8 @@ platform::platform() : adaptor_range(evals(), devs) {
|
||||
|
||||
for (pipe_loader_device *ldev : ldevs) {
|
||||
try {
|
||||
devs.push_back(create<device>(*this, ldev));
|
||||
if (ldev)
|
||||
devs.push_back(create<device>(*this, ldev));
|
||||
} catch (error &) {
|
||||
pipe_loader_release(&ldev, 1);
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ lib@OPENCL_LIBNAME@_la_LIBADD = \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(top_builddir)/src/util/libmesautil.la \
|
||||
$(ELF_LIB) \
|
||||
-ldl \
|
||||
$(DLOPEN_LIBS) \
|
||||
-lclangCodeGen \
|
||||
-lclangFrontendTool \
|
||||
-lclangFrontend \
|
||||
|
@@ -477,7 +477,7 @@ _mesa_glsl_msg(const YYLTYPE *locp, _mesa_glsl_parse_state *state,
|
||||
struct gl_context *ctx = state->ctx;
|
||||
|
||||
/* Report the error via GL_ARB_debug_output. */
|
||||
_mesa_shader_debug(ctx, type, &msg_id, msg, strlen(msg));
|
||||
_mesa_shader_debug(ctx, type, &msg_id, msg);
|
||||
|
||||
ralloc_strcat(&state->info_log, "\n");
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
|
||||
|
||||
void
|
||||
_mesa_shader_debug(struct gl_context *, GLenum, GLuint *,
|
||||
const char *, int)
|
||||
const char *)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,7 @@ _mesa_clear_shader_program_data(struct gl_shader_program *);
|
||||
|
||||
extern "C" void
|
||||
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
|
||||
const char *msg, int len);
|
||||
const char *msg);
|
||||
|
||||
static inline gl_shader_stage
|
||||
_mesa_shader_enum_to_shader_stage(GLenum v)
|
||||
|
@@ -146,7 +146,7 @@
|
||||
</function>
|
||||
|
||||
<!-- ES extension has different suffixes -->
|
||||
<function name="DebugMessageControlKHR" alias="DebugMessageControl" es1="1.0" es2="2.0">
|
||||
<function name="DebugMessageControlKHR" alias="DebugMessageControl" es1="1.1" es2="2.0">
|
||||
<param name="source" type="GLenum"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="severity" type="GLenum"/>
|
||||
@@ -155,7 +155,7 @@
|
||||
<param name="enabled" type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="DebugMessageInsertKHR" alias="DebugMessageInsert" es1="1.0" es2="2.0">
|
||||
<function name="DebugMessageInsertKHR" alias="DebugMessageInsert" es1="1.1" es2="2.0">
|
||||
<param name="source" type="GLenum"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="id" type="GLuint"/>
|
||||
@@ -164,12 +164,12 @@
|
||||
<param name="buf" type="const GLchar *"/>
|
||||
</function>
|
||||
|
||||
<function name="DebugMessageCallbackKHR" alias="DebugMessageCallback" es1="1.0" es2="2.0">
|
||||
<function name="DebugMessageCallbackKHR" alias="DebugMessageCallback" es1="1.1" es2="2.0">
|
||||
<param name="callback" type="GLDEBUGPROC"/>
|
||||
<param name="userParam" type="const GLvoid *"/>
|
||||
</function>
|
||||
|
||||
<function name="GetDebugMessageLogKHR" alias="GetDebugMessageLog" es1="1.0" es2="2.0">
|
||||
<function name="GetDebugMessageLogKHR" alias="GetDebugMessageLog" es1="1.1" es2="2.0">
|
||||
<return type="GLuint"/>
|
||||
<param name="count" type="GLuint"/>
|
||||
<param name="bufsize" type="GLsizei"/>
|
||||
@@ -181,23 +181,28 @@
|
||||
<param name="messageLog" type="GLchar *" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="PushDebugGroupKHR" alias="PushDebugGroup" es1="1.0" es2="2.0">
|
||||
<function name="GetPointervKHR" alias="GetPointerv" es1="1.1" es2="2.0">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLvoid **" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="PushDebugGroupKHR" alias="PushDebugGroup" es1="1.1" es2="2.0">
|
||||
<param name="source" type="GLenum"/>
|
||||
<param name="id" type="GLuint"/>
|
||||
<param name="length" type="GLsizei"/>
|
||||
<param name="message" type="const GLchar *"/>
|
||||
</function>
|
||||
|
||||
<function name="PopDebugGroupKHR" alias="PopDebugGroup" es1="1.0" es2="2.0"/>
|
||||
<function name="PopDebugGroupKHR" alias="PopDebugGroup" es1="1.1" es2="2.0"/>
|
||||
|
||||
<function name="ObjectLabelKHR" alias="ObjectLabel" es1="1.0" es2="2.0">
|
||||
<function name="ObjectLabelKHR" alias="ObjectLabel" es1="1.1" es2="2.0">
|
||||
<param name="identifier" type="GLenum"/>
|
||||
<param name="name" type="GLuint"/>
|
||||
<param name="length" type="GLsizei"/>
|
||||
<param name="label" type="const GLchar *"/>
|
||||
</function>
|
||||
|
||||
<function name="GetObjectLabelKHR" alias="GetObjectLabel" es1="1.0" es2="2.0">
|
||||
<function name="GetObjectLabelKHR" alias="GetObjectLabel" es1="1.1" es2="2.0">
|
||||
<param name="identifier" type="GLenum"/>
|
||||
<param name="name" type="GLuint"/>
|
||||
<param name="bufSize" type="GLsizei"/>
|
||||
@@ -205,13 +210,13 @@
|
||||
<param name="label" type="GLchar *"/>
|
||||
</function>
|
||||
|
||||
<function name="ObjectPtrLabelKHR" alias="ObjectPtrLabel" es1="1.0" es2="2.0">
|
||||
<function name="ObjectPtrLabelKHR" alias="ObjectPtrLabel" es1="1.1" es2="2.0">
|
||||
<param name="ptr" type="const GLvoid *"/>
|
||||
<param name="length" type="GLsizei"/>
|
||||
<param name="label" type="const GLchar *"/>
|
||||
</function>
|
||||
|
||||
<function name="GetObjectPtrLabelKHR" alias="GetObjectPtrLabel" es1="1.0" es2="2.0">
|
||||
<function name="GetObjectPtrLabelKHR" alias="GetObjectPtrLabel" es1="1.1" es2="2.0">
|
||||
<param name="ptr" type="const GLvoid *"/>
|
||||
<param name="bufSize" type="GLsizei"/>
|
||||
<param name="length" type="GLsizei *"/>
|
||||
|
@@ -51,7 +51,8 @@ libi965_compiler_la_SOURCES = $(i965_compiler_FILES)
|
||||
TEST_LIBS = \
|
||||
libi965_compiler.la \
|
||||
../../../libmesa.la \
|
||||
-lpthread -ldl \
|
||||
$(PTHREAD_LIBS) \
|
||||
$(DLOPEN_LIBS) \
|
||||
../common/libdri_test_stubs.la
|
||||
|
||||
TESTS = \
|
||||
|
@@ -694,7 +694,7 @@ brw_inst_bits(const brw_inst *inst, unsigned high, unsigned low)
|
||||
high %= 64;
|
||||
low %= 64;
|
||||
|
||||
const uint64_t mask = (1ull << (high - low + 1)) - 1;
|
||||
const uint64_t mask = (~0ull >> (64 - (high - low + 1)));
|
||||
|
||||
return (inst->data[word] >> low) & mask;
|
||||
}
|
||||
@@ -713,7 +713,7 @@ brw_inst_set_bits(brw_inst *inst, unsigned high, unsigned low, uint64_t value)
|
||||
high %= 64;
|
||||
low %= 64;
|
||||
|
||||
const uint64_t mask = ((1ull << (high - low + 1)) - 1) << low;
|
||||
const uint64_t mask = (~0ull >> (64 - (high - low + 1))) << low;
|
||||
|
||||
/* Make sure the supplied value actually fits in the given bitfield. */
|
||||
assert((value & (mask >> low)) == value);
|
||||
|
@@ -1060,7 +1060,7 @@ brw_upload_wm_abo_surfaces(struct brw_context *brw)
|
||||
{
|
||||
struct gl_context *ctx = &brw->ctx;
|
||||
/* _NEW_PROGRAM */
|
||||
struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram;
|
||||
struct gl_shader_program *prog = ctx->_Shader->_CurrentFragmentProgram;
|
||||
|
||||
if (prog) {
|
||||
/* BRW_NEW_FS_PROG_DATA */
|
||||
@@ -1336,7 +1336,7 @@ brw_upload_wm_image_surfaces(struct brw_context *brw)
|
||||
{
|
||||
struct gl_context *ctx = &brw->ctx;
|
||||
/* BRW_NEW_FRAGMENT_PROGRAM */
|
||||
struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram;
|
||||
struct gl_shader_program *prog = ctx->_Shader->_CurrentFragmentProgram;
|
||||
|
||||
if (prog) {
|
||||
/* BRW_NEW_FS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */
|
||||
|
@@ -654,6 +654,9 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api)
|
||||
/* GL_EXT_provoking_vertex */
|
||||
consts->QuadsFollowProvokingVertexConvention = GL_TRUE;
|
||||
|
||||
/** GL_ARB_viewport_array */
|
||||
consts->LayerAndVPIndexProvokingVertex = GL_UNDEFINED_VERTEX;
|
||||
|
||||
/* GL_EXT_transform_feedback */
|
||||
consts->MaxTransformFeedbackBuffers = MAX_FEEDBACK_BUFFERS;
|
||||
consts->MaxTransformFeedbackSeparateComponents = 4 * MAX_FEEDBACK_ATTRIBS;
|
||||
|
@@ -76,6 +76,8 @@ struct gl_debug_message
|
||||
enum mesa_debug_type type;
|
||||
GLuint id;
|
||||
enum mesa_debug_severity severity;
|
||||
/* length as given by the user - if message was explicitly null terminated,
|
||||
* length can be negative */
|
||||
GLsizei length;
|
||||
GLcharARB *message;
|
||||
};
|
||||
@@ -98,7 +100,7 @@ struct gl_debug_state
|
||||
|
||||
struct gl_debug_group *Groups[MAX_DEBUG_GROUP_STACK_DEPTH];
|
||||
struct gl_debug_message GroupMessages[MAX_DEBUG_GROUP_STACK_DEPTH];
|
||||
GLint GroupStackDepth;
|
||||
GLint CurrentGroup; // GroupStackDepth - 1
|
||||
|
||||
struct gl_debug_log Log;
|
||||
};
|
||||
@@ -211,14 +213,19 @@ debug_message_store(struct gl_debug_message *msg,
|
||||
enum mesa_debug_severity severity,
|
||||
GLsizei len, const char *buf)
|
||||
{
|
||||
GLsizei length = len;
|
||||
|
||||
assert(!msg->message && !msg->length);
|
||||
|
||||
msg->message = malloc(len+1);
|
||||
if (msg->message) {
|
||||
(void) strncpy(msg->message, buf, (size_t)len);
|
||||
msg->message[len] = '\0';
|
||||
if (length < 0)
|
||||
length = strlen(buf);
|
||||
|
||||
msg->length = len+1;
|
||||
msg->message = malloc(length+1);
|
||||
if (msg->message) {
|
||||
(void) strncpy(msg->message, buf, (size_t)length);
|
||||
msg->message[length] = '\0';
|
||||
|
||||
msg->length = len;
|
||||
msg->source = source;
|
||||
msg->type = type;
|
||||
msg->id = id;
|
||||
@@ -229,7 +236,7 @@ debug_message_store(struct gl_debug_message *msg,
|
||||
|
||||
/* malloc failed! */
|
||||
msg->message = out_of_memory;
|
||||
msg->length = strlen(out_of_memory)+1;
|
||||
msg->length = -1;
|
||||
msg->source = MESA_DEBUG_SOURCE_OTHER;
|
||||
msg->type = MESA_DEBUG_TYPE_ERROR;
|
||||
msg->id = oom_msg_id;
|
||||
@@ -243,8 +250,9 @@ debug_namespace_init(struct gl_debug_namespace *ns)
|
||||
make_empty_list(&ns->Elements);
|
||||
|
||||
/* Enable all the messages with severity HIGH or MEDIUM by default */
|
||||
ns->DefaultState = (1 << MESA_DEBUG_SEVERITY_HIGH) |
|
||||
(1 << MESA_DEBUG_SEVERITY_MEDIUM);
|
||||
ns->DefaultState = (1 << MESA_DEBUG_SEVERITY_MEDIUM ) |
|
||||
(1 << MESA_DEBUG_SEVERITY_HIGH) |
|
||||
(1 << MESA_DEBUG_SEVERITY_NOTIFICATION);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -422,7 +430,7 @@ debug_create(void)
|
||||
static bool
|
||||
debug_is_group_read_only(const struct gl_debug_state *debug)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
return (gstack > 0 && debug->Groups[gstack] == debug->Groups[gstack - 1]);
|
||||
}
|
||||
|
||||
@@ -432,7 +440,7 @@ debug_is_group_read_only(const struct gl_debug_state *debug)
|
||||
static bool
|
||||
debug_make_group_writable(struct gl_debug_state *debug)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
const struct gl_debug_group *src = debug->Groups[gstack];
|
||||
struct gl_debug_group *dst;
|
||||
int s, t;
|
||||
@@ -472,7 +480,7 @@ debug_make_group_writable(struct gl_debug_state *debug)
|
||||
static void
|
||||
debug_clear_group(struct gl_debug_state *debug)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
|
||||
if (!debug_is_group_read_only(debug)) {
|
||||
struct gl_debug_group *grp = debug->Groups[gstack];
|
||||
@@ -496,9 +504,9 @@ debug_clear_group(struct gl_debug_state *debug)
|
||||
static void
|
||||
debug_destroy(struct gl_debug_state *debug)
|
||||
{
|
||||
while (debug->GroupStackDepth > 0) {
|
||||
while (debug->CurrentGroup > 0) {
|
||||
debug_clear_group(debug);
|
||||
debug->GroupStackDepth--;
|
||||
debug->CurrentGroup--;
|
||||
}
|
||||
|
||||
debug_clear_group(debug);
|
||||
@@ -514,7 +522,7 @@ debug_set_message_enable(struct gl_debug_state *debug,
|
||||
enum mesa_debug_type type,
|
||||
GLuint id, GLboolean enabled)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
struct gl_debug_namespace *ns;
|
||||
|
||||
debug_make_group_writable(debug);
|
||||
@@ -541,7 +549,7 @@ debug_set_message_enable_all(struct gl_debug_state *debug,
|
||||
enum mesa_debug_severity severity,
|
||||
GLboolean enabled)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
int s, t, smax, tmax;
|
||||
|
||||
if (source == MESA_DEBUG_SOURCE_COUNT) {
|
||||
@@ -579,7 +587,7 @@ debug_is_message_enabled(const struct gl_debug_state *debug,
|
||||
GLuint id,
|
||||
enum mesa_debug_severity severity)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
struct gl_debug_group *grp = debug->Groups[gstack];
|
||||
struct gl_debug_namespace *nspace = &grp->Namespaces[source][type];
|
||||
|
||||
@@ -606,7 +614,7 @@ debug_log_message(struct gl_debug_state *debug,
|
||||
GLint nextEmpty;
|
||||
struct gl_debug_message *emptySlot;
|
||||
|
||||
assert(len >= 0 && len < MAX_DEBUG_MESSAGE_LENGTH);
|
||||
assert(len < MAX_DEBUG_MESSAGE_LENGTH);
|
||||
|
||||
if (log->NumMessages == MAX_DEBUG_LOGGED_MESSAGES)
|
||||
return;
|
||||
@@ -657,24 +665,24 @@ debug_delete_messages(struct gl_debug_state *debug, int count)
|
||||
static struct gl_debug_message *
|
||||
debug_get_group_message(struct gl_debug_state *debug)
|
||||
{
|
||||
return &debug->GroupMessages[debug->GroupStackDepth];
|
||||
return &debug->GroupMessages[debug->CurrentGroup];
|
||||
}
|
||||
|
||||
static void
|
||||
debug_push_group(struct gl_debug_state *debug)
|
||||
{
|
||||
const GLint gstack = debug->GroupStackDepth;
|
||||
const GLint gstack = debug->CurrentGroup;
|
||||
|
||||
/* just point to the previous stack */
|
||||
debug->Groups[gstack + 1] = debug->Groups[gstack];
|
||||
debug->GroupStackDepth++;
|
||||
debug->CurrentGroup++;
|
||||
}
|
||||
|
||||
static void
|
||||
debug_pop_group(struct gl_debug_state *debug)
|
||||
{
|
||||
debug_clear_group(debug);
|
||||
debug->GroupStackDepth--;
|
||||
debug->CurrentGroup--;
|
||||
}
|
||||
|
||||
|
||||
@@ -775,7 +783,7 @@ _mesa_get_debug_state_int(struct gl_context *ctx, GLenum pname)
|
||||
debug->Log.Messages[debug->Log.NextMessage].length : 0;
|
||||
break;
|
||||
case GL_DEBUG_GROUP_STACK_DEPTH:
|
||||
val = debug->GroupStackDepth;
|
||||
val = debug->CurrentGroup + 1;
|
||||
break;
|
||||
default:
|
||||
assert(!"unknown debug output param");
|
||||
@@ -921,9 +929,9 @@ validate_params(struct gl_context *ctx, unsigned caller,
|
||||
case GL_DEBUG_TYPE_PORTABILITY_ARB:
|
||||
case GL_DEBUG_TYPE_OTHER_ARB:
|
||||
case GL_DEBUG_TYPE_MARKER:
|
||||
break;
|
||||
case GL_DEBUG_TYPE_PUSH_GROUP:
|
||||
case GL_DEBUG_TYPE_POP_GROUP:
|
||||
break;
|
||||
case GL_DONT_CARE:
|
||||
if (caller == CONTROL)
|
||||
break;
|
||||
@@ -959,8 +967,22 @@ error:
|
||||
|
||||
|
||||
static GLboolean
|
||||
validate_length(struct gl_context *ctx, const char *callerstr, GLsizei length)
|
||||
validate_length(struct gl_context *ctx, const char *callerstr, GLsizei length,
|
||||
const GLchar *buf)
|
||||
{
|
||||
|
||||
if (length < 0) {
|
||||
GLsizei len = strlen(buf);
|
||||
|
||||
if (len >= MAX_DEBUG_MESSAGE_LENGTH) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"%s(null terminated string length=%d, is not less than "
|
||||
"GL_MAX_DEBUG_MESSAGE_LENGTH=%d)", callerstr, len,
|
||||
MAX_DEBUG_MESSAGE_LENGTH);
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (length >= MAX_DEBUG_MESSAGE_LENGTH) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"%s(length=%d, which is not less than "
|
||||
@@ -989,9 +1011,7 @@ _mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,
|
||||
if (!validate_params(ctx, INSERT, callerstr, source, type, severity))
|
||||
return; /* GL_INVALID_ENUM */
|
||||
|
||||
if (length < 0)
|
||||
length = strlen(buf);
|
||||
if (!validate_length(ctx, callerstr, length))
|
||||
if (!validate_length(ctx, callerstr, length, buf))
|
||||
return; /* GL_INVALID_VALUE */
|
||||
|
||||
log_msg(ctx, gl_enum_to_debug_source(source),
|
||||
@@ -1032,23 +1052,28 @@ _mesa_GetDebugMessageLog(GLuint count, GLsizei logSize, GLenum *sources,
|
||||
|
||||
for (ret = 0; ret < count; ret++) {
|
||||
const struct gl_debug_message *msg = debug_fetch_message(debug);
|
||||
GLsizei len;
|
||||
|
||||
if (!msg)
|
||||
break;
|
||||
|
||||
if (logSize < msg->length && messageLog != NULL)
|
||||
len = msg->length;
|
||||
if (len < 0)
|
||||
len = strlen(msg->message);
|
||||
|
||||
if (logSize < len+1 && messageLog != NULL)
|
||||
break;
|
||||
|
||||
if (messageLog) {
|
||||
assert(msg->message[msg->length-1] == '\0');
|
||||
(void) strncpy(messageLog, msg->message, (size_t)msg->length);
|
||||
assert(msg->message[len] == '\0');
|
||||
(void) strncpy(messageLog, msg->message, (size_t)len+1);
|
||||
|
||||
messageLog += msg->length;
|
||||
logSize -= msg->length;
|
||||
messageLog += len+1;
|
||||
logSize -= len+1;
|
||||
}
|
||||
|
||||
if (lengths)
|
||||
*lengths++ = msg->length;
|
||||
*lengths++ = len+1;
|
||||
if (severities)
|
||||
*severities++ = debug_severity_enums[msg->severity];
|
||||
if (sources)
|
||||
@@ -1158,16 +1183,14 @@ _mesa_PushDebugGroup(GLenum source, GLuint id, GLsizei length,
|
||||
return;
|
||||
}
|
||||
|
||||
if (length < 0)
|
||||
length = strlen(message);
|
||||
if (!validate_length(ctx, callerstr, length))
|
||||
if (!validate_length(ctx, callerstr, length, message))
|
||||
return; /* GL_INVALID_VALUE */
|
||||
|
||||
debug = _mesa_lock_debug_state(ctx);
|
||||
if (!debug)
|
||||
return;
|
||||
|
||||
if (debug->GroupStackDepth >= MAX_DEBUG_GROUP_STACK_DEPTH-1) {
|
||||
if (debug->CurrentGroup >= MAX_DEBUG_GROUP_STACK_DEPTH-1) {
|
||||
_mesa_unlock_debug_state(ctx);
|
||||
_mesa_error(ctx, GL_STACK_OVERFLOW, "%s", callerstr);
|
||||
return;
|
||||
@@ -1209,7 +1232,7 @@ _mesa_PopDebugGroup(void)
|
||||
if (!debug)
|
||||
return;
|
||||
|
||||
if (debug->GroupStackDepth <= 0) {
|
||||
if (debug->CurrentGroup <= 0) {
|
||||
_mesa_unlock_debug_state(ctx);
|
||||
_mesa_error(ctx, GL_STACK_UNDERFLOW, "%s", callerstr);
|
||||
return;
|
||||
@@ -1599,20 +1622,19 @@ _mesa_log(const char *fmtString, ...)
|
||||
* \param ctx GL context.
|
||||
* \param type The namespace to which this message belongs.
|
||||
* \param id The message ID within the given namespace.
|
||||
* \param msg The message to output. Need not be null-terminated.
|
||||
* \param len The length of 'msg'. If negative, 'msg' must be null-terminated.
|
||||
* \param msg The message to output. Must be null-terminated.
|
||||
*/
|
||||
void
|
||||
_mesa_shader_debug( struct gl_context *ctx, GLenum type, GLuint *id,
|
||||
const char *msg, int len )
|
||||
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
|
||||
const char *msg)
|
||||
{
|
||||
enum mesa_debug_source source = MESA_DEBUG_SOURCE_SHADER_COMPILER;
|
||||
enum mesa_debug_severity severity = MESA_DEBUG_SEVERITY_HIGH;
|
||||
int len;
|
||||
|
||||
debug_get_id(id);
|
||||
|
||||
if (len < 0)
|
||||
len = strlen(msg);
|
||||
len = strlen(msg);
|
||||
|
||||
/* Truncate the message if necessary. */
|
||||
if (len >= MAX_DEBUG_MESSAGE_LENGTH)
|
||||
|
@@ -115,7 +115,7 @@ _mesa_get_debug_state_ptr(struct gl_context *ctx, GLenum pname);
|
||||
|
||||
extern void
|
||||
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
|
||||
const char *msg, int len);
|
||||
const char *msg);
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,
|
||||
|
@@ -258,7 +258,7 @@ EXT(INGR_blend_func_separate , EXT_blend_func_separate
|
||||
EXT(INTEL_performance_query , INTEL_performance_query , GLL, GLC, x , ES2, 2013)
|
||||
|
||||
EXT(KHR_context_flush_control , dummy_true , GLL, GLC, x , ES2, 2014)
|
||||
EXT(KHR_debug , dummy_true , GLL, GLC, ES1, ES2, 2012)
|
||||
EXT(KHR_debug , dummy_true , GLL, GLC, 11, ES2, 2012)
|
||||
EXT(KHR_texture_compression_astc_hdr , KHR_texture_compression_astc_hdr , GLL, GLC, x , ES2, 2012)
|
||||
EXT(KHR_texture_compression_astc_ldr , KHR_texture_compression_astc_ldr , GLL, GLC, x , ES2, 2012)
|
||||
|
||||
|
@@ -851,8 +851,8 @@ descriptor=[
|
||||
[ "MAX_VIEWPORTS", "CONTEXT_INT(Const.MaxViewports), extra_ARB_viewport_array" ],
|
||||
[ "VIEWPORT_SUBPIXEL_BITS", "CONTEXT_INT(Const.ViewportSubpixelBits), extra_ARB_viewport_array" ],
|
||||
[ "VIEWPORT_BOUNDS_RANGE", "CONTEXT_FLOAT2(Const.ViewportBounds), extra_ARB_viewport_array" ],
|
||||
[ "LAYER_PROVOKING_VERTEX", "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array" ],
|
||||
[ "VIEWPORT_INDEX_PROVOKING_VERTEX", "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array" ],
|
||||
[ "LAYER_PROVOKING_VERTEX", "CONTEXT_ENUM(Const.LayerAndVPIndexProvokingVertex), extra_ARB_viewport_array" ],
|
||||
[ "VIEWPORT_INDEX_PROVOKING_VERTEX", "CONTEXT_ENUM(Const.LayerAndVPIndexProvokingVertex), extra_ARB_viewport_array" ],
|
||||
|
||||
# GL_ARB_gpu_shader5
|
||||
[ "MAX_GEOMETRY_SHADER_INVOCATIONS", "CONST(MAX_GEOMETRY_SHADER_INVOCATIONS), extra_ARB_gpu_shader5" ],
|
||||
|
@@ -3449,6 +3449,9 @@ struct gl_constants
|
||||
/** GL_EXT_provoking_vertex */
|
||||
GLboolean QuadsFollowProvokingVertexConvention;
|
||||
|
||||
/** GL_ARB_viewport_array */
|
||||
GLenum LayerAndVPIndexProvokingVertex;
|
||||
|
||||
/** OpenGL version 3.0 */
|
||||
GLbitfield ContextFlags; /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */
|
||||
|
||||
|
@@ -1937,7 +1937,8 @@ const struct function gles11_functions_possible[] = {
|
||||
{ "glGetLightxv", 11, -1 },
|
||||
{ "glGetMaterialfv", 11, _gloffset_GetMaterialfv },
|
||||
{ "glGetMaterialxv", 11, -1 },
|
||||
{ "glGetPointerv", 11, _gloffset_GetPointerv },
|
||||
// We check for the aliased -KHR version in GLES 1.1
|
||||
// { "glGetPointerv", 11, _gloffset_GetPointerv },
|
||||
{ "glGetRenderbufferParameterivOES", 11, -1 },
|
||||
{ "glGetString", 11, _gloffset_GetString },
|
||||
{ "glGetTexEnvfv", 11, _gloffset_GetTexEnvfv },
|
||||
@@ -2049,6 +2050,7 @@ const struct function gles11_functions_possible[] = {
|
||||
{ "glGetDebugMessageLogKHR", 11, -1 },
|
||||
{ "glGetObjectLabelKHR", 11, -1 },
|
||||
{ "glGetObjectPtrLabelKHR", 11, -1 },
|
||||
{ "glGetPointervKHR", 11, _gloffset_GetPointerv },
|
||||
{ "glObjectLabelKHR", 11, -1 },
|
||||
{ "glObjectPtrLabelKHR", 11, -1 },
|
||||
|
||||
@@ -2284,6 +2286,7 @@ const struct function gles2_functions_possible[] = {
|
||||
{ "glGetDebugMessageLogKHR", 20, -1 },
|
||||
{ "glGetObjectLabelKHR", 20, -1 },
|
||||
{ "glGetObjectPtrLabelKHR", 20, -1 },
|
||||
{ "glGetPointervKHR", 20, -1 },
|
||||
{ "glObjectLabelKHR", 20, -1 },
|
||||
{ "glObjectPtrLabelKHR", 20, -1 },
|
||||
|
||||
|
@@ -199,6 +199,7 @@ _mesa_override_gl_version(struct gl_context *ctx)
|
||||
* <version number><space><vendor-specific information>"
|
||||
*/
|
||||
create_version_string(ctx, _mesa_is_gles(ctx) ? "OpenGL ES " : "");
|
||||
ctx->Extensions.Version = ctx->Version;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user