Compare commits
63 Commits
mesa-8.0.3
...
mesa-8.0.4
Author | SHA1 | Date | |
---|---|---|---|
|
c1f4867c89 | ||
|
7c2225b026 | ||
|
827c99e1a0 | ||
|
0d38468098 | ||
|
fc3d2c4623 | ||
|
fe5541f64c | ||
|
1ce1a4526f | ||
|
e0e1ca353b | ||
|
04f7c32f78 | ||
|
da8d65fde4 | ||
|
57a273d89b | ||
|
099bc3aaea | ||
|
3539914e49 | ||
|
de8bb6a59b | ||
|
646ac02462 | ||
|
dad7547b98 | ||
|
2bf8f39cc8 | ||
|
5c65bcd259 | ||
|
c60a83adc2 | ||
|
db555c5d59 | ||
|
f1423b1c20 | ||
|
21d77c51c1 | ||
|
fc7d43ee9a | ||
|
ed8fcc0c82 | ||
|
ed1da7e503 | ||
|
74f21adbb7 | ||
|
09c746f2dc | ||
|
ab33bc8c7b | ||
|
1edeb2cec1 | ||
|
afaf5b59e4 | ||
|
1fc9b5a213 | ||
|
9b38691927 | ||
|
6f1218385a | ||
|
5c2f9828e0 | ||
|
a03d5e6a88 | ||
|
5fde348eb8 | ||
|
a8fed44e9e | ||
|
0f7dffae69 | ||
|
7a34e98b61 | ||
|
39a0b79c6f | ||
|
5c8f5e9af0 | ||
|
a72fdfed7b | ||
|
ba45b6deea | ||
|
04c35a5dff | ||
|
3bcddd5e89 | ||
|
313d48a110 | ||
|
076805c9c2 | ||
|
d715d3f4a8 | ||
|
af47c324aa | ||
|
1af70e475f | ||
|
1f4f86e951 | ||
|
6dd1270008 | ||
|
29c67f9203 | ||
|
29c4e92b2c | ||
|
26f7f8076d | ||
|
dc8134fe98 | ||
|
a211a140a6 | ||
|
7fd94900e0 | ||
|
e902faa18a | ||
|
cb70af5c94 | ||
|
3d657b14b4 | ||
|
84e74ca275 | ||
|
44f550ef90 |
2
Makefile
2
Makefile
@@ -184,7 +184,7 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
PACKAGE_VERSION=8.0.3
|
||||
PACKAGE_VERSION=8.0.4
|
||||
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
|
||||
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
|
||||
|
||||
|
@@ -10,7 +10,7 @@ CONFIG_NAME = default
|
||||
# Version info
|
||||
MESA_MAJOR=8
|
||||
MESA_MINOR=0
|
||||
MESA_TINY=3
|
||||
MESA_TINY=4
|
||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
|
||||
|
||||
# external projects. This should be useless now that we use libdrm.
|
||||
|
@@ -28,7 +28,9 @@ for DRI hardware acceleration.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
b7210a6d6e4584bd852ab29294ce717e MesaLib-8.0.3.tar.gz
|
||||
cc5ee15e306b8c15da6a478923797171 MesaLib-8.0.3.tar.bz2
|
||||
32773634a0f7e70a680505a81426eccf MesaLib-8.0.3.zip
|
||||
</pre>
|
||||
|
||||
<h2>New features</h2>
|
||||
|
202
docs/relnotes-8.0.4.html
Normal file
202
docs/relnotes-8.0.4.html
Normal file
@@ -0,0 +1,202 @@
|
||||
<HTML>
|
||||
|
||||
<head>
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css">
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 8.0.4 Release Notes / July 10, 2012</H1>
|
||||
|
||||
<p>
|
||||
Mesa 8.0.4 is a bug fix release which fixes bugs found since the 8.0.2 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 8.0.4 implements the OpenGL 3.0 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.0.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
</pre>
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45967">Bug 45967</a> - piglit getteximage-invalid-format-for-packed-type regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=47742">Bug 47742</a> - [softpipe] piglit fbo-generatemipmap-array regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48141">Bug 48141</a> - [vmwgfx] src/gallium/auxiliary/util/u_inlines.h:256:pipe_buffer_map_range: Assertion `offset + length <= buffer->width0' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=48472">Bug 48472</a> - GPU Lockup while running demo (rzr - the scene is dead) in wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50033">Bug 50033</a> - src/mesa/state_tracker/st_cb_fbo.c:379:st_render_texture: Assertion `strb->rtt_level <= strb->texture->last_level' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50621">Bug 50621</a> - Mesa fails its test suite with a buffer overflow.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=50298">Bug 50298</a> - [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=51574">Bug 51574</a> - ir_loop_jump constructor assigns member variable to itself</li>
|
||||
|
||||
<!-- <li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=">Bug </a> - </li> -->
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>The full set of changes can be viewed by using the following GIT command:</p>
|
||||
|
||||
<pre>
|
||||
git log mesa-8.0.3..mesa-8.0.4
|
||||
</pre>
|
||||
|
||||
<p>Andreas Betz (1):
|
||||
<ul>
|
||||
<li>vega: fix 565 color unpacking bug</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Antoine Labour (2):
|
||||
<ul>
|
||||
<li>meta: Cleanup the resources we allocate.</li>
|
||||
<li>mesa: Free uniforms correclty.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Brian Paul (22):
|
||||
<ul>
|
||||
<li>docs: add link to 8.0.3 release notes</li>
|
||||
<li>mesa: fix Z32_FLOAT -> uint conversion functions</li>
|
||||
<li>draw: fix primitive restart bug by using the index buffer offset</li>
|
||||
<li>st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output</li>
|
||||
<li>svga: fix synchronization bug between sampler views and surfaces</li>
|
||||
<li>mesa: new _mesa_error_check_format_and_type() function</li>
|
||||
<li>mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case</li>
|
||||
<li>mesa: fix missing return value in getteximage_error_check()</li>
|
||||
<li>st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers</li>
|
||||
<li>svga: add 0.5 in float->int conversion of sample min/max lod</li>
|
||||
<li>svga: fix min/max lod clamping</li>
|
||||
<li>svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0</li>
|
||||
<li>st/mesa: add fallback pipe formats for (compressed) R, RG formats</li>
|
||||
<li>st/mesa: copy num_immediates field when copying the immediates array</li>
|
||||
<li>svga: move svga_texture() casts/calls in svga_surface_copy()</li>
|
||||
<li>svga: reset vertex buffer offset in svga_release_user_upl_buffers()</li>
|
||||
<li>st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers</li>
|
||||
<li>st/mesa: use private pipe_sampler_view in decompress_with_blit()</li>
|
||||
<li>st/mesa: add null pointer check in st_texture_image_map()</li>
|
||||
<li>st/mesa: fix mipmap image size computation w.r.t. texture arrays</li>
|
||||
<li>draw: fix missing immediates bug in polygon stipple code</li>
|
||||
<li>st/mesa: fix max_offset computation for base vertex</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Christoph Bumiller (1):
|
||||
<ul>
|
||||
<li>nv50: handle NEG,ABS modifiers for short RCP encoding</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Dylan Noblesmith (1):
|
||||
<ul>
|
||||
<li>mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Eric Anholt (1):
|
||||
<ul>
|
||||
<li>i965/vs: Fix texelFetchOffset()</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Ian Romanick (5):
|
||||
<ul>
|
||||
<li>docs: Add 8.0.3 release md5sums</li>
|
||||
<li>glx/tests: Fix off-by-one error in allocating extension string buffer</li>
|
||||
<li>glsl: Remove spurious printf messages</li>
|
||||
<li>glsl: Fix pi/2 constant in acos built-in function</li>
|
||||
<li>mesa: Bump version number to 8.0.4</li>
|
||||
</ul></p>
|
||||
|
||||
<p>José Fonseca (2):
|
||||
<ul>
|
||||
<li>mesa: Avoid void acinclude.m4 Android.common.mk Android.mk autogen.sh bin common.py configs configure.ac docs doxygen include Makefile scons SConstruct src tests arithmetic.</li>
|
||||
<li>draw: Ensure that prepare is always run after LLVM garbagge collection.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kenneth Graunke (15):
|
||||
<ul>
|
||||
<li>mesa: Check for a negative "size" parameter in glCopyBufferSubData().</li>
|
||||
<li>i965: Fix brw_swap_cmod() for LE/GE comparisons.</li>
|
||||
<li>glsl: Remove unused ir_loop_jump::loop pointer.</li>
|
||||
<li>ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.</li>
|
||||
<li>mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).</li>
|
||||
<li>glsl/builtins: Fix textureGrad() for Array samplers.</li>
|
||||
<li>mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.</li>
|
||||
<li>mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.</li>
|
||||
<li>mesa: Unbind ARB_transform_feedback2 binding points on Delete too.</li>
|
||||
<li>meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().</li>
|
||||
<li>i965/fs: Fix texelFetchOffset() on pre-Gen7.</li>
|
||||
<li>i965/vs: Fix texelFetchOffset() on pre-Gen7.</li>
|
||||
<li>i965/fs: Fix user-defined FS outputs with less than four components.</li>
|
||||
<li>glsl: Hook up loop_variable_state destructor to plug a memory leak.</li>
|
||||
<li>glsl: Don't trust loop analysis in the presence of function calls.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Kurt Roeckx (1):
|
||||
<ul>
|
||||
<li>i830: Fix crash for GL_STENCIL_TEST in i830Enable()</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Lukas Rössler (1):
|
||||
<ul>
|
||||
<li>glu: fix two Clang warnings</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Marek Olšák (2):
|
||||
<ul>
|
||||
<li>mesa: allow exposing GL3 without EXT_texture_integer</li>
|
||||
<li>st/mesa: don't do srgb->linear conversion in decompress_with_blit</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Paul Seidler (1):
|
||||
<ul>
|
||||
<li>tests: include mesa headers</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Stéphane Marchesin (3):
|
||||
<ul>
|
||||
<li>glx: Handle a null reply in QueryVersion.</li>
|
||||
<li>i915g: Don't invert signalled/unsignalled fences</li>
|
||||
<li>i915g: Don't avoid flushing when we have a pending fence.</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Thomas Gstädtner (1):
|
||||
<ul>
|
||||
<li>gallium/targets: pass ldflags parameter to MKLIB</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vadim Girlin (2):
|
||||
<ul>
|
||||
<li>st/mesa: set stObj->lastLevel in guess_and_alloc_texture</li>
|
||||
<li>r600g: check gpr count limit</li>
|
||||
</ul></p>
|
||||
|
||||
<p>Vinson Lee (1):
|
||||
<ul>
|
||||
<li>st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.</li>
|
||||
</ul></p>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -13,6 +13,8 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-8.0.4.html">8.0.4 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.3.html">8.0.3 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.2.html">8.0.2 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.1.html">8.0.1 release notes</A>
|
||||
<LI><A HREF="relnotes-8.0.html">8.0 release notes</A>
|
||||
|
@@ -65,8 +65,13 @@ static void
|
||||
draw_llvm_garbage_collect_callback(void *cb_data)
|
||||
{
|
||||
struct draw_llvm *llvm = (struct draw_llvm *) cb_data;
|
||||
struct draw_context *draw = llvm->draw;
|
||||
struct draw_llvm_variant_list_item *li;
|
||||
|
||||
/* Ensure prepare will be run and shaders recompiled */
|
||||
assert(!draw->suspend_flushing);
|
||||
draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE);
|
||||
|
||||
/* free all shader variants */
|
||||
li = first_elem(&llvm->vs_variants_list);
|
||||
while (!at_end(&llvm->vs_variants_list, li)) {
|
||||
|
@@ -165,11 +165,16 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TGSI immediate declaration transform callback.
|
||||
* We're just counting the number of immediates here.
|
||||
*/
|
||||
static void
|
||||
pstip_transform_immed(struct tgsi_transform_context *ctx,
|
||||
struct tgsi_full_immediate *immed)
|
||||
{
|
||||
struct pstip_transform_context *pctx = (struct pstip_transform_context *) ctx;
|
||||
ctx->emit_immediate(ctx, immed); /* emit to output shader */
|
||||
pctx->numImmed++;
|
||||
}
|
||||
|
||||
|
@@ -329,25 +329,28 @@ draw_pt_arrays_restart(struct draw_context *draw,
|
||||
|
||||
if (draw->pt.user.elts) {
|
||||
/* indexed prims (draw_elements) */
|
||||
const char *elts =
|
||||
(const char *) draw->pt.user.elts + draw->pt.index_buffer.offset;
|
||||
|
||||
cur_start = start;
|
||||
cur_count = 0;
|
||||
|
||||
switch (draw->pt.user.eltSize) {
|
||||
case 1:
|
||||
{
|
||||
const ubyte *elt_ub = (const ubyte *) draw->pt.user.elts;
|
||||
const ubyte *elt_ub = (const ubyte *) elts;
|
||||
PRIM_RESTART_LOOP(elt_ub);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
const ushort *elt_us = (const ushort *) draw->pt.user.elts;
|
||||
const ushort *elt_us = (const ushort *) elts;
|
||||
PRIM_RESTART_LOOP(elt_us);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
const uint *elt_ui = (const uint *) draw->pt.user.elts;
|
||||
const uint *elt_ui = (const uint *) elts;
|
||||
PRIM_RESTART_LOOP(elt_ui);
|
||||
}
|
||||
break;
|
||||
|
@@ -45,7 +45,10 @@ static void i915_flush_pipe( struct pipe_context *pipe,
|
||||
|
||||
draw_flush(i915->draw);
|
||||
|
||||
if (i915->batch->map == i915->batch->ptr) {
|
||||
/* Only shortcut this if we have no fence, otherwise we must flush the
|
||||
* empty batchbuffer to get our fence back.
|
||||
*/
|
||||
if (!fence && i915->batch && (i915->batch->map == i915->batch->ptr)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -368,7 +368,7 @@ i915_fence_signalled(struct pipe_screen *screen,
|
||||
{
|
||||
struct i915_screen *is = i915_screen(screen);
|
||||
|
||||
return is->iws->fence_signalled(is->iws, fence) == 0;
|
||||
return is->iws->fence_signalled(is->iws, fence) == 1;
|
||||
}
|
||||
|
||||
static boolean
|
||||
@@ -378,7 +378,7 @@ i915_fence_finish(struct pipe_screen *screen,
|
||||
{
|
||||
struct i915_screen *is = i915_screen(screen);
|
||||
|
||||
return is->iws->fence_finish(is->iws, fence) == 0;
|
||||
return is->iws->fence_finish(is->iws, fence) == 1;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -865,8 +865,10 @@ emit_flop(struct nv_pc *pc, struct nv_instruction *i)
|
||||
assert(SFILE(i, 0) == NV_FILE_GPR);
|
||||
|
||||
if (!i->is_long) {
|
||||
assert(i->opcode == NV_OP_RCP);
|
||||
emit_form_MUL(pc, i);
|
||||
assert(i->opcode == NV_OP_RCP && !src0->mod);
|
||||
if (src0->mod & NV_MOD_NEG) pc->emit[0] |= 0x00400000;
|
||||
if (src0->mod & NV_MOD_ABS) pc->emit[0] |= 0x00008000;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1277,6 +1277,14 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
|
||||
if (ctx.bc->chip_class == CAYMAN)
|
||||
cm_bytecode_add_cf_end(ctx.bc);
|
||||
|
||||
/* check GPR limit - we have 124 = 128 - 4
|
||||
* (4 are reserved as alu clause temporary registers) */
|
||||
if (ctx.bc->ngpr > 124) {
|
||||
R600_ERR("GPR limit exceeded - shader requires %d registers\n", ctx.bc->ngpr);
|
||||
r = -ENOMEM;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
free(ctx.literals);
|
||||
tgsi_parse_free(&ctx.parse);
|
||||
return 0;
|
||||
|
@@ -44,8 +44,7 @@ static void svga_surface_copy(struct pipe_context *pipe,
|
||||
const struct pipe_box *src_box)
|
||||
{
|
||||
struct svga_context *svga = svga_context(pipe);
|
||||
struct svga_texture *stex = svga_texture(src_tex);
|
||||
struct svga_texture *dtex = svga_texture(dst_tex);
|
||||
struct svga_texture *stex, *dtex;
|
||||
/* struct pipe_screen *screen = pipe->screen;
|
||||
SVGA3dCopyBox *box;
|
||||
enum pipe_error ret;
|
||||
@@ -63,6 +62,9 @@ static void svga_surface_copy(struct pipe_context *pipe,
|
||||
return;
|
||||
}
|
||||
|
||||
stex = svga_texture(src_tex);
|
||||
dtex = svga_texture(dst_tex);
|
||||
|
||||
#if 0
|
||||
srcsurf = screen->get_tex_surface(screen, src_tex,
|
||||
src_level, src_box->z, src_box->z,
|
||||
|
@@ -201,6 +201,17 @@ svga_release_user_upl_buffers(struct svga_context *svga)
|
||||
if (vb->buffer && svga_buffer_is_user_buffer(vb->buffer)) {
|
||||
struct svga_buffer *buffer = svga_buffer(vb->buffer);
|
||||
|
||||
/* The buffer_offset is relative to the uploaded buffer.
|
||||
* Since we're discarding that buffer we need to reset this offset
|
||||
* so it's not inadvertantly applied to a subsequent draw.
|
||||
*
|
||||
* XXX a root problem here is that the svga->curr.vb[] information
|
||||
* is getting set both by gallium API calls and by code in
|
||||
* svga_upload_user_buffers(). We should instead have two copies
|
||||
* of the vertex buffer information and choose between as needed.
|
||||
*/
|
||||
vb->buffer_offset = 0;
|
||||
|
||||
buffer->uploaded.start = ~0;
|
||||
buffer->uploaded.end = 0;
|
||||
if (buffer->uploaded.buffer)
|
||||
|
@@ -125,8 +125,8 @@ svga_create_sampler_state(struct pipe_context *pipe,
|
||||
* - min/max LOD clamping
|
||||
*/
|
||||
cso->min_lod = 0;
|
||||
cso->view_min_lod = MAX2(sampler->min_lod, 0);
|
||||
cso->view_max_lod = MAX2(sampler->max_lod, 0);
|
||||
cso->view_min_lod = MAX2((int) (sampler->min_lod + 0.5), 0);
|
||||
cso->view_max_lod = MAX2((int) (sampler->max_lod + 0.5), 0);
|
||||
|
||||
/* Use min_mipmap */
|
||||
if (svga->debug.use_min_mipmap) {
|
||||
|
@@ -120,7 +120,7 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
|
||||
return result.u;
|
||||
|
||||
case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
|
||||
return 16.0;
|
||||
return 15.0;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
|
@@ -82,12 +82,14 @@ update_tss_binding(struct svga_context *svga,
|
||||
const struct svga_sampler_state *s = svga->curr.sampler[i];
|
||||
struct svga_hw_view_state *view = &svga->state.hw_draw.views[i];
|
||||
struct pipe_resource *texture = NULL;
|
||||
struct pipe_sampler_view *sv = svga->curr.sampler_views[i];
|
||||
|
||||
/* get min max lod */
|
||||
if (svga->curr.sampler_views[i]) {
|
||||
min_lod = MAX2(s->view_min_lod, 0);
|
||||
max_lod = MIN2(s->view_max_lod, svga->curr.sampler_views[i]->texture->last_level);
|
||||
texture = svga->curr.sampler_views[i]->texture;
|
||||
if (sv) {
|
||||
min_lod = MAX2(0, (s->view_min_lod + sv->u.tex.first_level));
|
||||
max_lod = MIN2(s->view_max_lod, sv->texture->last_level);
|
||||
max_lod += sv->u.tex.first_level;
|
||||
texture = sv->texture;
|
||||
} else {
|
||||
min_lod = 0;
|
||||
max_lod = 0;
|
||||
|
@@ -320,6 +320,11 @@ svga_mark_surface_dirty(struct pipe_surface *surf)
|
||||
else {
|
||||
/* this will happen later in svga_propagate_surface */
|
||||
}
|
||||
|
||||
/* Increment the view_age and texture age for this surface's slice
|
||||
* so that any sampler views into the texture are re-validated too.
|
||||
*/
|
||||
tex->view_age[surf->u.tex.first_layer] = ++(tex->age);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -526,8 +526,8 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx,
|
||||
src += offset;
|
||||
for (i = 0; i < n; ++i) {
|
||||
VGfloat clr[4];
|
||||
clr[0] = ((*src >> 10) & 31)/31.;
|
||||
clr[1] = ((*src >> 5) & 95)/95.;
|
||||
clr[0] = ((*src >> 11) & 31)/31.;
|
||||
clr[1] = ((*src >> 5) & 63)/63.;
|
||||
clr[2] = ((*src >> 0) & 31)/31.;
|
||||
clr[3] = 1.f;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ endif
|
||||
default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
|
||||
|
||||
$(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES)
|
||||
$(MKLIB) -linker '$(LD)' -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
|
||||
$(MKLIB) -linker '$(LD)' -noprefix -o $@ -ldflags '$(LDFLAGS)' $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
|
||||
|
||||
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
|
||||
rm -f depend
|
||||
|
@@ -3735,13 +3735,10 @@ ast_case_label::hir(exec_list *instructions,
|
||||
instructions->push_tail(set_fallthru_on_test);
|
||||
} else { /* default case */
|
||||
if (state->switch_state.previous_default) {
|
||||
printf("a\n");
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"multiple default labels in one switch");
|
||||
|
||||
printf("b\n");
|
||||
|
||||
loc = state->switch_state.previous_default->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"this is the first default label");
|
||||
|
@@ -2,21 +2,21 @@
|
||||
(signature float
|
||||
(parameters
|
||||
(declare (in) float x))
|
||||
((return (expression float - (constant float (1.5707963))
|
||||
((return (expression float - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
(signature vec2
|
||||
(parameters
|
||||
(declare (in) vec2 x))
|
||||
((return (expression vec2 - (constant float (1.5707963))
|
||||
((return (expression vec2 - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
(signature vec3
|
||||
(parameters
|
||||
(declare (in) vec3 x))
|
||||
((return (expression vec3 - (constant float (1.5707963))
|
||||
((return (expression vec3 - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
(signature vec4
|
||||
(parameters
|
||||
(declare (in) vec4 x))
|
||||
((return (expression vec4 - (constant float (1.5707963))
|
||||
((return (expression vec4 - (constant float (1.5707964))
|
||||
(call asin ((var_ref x)))))))
|
||||
))
|
||||
|
@@ -54,7 +54,7 @@ def get_txs_dim(sampler_type):
|
||||
def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
|
||||
coord_dim = get_coord_dim(sampler_type)
|
||||
extra_dim = get_extra_dim(sampler_type, variant & Proj, unused_fields)
|
||||
offset_dim = get_sampler_dim(sampler_type)
|
||||
sampler_dim = get_sampler_dim(sampler_type)
|
||||
|
||||
if variant & Single:
|
||||
return_type = "float"
|
||||
@@ -74,12 +74,12 @@ def generate_sigs(g, tex_inst, sampler_type, variant = 0, unused_fields = 0):
|
||||
elif tex_inst == "txf" or tex_inst == "txs":
|
||||
print "\n (declare (in) int lod)",
|
||||
elif tex_inst == "txd":
|
||||
grad_type = vec_type("", coord_dim)
|
||||
grad_type = vec_type("", sampler_dim)
|
||||
print "\n (declare (in) " + grad_type + " dPdx)",
|
||||
print "\n (declare (in) " + grad_type + " dPdy)",
|
||||
|
||||
if variant & Offset:
|
||||
print "\n (declare (const_in) " + vec_type("i", offset_dim) + " offset)",
|
||||
print "\n (declare (const_in) " + vec_type("i", sampler_dim) + " offset)",
|
||||
if tex_inst == "txb":
|
||||
print "\n (declare (in) float bias)",
|
||||
|
||||
|
@@ -1158,7 +1158,6 @@ public:
|
||||
{
|
||||
this->ir_type = ir_type_loop_jump;
|
||||
this->mode = mode;
|
||||
this->loop = loop;
|
||||
}
|
||||
|
||||
virtual ir_loop_jump *clone(void *mem_ctx, struct hash_table *) const;
|
||||
@@ -1182,9 +1181,6 @@ public:
|
||||
|
||||
/** Mode selector for the jump instruction. */
|
||||
enum jump_mode mode;
|
||||
private:
|
||||
/** Loop containing this break instruction. */
|
||||
ir_loop *loop;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -110,6 +110,8 @@ public:
|
||||
virtual ir_visitor_status visit(ir_loop_jump *);
|
||||
virtual ir_visitor_status visit(ir_dereference_variable *);
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_call *);
|
||||
|
||||
virtual ir_visitor_status visit_enter(ir_loop *);
|
||||
virtual ir_visitor_status visit_leave(ir_loop *);
|
||||
virtual ir_visitor_status visit_enter(ir_assignment *);
|
||||
@@ -152,6 +154,21 @@ loop_analysis::visit(ir_loop_jump *ir)
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
loop_analysis::visit_enter(ir_call *ir)
|
||||
{
|
||||
/* If we're not somewhere inside a loop, there's nothing to do. */
|
||||
if (this->state.is_empty())
|
||||
return visit_continue;
|
||||
|
||||
loop_variable_state *const ls =
|
||||
(loop_variable_state *) this->state.get_head();
|
||||
|
||||
ls->contains_calls = true;
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
|
||||
ir_visitor_status
|
||||
loop_analysis::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
@@ -209,6 +226,17 @@ loop_analysis::visit_leave(ir_loop *ir)
|
||||
loop_variable_state *const ls =
|
||||
(loop_variable_state *) this->state.pop_head();
|
||||
|
||||
/* Function calls may contain side effects. These could alter any of our
|
||||
* variables in ways that cannot be known, and may even terminate shader
|
||||
* execution (say, calling discard in the fragment shader). So we can't
|
||||
* rely on any of our analysis about assignments to variables.
|
||||
*
|
||||
* We could perform some conservative analysis (prove there's no statically
|
||||
* possible assignment, etc.) but it isn't worth it for now; function
|
||||
* inlining will allow us to unroll loops anyway.
|
||||
*/
|
||||
if (ls->contains_calls)
|
||||
return visit_continue;
|
||||
|
||||
foreach_list(node, &ir->body_instructions) {
|
||||
/* Skip over declarations at the start of a loop.
|
||||
|
@@ -122,10 +122,16 @@ public:
|
||||
*/
|
||||
unsigned num_loop_jumps;
|
||||
|
||||
/**
|
||||
* Whether this loop contains any function calls.
|
||||
*/
|
||||
bool contains_calls;
|
||||
|
||||
loop_variable_state()
|
||||
{
|
||||
this->max_iterations = -1;
|
||||
this->num_loop_jumps = 0;
|
||||
this->contains_calls = false;
|
||||
this->var_hash = hash_table_ctor(0, hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
}
|
||||
@@ -134,6 +140,23 @@ public:
|
||||
{
|
||||
hash_table_dtor(this->var_hash);
|
||||
}
|
||||
|
||||
static void* operator new(size_t size, void *ctx)
|
||||
{
|
||||
void *lvs = ralloc_size(ctx, size);
|
||||
assert(lvs != NULL);
|
||||
|
||||
ralloc_set_destructor(lvs, (void (*)(void*)) destructor);
|
||||
|
||||
return lvs;
|
||||
}
|
||||
|
||||
private:
|
||||
static void
|
||||
destructor(loop_variable_state *lvs)
|
||||
{
|
||||
lvs->~loop_variable_state();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@@ -278,7 +278,7 @@ ralloc_parent(const void *ptr)
|
||||
return NULL;
|
||||
|
||||
info = get_header(ptr);
|
||||
return PTR_FROM_HEADER(info->parent);
|
||||
return info->parent ? PTR_FROM_HEADER(info->parent) : NULL;
|
||||
}
|
||||
|
||||
static void *autofree_context = NULL;
|
||||
|
@@ -90,7 +90,7 @@ Mapdesc::setBboxsize( INREAL *mat )
|
||||
void
|
||||
Mapdesc::identify( REAL dest[MAXCOORDS][MAXCOORDS] )
|
||||
{
|
||||
memset( dest, 0, sizeof( dest ) );
|
||||
memset( dest, 0, sizeof( REAL ) * MAXCOORDS * MAXCOORDS );
|
||||
for( int i=0; i != hcoords; i++ )
|
||||
dest[i][i] = 1.0;
|
||||
}
|
||||
|
@@ -505,7 +505,7 @@ NurbsTessellator::do_pwlcurve( O_pwlcurve *o_pwlcurve )
|
||||
o_pwlcurve->owner = currentCurve;
|
||||
}
|
||||
|
||||
if( (inCurve == 2) )
|
||||
if( inCurve == 2 )
|
||||
endcurve();
|
||||
}
|
||||
|
||||
|
@@ -293,6 +293,9 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
|
||||
GLX_MINOR_VERSION),
|
||||
NULL);
|
||||
|
||||
if (!reply)
|
||||
return GL_FALSE;
|
||||
|
||||
if (reply->major_version != GLX_MAJOR_VERSION) {
|
||||
free(reply);
|
||||
return GL_FALSE;
|
||||
|
@@ -315,6 +315,10 @@ struct gl_meta_state
|
||||
struct drawtex_state DrawTex; /**< For _mesa_meta_DrawTex() */
|
||||
};
|
||||
|
||||
static void meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit);
|
||||
static void cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex);
|
||||
static void meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear);
|
||||
|
||||
static GLuint
|
||||
compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB *source)
|
||||
{
|
||||
@@ -331,12 +335,16 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
|
||||
return shader;
|
||||
|
||||
_mesa_GetShaderiv(shader, GL_INFO_LOG_LENGTH, &size);
|
||||
if (size == 0)
|
||||
if (size == 0) {
|
||||
_mesa_DeleteObjectARB(shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
info = malloc(size);
|
||||
if (!info)
|
||||
if (!info) {
|
||||
_mesa_DeleteObjectARB(shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_mesa_GetProgramInfoLog(shader, size, NULL, info);
|
||||
_mesa_problem(ctx,
|
||||
@@ -345,6 +353,7 @@ compile_shader_with_debug(struct gl_context *ctx, GLenum target, const GLcharARB
|
||||
info, source);
|
||||
|
||||
free(info);
|
||||
_mesa_DeleteObjectARB(shader);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -397,10 +406,15 @@ _mesa_meta_init(struct gl_context *ctx)
|
||||
void
|
||||
_mesa_meta_free(struct gl_context *ctx)
|
||||
{
|
||||
/* Note: Any textures, VBOs, etc, that we allocate should get
|
||||
* freed by the normal context destruction code. But this would be
|
||||
* the place to free other meta data someday.
|
||||
*/
|
||||
GET_CURRENT_CONTEXT(old_context);
|
||||
_mesa_make_current(ctx, NULL, NULL);
|
||||
meta_glsl_blit_cleanup(ctx, &ctx->Meta->Blit);
|
||||
meta_glsl_clear_cleanup(ctx, &ctx->Meta->Clear);
|
||||
cleanup_temp_texture(ctx, &ctx->Meta->TempTex);
|
||||
if (old_context)
|
||||
_mesa_make_current(old_context, old_context->WinSysDrawBuffer, old_context->WinSysReadBuffer);
|
||||
else
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
free(ctx->Meta);
|
||||
ctx->Meta = NULL;
|
||||
}
|
||||
@@ -1056,6 +1070,15 @@ init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
|
||||
_mesa_GenTextures(1, &tex->TexObj);
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
|
||||
{
|
||||
if (!tex->TexObj)
|
||||
return;
|
||||
_mesa_DeleteTextures(1, &tex->TexObj);
|
||||
tex->TexObj = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return pointer to temp_texture info for non-bitmap ops.
|
||||
@@ -1592,6 +1615,21 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_glsl_blit_cleanup(struct gl_context *ctx, struct blit_state *blit)
|
||||
{
|
||||
if (blit->ArrayObj) {
|
||||
_mesa_DeleteVertexArraysAPPLE(1, &blit->ArrayObj);
|
||||
blit->ArrayObj = 0;
|
||||
_mesa_DeleteBuffersARB(1, &blit->VBO);
|
||||
blit->VBO = 0;
|
||||
}
|
||||
if (blit->DepthFP) {
|
||||
_mesa_DeletePrograms(1, &blit->DepthFP);
|
||||
blit->DepthFP = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
|
||||
@@ -1774,7 +1812,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
|
||||
clear->ShaderProg = _mesa_CreateProgramObjectARB();
|
||||
_mesa_AttachShader(clear->ShaderProg, fs);
|
||||
_mesa_DeleteObjectARB(fs);
|
||||
_mesa_AttachShader(clear->ShaderProg, vs);
|
||||
_mesa_DeleteObjectARB(vs);
|
||||
_mesa_BindAttribLocationARB(clear->ShaderProg, 0, "position");
|
||||
_mesa_LinkProgramARB(clear->ShaderProg);
|
||||
|
||||
@@ -1787,7 +1827,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
|
||||
clear->IntegerShaderProg = _mesa_CreateProgramObjectARB();
|
||||
_mesa_AttachShader(clear->IntegerShaderProg, fs);
|
||||
_mesa_DeleteObjectARB(fs);
|
||||
_mesa_AttachShader(clear->IntegerShaderProg, vs);
|
||||
_mesa_DeleteObjectARB(vs);
|
||||
_mesa_BindAttribLocationARB(clear->IntegerShaderProg, 0, "position");
|
||||
|
||||
/* Note that user-defined out attributes get automatically assigned
|
||||
@@ -1802,6 +1844,24 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_glsl_clear_cleanup(struct gl_context *ctx, struct clear_state *clear)
|
||||
{
|
||||
if (clear->ArrayObj == 0)
|
||||
return;
|
||||
_mesa_DeleteVertexArraysAPPLE(1, &clear->ArrayObj);
|
||||
clear->ArrayObj = 0;
|
||||
_mesa_DeleteBuffersARB(1, &clear->VBO);
|
||||
clear->VBO = 0;
|
||||
_mesa_DeleteObjectARB(clear->ShaderProg);
|
||||
clear->ShaderProg = 0;
|
||||
|
||||
if (clear->IntegerShaderProg) {
|
||||
_mesa_DeleteObjectARB(clear->IntegerShaderProg);
|
||||
clear->IntegerShaderProg = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Meta implementation of ctx->Driver.Clear() in terms of polygon rendering.
|
||||
*/
|
||||
@@ -3256,6 +3316,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
};
|
||||
struct vertex verts[4];
|
||||
GLuint fboDrawSave, fboReadSave;
|
||||
GLuint rbSave;
|
||||
|
||||
if (slice > 0) {
|
||||
assert(target == GL_TEXTURE_3D ||
|
||||
@@ -3272,6 +3333,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
/* save fbo bindings (not saved by _mesa_meta_begin()) */
|
||||
fboDrawSave = ctx->DrawBuffer->Name;
|
||||
fboReadSave = ctx->ReadBuffer->Name;
|
||||
rbSave = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0;
|
||||
|
||||
_mesa_meta_begin(ctx, MESA_META_ALL & ~MESA_META_PIXEL_STORE);
|
||||
|
||||
@@ -3292,6 +3354,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
|
||||
/* alloc dest surface */
|
||||
if (width > decompress->Width || height > decompress->Height) {
|
||||
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, decompress->RBO);
|
||||
_mesa_RenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA,
|
||||
width, height);
|
||||
decompress->Width = width;
|
||||
@@ -3424,6 +3487,7 @@ decompress_texture_image(struct gl_context *ctx,
|
||||
_mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fboDrawSave);
|
||||
_mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fboReadSave);
|
||||
}
|
||||
_mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, rbSave);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -861,7 +861,7 @@ i830Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
|
||||
if (ctx->DrawBuffer) {
|
||||
struct intel_renderbuffer *irbStencil
|
||||
= intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
|
||||
hw_stencil = (irbStencil && irbStencil->mt->region);
|
||||
hw_stencil = (irbStencil && irbStencil->mt);
|
||||
}
|
||||
if (hw_stencil) {
|
||||
I830_STATECHANGE(i830, I830_UPLOAD_CTX);
|
||||
|
@@ -47,13 +47,13 @@ brw_swap_cmod(uint32_t cmod)
|
||||
case BRW_CONDITIONAL_NZ:
|
||||
return cmod;
|
||||
case BRW_CONDITIONAL_G:
|
||||
return BRW_CONDITIONAL_LE;
|
||||
case BRW_CONDITIONAL_GE:
|
||||
return BRW_CONDITIONAL_L;
|
||||
case BRW_CONDITIONAL_GE:
|
||||
return BRW_CONDITIONAL_LE;
|
||||
case BRW_CONDITIONAL_L:
|
||||
return BRW_CONDITIONAL_GE;
|
||||
case BRW_CONDITIONAL_LE:
|
||||
return BRW_CONDITIONAL_G;
|
||||
case BRW_CONDITIONAL_LE:
|
||||
return BRW_CONDITIONAL_GE;
|
||||
default:
|
||||
return ~0;
|
||||
}
|
||||
|
@@ -617,6 +617,7 @@ public:
|
||||
struct hash_table *variable_ht;
|
||||
ir_variable *frag_depth;
|
||||
fs_reg outputs[BRW_MAX_DRAW_BUFFERS];
|
||||
unsigned output_components[BRW_MAX_DRAW_BUFFERS];
|
||||
int first_non_payload_grf;
|
||||
int max_grf;
|
||||
int urb_setup[FRAG_ATTRIB_MAX];
|
||||
|
@@ -76,6 +76,7 @@ fs_visitor::visit(ir_variable *ir)
|
||||
/* Writing gl_FragColor outputs to all color regions. */
|
||||
for (int i = 0; i < MAX2(c->key.nr_color_regions, 1); i++) {
|
||||
this->outputs[i] = *reg;
|
||||
this->output_components[i] = 4;
|
||||
}
|
||||
} else if (ir->location == FRAG_RESULT_DEPTH) {
|
||||
this->frag_depth = ir;
|
||||
@@ -84,11 +85,16 @@ fs_visitor::visit(ir_variable *ir)
|
||||
assert(ir->location >= FRAG_RESULT_DATA0 &&
|
||||
ir->location < FRAG_RESULT_DATA0 + BRW_MAX_DRAW_BUFFERS);
|
||||
|
||||
int vector_elements =
|
||||
ir->type->is_array() ? ir->type->fields.array->vector_elements
|
||||
: ir->type->vector_elements;
|
||||
|
||||
/* General color output. */
|
||||
for (unsigned int i = 0; i < MAX2(1, ir->type->length); i++) {
|
||||
int output = ir->location - FRAG_RESULT_DATA0 + i;
|
||||
this->outputs[output] = *reg;
|
||||
this->outputs[output].reg_offset += 4 * i;
|
||||
this->outputs[output].reg_offset += vector_elements * i;
|
||||
this->output_components[output] = vector_elements;
|
||||
}
|
||||
}
|
||||
} else if (ir->mode == ir_var_uniform) {
|
||||
@@ -820,20 +826,36 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate,
|
||||
const int vector_elements =
|
||||
ir->coordinate ? ir->coordinate->type->vector_elements : 0;
|
||||
|
||||
if (ir->offset) {
|
||||
/* The offsets set up by the ir_texture visitor are in the
|
||||
* m1 header, so we can't go headerless.
|
||||
if (ir->offset != NULL && ir->op == ir_txf) {
|
||||
/* It appears that the ld instruction used for txf does its
|
||||
* address bounds check before adding in the offset. To work
|
||||
* around this, just add the integer offset to the integer texel
|
||||
* coordinate, and don't put the offset in the header.
|
||||
*/
|
||||
header_present = true;
|
||||
mlen++;
|
||||
base_mrf--;
|
||||
}
|
||||
ir_constant *offset = ir->offset->as_constant();
|
||||
for (int i = 0; i < vector_elements; i++) {
|
||||
emit(BRW_OPCODE_ADD,
|
||||
fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
|
||||
coordinate,
|
||||
offset->value.i[i]);
|
||||
coordinate.reg_offset++;
|
||||
}
|
||||
} else {
|
||||
if (ir->offset) {
|
||||
/* The offsets set up by the ir_texture visitor are in the
|
||||
* m1 header, so we can't go headerless.
|
||||
*/
|
||||
header_present = true;
|
||||
mlen++;
|
||||
base_mrf--;
|
||||
}
|
||||
|
||||
for (int i = 0; i < vector_elements; i++) {
|
||||
emit(BRW_OPCODE_MOV,
|
||||
fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
|
||||
coordinate);
|
||||
coordinate.reg_offset++;
|
||||
for (int i = 0; i < vector_elements; i++) {
|
||||
emit(BRW_OPCODE_MOV,
|
||||
fs_reg(MRF, base_mrf + mlen + i * reg_width, coordinate.type),
|
||||
coordinate);
|
||||
coordinate.reg_offset++;
|
||||
}
|
||||
}
|
||||
mlen += vector_elements * reg_width;
|
||||
|
||||
@@ -2027,7 +2049,7 @@ fs_visitor::emit_fb_writes()
|
||||
this->current_annotation = ralloc_asprintf(this->mem_ctx,
|
||||
"FB write target %d",
|
||||
target);
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (unsigned i = 0; i < this->output_components[target]; i++)
|
||||
emit_color_write(target, i, color_mrf);
|
||||
|
||||
fs_inst *inst = emit(FS_OPCODE_FB_WRITE);
|
||||
|
@@ -1820,7 +1820,7 @@ vec4_visitor::visit(ir_texture *ir)
|
||||
inst->dst = dst_reg(this, ir->type);
|
||||
inst->shadow_compare = ir->shadow_comparitor != NULL;
|
||||
|
||||
if (ir->offset != NULL)
|
||||
if (ir->offset != NULL && ir->op != ir_txf)
|
||||
inst->texture_offset = brw_texture_offset(ir->offset->as_constant());
|
||||
|
||||
/* MRF for the first parameter */
|
||||
@@ -1841,8 +1841,28 @@ vec4_visitor::visit(ir_texture *ir)
|
||||
zero_mask |= (1 << i);
|
||||
|
||||
ir->coordinate->accept(this);
|
||||
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, coord_mask),
|
||||
this->result));
|
||||
if (ir->offset && ir->op == ir_txf) {
|
||||
/* It appears that the ld instruction used for txf does its
|
||||
* address bounds check before adding in the offset. To work
|
||||
* around this, just add the integer offset to the integer
|
||||
* texel coordinate, and don't put the offset in the header.
|
||||
*/
|
||||
ir_constant *offset = ir->offset->as_constant();
|
||||
assert(offset);
|
||||
|
||||
for (int j = 0; j < ir->coordinate->type->vector_elements; j++) {
|
||||
src_reg src = this->result;
|
||||
src.swizzle = BRW_SWIZZLE4(BRW_GET_SWZ(src.swizzle, j),
|
||||
BRW_GET_SWZ(src.swizzle, j),
|
||||
BRW_GET_SWZ(src.swizzle, j),
|
||||
BRW_GET_SWZ(src.swizzle, j));
|
||||
emit(ADD(dst_reg(MRF, param_base, ir->coordinate->type, 1 << j),
|
||||
src, offset->value.i[j]));
|
||||
}
|
||||
} else {
|
||||
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, coord_mask),
|
||||
this->result));
|
||||
}
|
||||
emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, zero_mask),
|
||||
src_reg(0)));
|
||||
/* Load the shadow comparitor */
|
||||
|
@@ -799,6 +799,14 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
|
||||
_mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
|
||||
samp->CompareFailValue);
|
||||
}
|
||||
if (ctx->Extensions.ARB_shadow) {
|
||||
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE,
|
||||
samp->CompareMode);
|
||||
_mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC,
|
||||
samp->CompareFunc);
|
||||
}
|
||||
if (ctx->Extensions.ARB_depth_texture)
|
||||
_mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode);
|
||||
}
|
||||
|
||||
/* remove saved references to the texture objects */
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "mfeatures.h"
|
||||
#include "mtypes.h"
|
||||
#include "texobj.h"
|
||||
#include "transformfeedback.h"
|
||||
|
||||
|
||||
/* Debug flags */
|
||||
@@ -524,7 +525,7 @@ _mesa_copy_buffer_subdata(struct gl_context *ctx,
|
||||
GLintptr readOffset, GLintptr writeOffset,
|
||||
GLsizeiptr size)
|
||||
{
|
||||
void *srcPtr, *dstPtr;
|
||||
GLubyte *srcPtr, *dstPtr;
|
||||
|
||||
/* the buffers should not be mapped */
|
||||
assert(!_mesa_bufferobj_mapped(src));
|
||||
@@ -791,6 +792,24 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
|
||||
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
|
||||
}
|
||||
|
||||
/* unbind ARB_copy_buffer binding points */
|
||||
if (ctx->CopyReadBuffer == bufObj) {
|
||||
_mesa_BindBufferARB( GL_COPY_READ_BUFFER, 0 );
|
||||
}
|
||||
if (ctx->CopyWriteBuffer == bufObj) {
|
||||
_mesa_BindBufferARB( GL_COPY_WRITE_BUFFER, 0 );
|
||||
}
|
||||
|
||||
/* unbind transform feedback binding points */
|
||||
if (ctx->TransformFeedback.CurrentBuffer == bufObj) {
|
||||
_mesa_BindBufferARB( GL_TRANSFORM_FEEDBACK_BUFFER, 0 );
|
||||
}
|
||||
for (j = 0; j < MAX_FEEDBACK_ATTRIBS; j++) {
|
||||
if (ctx->TransformFeedback.CurrentObject->Buffers[j] == bufObj) {
|
||||
_mesa_BindBufferBase( GL_TRANSFORM_FEEDBACK_BUFFER, j, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/* unbind any pixel pack/unpack pointers bound to this buffer */
|
||||
if (ctx->Pack.BufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 );
|
||||
@@ -1311,6 +1330,12 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
|
||||
return;
|
||||
}
|
||||
|
||||
if (size < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"glCopyBufferSubData(writeOffset = %d)", (int) size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (readOffset + size > src->Size) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"glCopyBuffserSubData(readOffset + size = %d)",
|
||||
|
@@ -1245,7 +1245,8 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
|
||||
case GL_RGBA8I_EXT:
|
||||
case GL_RGBA16I_EXT:
|
||||
case GL_RGBA32I_EXT:
|
||||
return ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
|
||||
return ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
|
||||
|
||||
case GL_RGB8UI_EXT:
|
||||
case GL_RGB16UI_EXT:
|
||||
@@ -1253,7 +1254,8 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
|
||||
case GL_RGB8I_EXT:
|
||||
case GL_RGB16I_EXT:
|
||||
case GL_RGB32I_EXT:
|
||||
return ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
|
||||
return ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
|
||||
|
||||
case GL_R8UI:
|
||||
case GL_R8I:
|
||||
@@ -1261,8 +1263,9 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
|
||||
case GL_R16I:
|
||||
case GL_R32UI:
|
||||
case GL_R32I:
|
||||
return ctx->Extensions.ARB_texture_rg &&
|
||||
ctx->Extensions.EXT_texture_integer ? GL_RED : 0;
|
||||
return ctx->VersionMajor >= 3 ||
|
||||
(ctx->Extensions.ARB_texture_rg &&
|
||||
ctx->Extensions.EXT_texture_integer) ? GL_RED : 0;
|
||||
|
||||
case GL_RG8UI:
|
||||
case GL_RG8I:
|
||||
@@ -1270,8 +1273,9 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
|
||||
case GL_RG16I:
|
||||
case GL_RG32UI:
|
||||
case GL_RG32I:
|
||||
return ctx->Extensions.ARB_texture_rg &&
|
||||
ctx->Extensions.EXT_texture_integer ? GL_RG : 0;
|
||||
return ctx->VersionMajor >= 3 ||
|
||||
(ctx->Extensions.ARB_texture_rg &&
|
||||
ctx->Extensions.EXT_texture_integer) ? GL_RG : 0;
|
||||
|
||||
case GL_INTENSITY8I_EXT:
|
||||
case GL_INTENSITY8UI_EXT:
|
||||
|
@@ -2922,7 +2922,7 @@ unpack_uint_z_Z32_FLOAT(const void *src, GLuint *dst, GLuint n)
|
||||
const float *s = (const float *)src;
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++) {
|
||||
dst[i] = FLOAT_TO_UINT(IROUND(CLAMP((s[i]), 0.0F, 1.0F)));
|
||||
dst[i] = FLOAT_TO_UINT(CLAMP(s[i], 0.0F, 1.0F));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2938,7 +2938,7 @@ unpack_uint_z_Z32_FLOAT_X24S8(const void *src, GLuint *dst, GLuint n)
|
||||
GLuint i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
dst[i] = FLOAT_TO_UINT(IROUND(CLAMP((s[i].z), 0.0F, 1.0F)));
|
||||
dst[i] = FLOAT_TO_UINT(CLAMP(s[i].z, 0.0F, 1.0F));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -356,18 +356,92 @@ _mesa_bytes_per_pixel( GLenum format, GLenum type )
|
||||
|
||||
|
||||
/**
|
||||
* Test for a legal pixel format and type.
|
||||
* Do error checking of format/type combinations for glReadPixels,
|
||||
* glDrawPixels and glTex[Sub]Image. Note that depending on the format
|
||||
* and type values, we may either generate GL_INVALID_OPERATION or
|
||||
* GL_INVALID_ENUM.
|
||||
*
|
||||
* \param format pixel format.
|
||||
* \param type pixel type.
|
||||
*
|
||||
* \return GL_TRUE if the given pixel format and type are legal, or GL_FALSE
|
||||
* otherwise.
|
||||
* \return GL_INVALID_ENUM, GL_INVALID_OPERATION or GL_NO_ERROR
|
||||
*/
|
||||
GLboolean
|
||||
_mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
GLenum format, GLenum type)
|
||||
GLenum
|
||||
_mesa_error_check_format_and_type(const struct gl_context *ctx,
|
||||
GLenum format, GLenum type)
|
||||
{
|
||||
/* special type-based checks (see glReadPixels, glDrawPixels error lists) */
|
||||
switch (type) {
|
||||
case GL_BITMAP:
|
||||
if (format != GL_COLOR_INDEX && format != GL_STENCIL_INDEX) {
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
break;
|
||||
|
||||
case GL_UNSIGNED_BYTE_3_3_2:
|
||||
case GL_UNSIGNED_BYTE_2_3_3_REV:
|
||||
case GL_UNSIGNED_SHORT_5_6_5:
|
||||
case GL_UNSIGNED_SHORT_5_6_5_REV:
|
||||
if (format == GL_RGB) {
|
||||
break; /* OK */
|
||||
}
|
||||
if (format == GL_RGB_INTEGER_EXT &&
|
||||
ctx->Extensions.ARB_texture_rgb10_a2ui) {
|
||||
break; /* OK */
|
||||
}
|
||||
return GL_INVALID_OPERATION;
|
||||
|
||||
case GL_UNSIGNED_SHORT_4_4_4_4:
|
||||
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
|
||||
case GL_UNSIGNED_SHORT_5_5_5_1:
|
||||
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
|
||||
case GL_UNSIGNED_INT_8_8_8_8:
|
||||
case GL_UNSIGNED_INT_8_8_8_8_REV:
|
||||
case GL_UNSIGNED_INT_10_10_10_2:
|
||||
case GL_UNSIGNED_INT_2_10_10_10_REV:
|
||||
if (format == GL_RGBA ||
|
||||
format == GL_BGRA ||
|
||||
format == GL_ABGR_EXT) {
|
||||
break; /* OK */
|
||||
}
|
||||
if ((format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT) &&
|
||||
ctx->Extensions.ARB_texture_rgb10_a2ui) {
|
||||
break; /* OK */
|
||||
}
|
||||
return GL_INVALID_OPERATION;
|
||||
|
||||
case GL_UNSIGNED_INT_24_8:
|
||||
if (!ctx->Extensions.EXT_packed_depth_stencil) {
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
if (format != GL_DEPTH_STENCIL) {
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
return GL_NO_ERROR;
|
||||
|
||||
case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
|
||||
if (!ctx->Extensions.ARB_depth_buffer_float) {
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
if (format != GL_DEPTH_STENCIL) {
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
return GL_NO_ERROR;
|
||||
|
||||
case GL_UNSIGNED_INT_10F_11F_11F_REV:
|
||||
if (!ctx->Extensions.EXT_packed_float) {
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
if (format != GL_RGB) {
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
return GL_NO_ERROR;
|
||||
|
||||
default:
|
||||
; /* fall-through */
|
||||
}
|
||||
|
||||
/* now, for each format, check the type for compatibility */
|
||||
switch (format) {
|
||||
case GL_COLOR_INDEX:
|
||||
case GL_STENCIL_INDEX:
|
||||
@@ -380,12 +454,14 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
return GL_TRUE;
|
||||
case GL_HALF_FLOAT_ARB:
|
||||
return ctx->Extensions.ARB_half_float_pixel;
|
||||
return GL_NO_ERROR;
|
||||
case GL_HALF_FLOAT:
|
||||
return ctx->Extensions.ARB_half_float_pixel
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_RED:
|
||||
case GL_GREEN:
|
||||
case GL_BLUE:
|
||||
@@ -404,16 +480,17 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
return GL_TRUE;
|
||||
case GL_HALF_FLOAT_ARB:
|
||||
return ctx->Extensions.ARB_half_float_pixel;
|
||||
return GL_NO_ERROR;
|
||||
case GL_HALF_FLOAT:
|
||||
return ctx->Extensions.ARB_half_float_pixel
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_RG:
|
||||
if (!ctx->Extensions.ARB_texture_rg)
|
||||
return GL_FALSE;
|
||||
|
||||
return GL_INVALID_ENUM;
|
||||
switch (type) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
@@ -422,12 +499,14 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
return GL_TRUE;
|
||||
case GL_HALF_FLOAT_ARB:
|
||||
return ctx->Extensions.ARB_half_float_pixel;
|
||||
return GL_NO_ERROR;
|
||||
case GL_HALF_FLOAT:
|
||||
return ctx->Extensions.ARB_half_float_pixel
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_RGB:
|
||||
switch (type) {
|
||||
case GL_BYTE:
|
||||
@@ -441,16 +520,20 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_BYTE_2_3_3_REV:
|
||||
case GL_UNSIGNED_SHORT_5_6_5:
|
||||
case GL_UNSIGNED_SHORT_5_6_5_REV:
|
||||
return GL_TRUE;
|
||||
case GL_HALF_FLOAT_ARB:
|
||||
return ctx->Extensions.ARB_half_float_pixel;
|
||||
return GL_NO_ERROR;
|
||||
case GL_HALF_FLOAT:
|
||||
return ctx->Extensions.ARB_half_float_pixel
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
case GL_UNSIGNED_INT_5_9_9_9_REV:
|
||||
return ctx->Extensions.EXT_texture_shared_exponent;
|
||||
return ctx->Extensions.EXT_texture_shared_exponent
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
case GL_UNSIGNED_INT_10F_11F_11F_REV:
|
||||
return ctx->Extensions.EXT_packed_float;
|
||||
return ctx->Extensions.EXT_packed_float
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_BGR:
|
||||
switch (type) {
|
||||
/* NOTE: no packed types are supported with BGR. That's
|
||||
@@ -463,12 +546,14 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
return GL_TRUE;
|
||||
case GL_HALF_FLOAT_ARB:
|
||||
return ctx->Extensions.ARB_half_float_pixel;
|
||||
return GL_NO_ERROR;
|
||||
case GL_HALF_FLOAT:
|
||||
return ctx->Extensions.ARB_half_float_pixel
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_RGBA:
|
||||
case GL_BGRA:
|
||||
case GL_ABGR_EXT:
|
||||
@@ -488,28 +573,37 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_INT_8_8_8_8_REV:
|
||||
case GL_UNSIGNED_INT_10_10_10_2:
|
||||
case GL_UNSIGNED_INT_2_10_10_10_REV:
|
||||
return GL_TRUE;
|
||||
case GL_HALF_FLOAT_ARB:
|
||||
return ctx->Extensions.ARB_half_float_pixel;
|
||||
return GL_NO_ERROR;
|
||||
case GL_HALF_FLOAT:
|
||||
return ctx->Extensions.ARB_half_float_pixel
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_YCBCR_MESA:
|
||||
if (!ctx->Extensions.MESA_ycbcr_texture)
|
||||
return GL_INVALID_ENUM;
|
||||
if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
|
||||
type == GL_UNSIGNED_SHORT_8_8_REV_MESA)
|
||||
return GL_TRUE;
|
||||
return GL_NO_ERROR;
|
||||
else
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_OPERATION;
|
||||
|
||||
case GL_DEPTH_STENCIL_EXT:
|
||||
if ((ctx->Extensions.EXT_packed_depth_stencil &&
|
||||
type == GL_UNSIGNED_INT_24_8_EXT) ||
|
||||
(ctx->Extensions.ARB_depth_buffer_float &&
|
||||
type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV))
|
||||
return GL_TRUE;
|
||||
if (ctx->Extensions.EXT_packed_depth_stencil &&
|
||||
type == GL_UNSIGNED_INT_24_8)
|
||||
return GL_NO_ERROR;
|
||||
else if (ctx->Extensions.ARB_depth_buffer_float &&
|
||||
type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV)
|
||||
return GL_NO_ERROR;
|
||||
else
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
|
||||
case GL_DUDV_ATI:
|
||||
case GL_DU8DV8_ATI:
|
||||
if (!ctx->Extensions.ATI_envmap_bumpmap)
|
||||
return GL_INVALID_ENUM;
|
||||
switch (type) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
@@ -518,9 +612,9 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
return GL_TRUE;
|
||||
return GL_NO_ERROR;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
/* integer-valued formats */
|
||||
@@ -536,9 +630,11 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
return ctx->Extensions.EXT_texture_integer;
|
||||
return (ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer)
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_RGB_INTEGER_EXT:
|
||||
@@ -549,14 +645,17 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
return ctx->Extensions.EXT_texture_integer;
|
||||
return (ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer)
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
case GL_UNSIGNED_BYTE_3_3_2:
|
||||
case GL_UNSIGNED_BYTE_2_3_3_REV:
|
||||
case GL_UNSIGNED_SHORT_5_6_5:
|
||||
case GL_UNSIGNED_SHORT_5_6_5_REV:
|
||||
return ctx->Extensions.ARB_texture_rgb10_a2ui;
|
||||
return ctx->Extensions.ARB_texture_rgb10_a2ui
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_BGR_INTEGER_EXT:
|
||||
@@ -568,9 +667,11 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
/* NOTE: no packed formats w/ BGR format */
|
||||
return ctx->Extensions.EXT_texture_integer;
|
||||
return (ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer)
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_RGBA_INTEGER_EXT:
|
||||
@@ -582,7 +683,9 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
return ctx->Extensions.EXT_texture_integer;
|
||||
return (ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer)
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
case GL_UNSIGNED_SHORT_4_4_4_4:
|
||||
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
|
||||
case GL_UNSIGNED_SHORT_5_5_5_1:
|
||||
@@ -591,9 +694,10 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_INT_8_8_8_8_REV:
|
||||
case GL_UNSIGNED_INT_10_10_10_2:
|
||||
case GL_UNSIGNED_INT_2_10_10_10_REV:
|
||||
return ctx->Extensions.ARB_texture_rgb10_a2ui;
|
||||
return ctx->Extensions.ARB_texture_rgb10_a2ui
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
case GL_LUMINANCE_INTEGER_EXT:
|
||||
@@ -605,15 +709,16 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
return ctx->Extensions.EXT_texture_integer;
|
||||
return ctx->Extensions.EXT_texture_integer
|
||||
? GL_NO_ERROR : GL_INVALID_ENUM;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
|
||||
default:
|
||||
; /* fall-through */
|
||||
return GL_INVALID_ENUM;
|
||||
}
|
||||
return GL_FALSE;
|
||||
return GL_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -53,9 +53,9 @@ _mesa_components_in_format( GLenum format );
|
||||
extern GLint
|
||||
_mesa_bytes_per_pixel( GLenum format, GLenum type );
|
||||
|
||||
extern GLboolean
|
||||
_mesa_is_legal_format_and_type(const struct gl_context *ctx,
|
||||
GLenum format, GLenum type);
|
||||
extern GLenum
|
||||
_mesa_error_check_format_and_type(const struct gl_context *ctx,
|
||||
GLenum format, GLenum type);
|
||||
|
||||
extern GLboolean
|
||||
_mesa_is_color_format(GLenum format);
|
||||
|
@@ -650,6 +650,7 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
|
||||
{
|
||||
const char *readDraw = drawing ? "Draw" : "Read";
|
||||
const GLboolean reading = !drawing;
|
||||
GLenum err;
|
||||
|
||||
/* state validation should have already been done */
|
||||
ASSERT(ctx->NewState == 0x0);
|
||||
@@ -671,9 +672,9 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
|
||||
}
|
||||
|
||||
/* basic combinations test */
|
||||
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
"gl%sPixels(format or type)", readDraw);
|
||||
err = _mesa_error_check_format_and_type(ctx, format, type);
|
||||
if (err != GL_NO_ERROR) {
|
||||
_mesa_error(ctx, err, "gl%sPixels(format or type)", readDraw);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
@@ -777,7 +778,7 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* this should have been caught in _mesa_is_legal_format_type() */
|
||||
/* this should have been caught in _mesa_error_check_format_type() */
|
||||
_mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
@@ -277,7 +277,8 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
|
||||
struct gl_shader_program *shProg)
|
||||
{
|
||||
if (shProg->UniformStorage) {
|
||||
_mesa_uniform_detach_all_driver_storage(shProg->UniformStorage);
|
||||
for (unsigned i = 0; i < shProg->NumUserUniformStorage; ++i)
|
||||
_mesa_uniform_detach_all_driver_storage(&shProg->UniformStorage[i]);
|
||||
ralloc_free(shProg->UniformStorage);
|
||||
shProg->NumUserUniformStorage = 0;
|
||||
shProg->UniformStorage = NULL;
|
||||
|
@@ -706,6 +706,12 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
|
||||
RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT32);
|
||||
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer) {
|
||||
switch (internalFormat) {
|
||||
case GL_RGB8UI_EXT:
|
||||
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8);
|
||||
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8);
|
||||
@@ -822,7 +828,9 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Extensions.ARB_texture_rg && ctx->Extensions.EXT_texture_integer) {
|
||||
if (ctx->VersionMajor >= 3 ||
|
||||
(ctx->Extensions.ARB_texture_rg &&
|
||||
ctx->Extensions.EXT_texture_integer)) {
|
||||
switch (internalFormat) {
|
||||
case GL_R8UI:
|
||||
RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT8);
|
||||
|
@@ -691,7 +691,7 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
|
||||
struct gl_texture_image *texImage;
|
||||
const GLint maxLevels = _mesa_max_texture_levels(ctx, target);
|
||||
const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2;
|
||||
GLenum baseFormat;
|
||||
GLenum baseFormat, err;
|
||||
|
||||
if (maxLevels == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target=0x%x)", target);
|
||||
@@ -737,6 +737,12 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
err = _mesa_error_check_format_and_type(ctx, format, type);
|
||||
if (err != GL_NO_ERROR) {
|
||||
_mesa_error(ctx, err, "glGetTexImage(format/type)");
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
texObj = _mesa_get_current_tex_object(ctx, target);
|
||||
|
||||
if (!texObj || _mesa_is_proxy_texture(target)) {
|
||||
@@ -744,14 +750,6 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
|
||||
/* GL_INVALID_OPERATION is generated by a format/type
|
||||
* mismatch (see the 1.2 spec page 94, sec 3.6.4.)
|
||||
*/
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(target)");
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
|
||||
if (!texImage) {
|
||||
/* non-existant texture image */
|
||||
|
@@ -323,7 +323,8 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
|
||||
}
|
||||
#endif /* FEATURE_EXT_texture_sRGB */
|
||||
|
||||
if (ctx->Extensions.EXT_texture_integer) {
|
||||
if (ctx->VersionMajor >= 3 ||
|
||||
ctx->Extensions.EXT_texture_integer) {
|
||||
switch (internalFormat) {
|
||||
case GL_RGBA8UI_EXT:
|
||||
case GL_RGBA16UI_EXT:
|
||||
@@ -340,6 +341,11 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
|
||||
case GL_RGB16I_EXT:
|
||||
case GL_RGB32I_EXT:
|
||||
return GL_RGB;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Extensions.EXT_texture_integer) {
|
||||
switch (internalFormat) {
|
||||
case GL_ALPHA8UI_EXT:
|
||||
case GL_ALPHA16UI_EXT:
|
||||
case GL_ALPHA32UI_EXT:
|
||||
@@ -391,7 +397,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
|
||||
case GL_R16UI:
|
||||
case GL_R32I:
|
||||
case GL_R32UI:
|
||||
if (!ctx->Extensions.EXT_texture_integer)
|
||||
if (ctx->VersionMajor < 3 && !ctx->Extensions.EXT_texture_integer)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case GL_R8:
|
||||
@@ -416,7 +422,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
|
||||
case GL_RG16UI:
|
||||
case GL_RG32I:
|
||||
case GL_RG32UI:
|
||||
if (!ctx->Extensions.EXT_texture_integer)
|
||||
if (ctx->VersionMajor < 3 && !ctx->Extensions.EXT_texture_integer)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case GL_RG:
|
||||
@@ -1578,6 +1584,7 @@ texture_error_check( struct gl_context *ctx,
|
||||
const GLboolean isProxy = target == proxyTarget;
|
||||
GLboolean sizeOK = GL_TRUE;
|
||||
GLboolean colorFormat;
|
||||
GLenum err;
|
||||
|
||||
/* Even though there are no color-index textures, we still have to support
|
||||
* uploading color-index data and remapping it to RGB via the
|
||||
@@ -1646,16 +1653,10 @@ texture_error_check( struct gl_context *ctx,
|
||||
}
|
||||
|
||||
/* Check incoming image format and type */
|
||||
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
|
||||
/* Normally, GL_INVALID_OPERATION is generated by a format/type
|
||||
* mismatch (see the 1.2 spec page 94, sec 3.6.4.). But with the
|
||||
* GL_EXT_texture_integer extension, some combinations should generate
|
||||
* GL_INVALID_ENUM instead (grr!).
|
||||
*/
|
||||
err = _mesa_error_check_format_and_type(ctx, format, type);
|
||||
if (err != GL_NO_ERROR) {
|
||||
if (!isProxy) {
|
||||
GLenum error = _mesa_is_integer_format(format)
|
||||
? GL_INVALID_ENUM : GL_INVALID_OPERATION;
|
||||
_mesa_error(ctx, error,
|
||||
_mesa_error(ctx, err,
|
||||
"glTexImage%dD(incompatible format 0x%x, type 0x%x)",
|
||||
dimensions, format, type);
|
||||
}
|
||||
@@ -1754,7 +1755,7 @@ texture_error_check( struct gl_context *ctx,
|
||||
}
|
||||
|
||||
/* additional checks for integer textures */
|
||||
if (ctx->Extensions.EXT_texture_integer &&
|
||||
if ((ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) &&
|
||||
(_mesa_is_integer_format(format) !=
|
||||
_mesa_is_integer_format(internalFormat))) {
|
||||
if (!isProxy) {
|
||||
@@ -1805,6 +1806,8 @@ subtexture_error_check( struct gl_context *ctx, GLuint dimensions,
|
||||
GLint width, GLint height, GLint depth,
|
||||
GLenum format, GLenum type )
|
||||
{
|
||||
GLenum err;
|
||||
|
||||
/* Basic level check */
|
||||
if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level);
|
||||
@@ -1828,13 +1831,9 @@ subtexture_error_check( struct gl_context *ctx, GLuint dimensions,
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
|
||||
/* As with the glTexImage2D check above, the error code here
|
||||
* depends on texture integer.
|
||||
*/
|
||||
GLenum error = _mesa_is_integer_format(format)
|
||||
? GL_INVALID_OPERATION : GL_INVALID_ENUM;
|
||||
_mesa_error(ctx, error,
|
||||
err = _mesa_error_check_format_and_type(ctx, format, type);
|
||||
if (err != GL_NO_ERROR) {
|
||||
_mesa_error(ctx, err,
|
||||
"glTexSubImage%dD(incompatible format 0x%x, type 0x%x)",
|
||||
dimensions, format, type);
|
||||
return GL_TRUE;
|
||||
|
@@ -497,7 +497,12 @@ _mesa_BindBufferRange(GLenum target, GLuint index,
|
||||
return;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (buffer == 0) {
|
||||
bufObj = ctx->Shared->NullBufferObj;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
}
|
||||
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindBufferRange(invalid buffer=%u)", buffer);
|
||||
@@ -545,7 +550,12 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
|
||||
return;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (buffer == 0) {
|
||||
bufObj = ctx->Shared->NullBufferObj;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
}
|
||||
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindBufferBase(invalid buffer=%u)", buffer);
|
||||
@@ -601,7 +611,12 @@ _mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
|
||||
return;
|
||||
}
|
||||
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (buffer == 0) {
|
||||
bufObj = ctx->Shared->NullBufferObj;
|
||||
} else {
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
}
|
||||
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBindBufferOffsetEXT(invalid buffer=%u)", buffer);
|
||||
|
@@ -125,6 +125,7 @@ compute_version(struct gl_context *ctx)
|
||||
ctx->Extensions.EXT_texture_sRGB);
|
||||
const GLboolean ver_3_0 = (ver_2_1 &&
|
||||
ctx->Const.GLSLVersion >= 130 &&
|
||||
ctx->Const.MaxSamples >= 4 &&
|
||||
ctx->Extensions.ARB_color_buffer_float &&
|
||||
ctx->Extensions.ARB_depth_buffer_float &&
|
||||
ctx->Extensions.ARB_half_float_pixel &&
|
||||
@@ -140,7 +141,6 @@ compute_version(struct gl_context *ctx)
|
||||
ctx->Extensions.EXT_framebuffer_sRGB &&
|
||||
ctx->Extensions.EXT_packed_float &&
|
||||
ctx->Extensions.EXT_texture_array &&
|
||||
ctx->Extensions.EXT_texture_integer &&
|
||||
ctx->Extensions.EXT_texture_shared_exponent &&
|
||||
ctx->Extensions.EXT_transform_feedback &&
|
||||
ctx->Extensions.NV_conditional_render);
|
||||
|
@@ -34,8 +34,8 @@ struct gl_context;
|
||||
/* Mesa version */
|
||||
#define MESA_MAJOR 8
|
||||
#define MESA_MINOR 0
|
||||
#define MESA_PATCH 3
|
||||
#define MESA_VERSION_STRING "8.0.3"
|
||||
#define MESA_PATCH 4
|
||||
#define MESA_VERSION_STRING "8.0.4"
|
||||
|
||||
/* To make version comparison easy */
|
||||
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||
|
@@ -215,7 +215,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
p->NumInstructions = write_depth ? 2 : 1;
|
||||
p->NumInstructions = write_depth ? 3 : 1;
|
||||
p->NumInstructions += write_stencil ? 1 : 0;
|
||||
|
||||
p->Instructions = _mesa_alloc_instructions(p->NumInstructions);
|
||||
@@ -236,6 +236,13 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
|
||||
p->Instructions[ic].TexSrcUnit = 0;
|
||||
p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
|
||||
ic++;
|
||||
/* MOV result.color, fragment.color; */
|
||||
p->Instructions[ic].Opcode = OPCODE_MOV;
|
||||
p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
|
||||
p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLOR;
|
||||
p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
|
||||
p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_COL0;
|
||||
ic++;
|
||||
}
|
||||
|
||||
if (write_stencil) {
|
||||
@@ -258,8 +265,10 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
|
||||
|
||||
p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0;
|
||||
p->OutputsWritten = 0;
|
||||
if (write_depth)
|
||||
if (write_depth) {
|
||||
p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH);
|
||||
p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_COLOR);
|
||||
}
|
||||
if (write_stencil)
|
||||
p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_STENCIL);
|
||||
|
||||
|
@@ -142,7 +142,12 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
|
||||
if (util_format_is_depth_or_stencil(format)) {
|
||||
template.bind = PIPE_BIND_DEPTH_STENCIL;
|
||||
}
|
||||
else if (strb->Base.Name != 0) {
|
||||
/* this is a user-created renderbuffer */
|
||||
template.bind = PIPE_BIND_RENDER_TARGET;
|
||||
}
|
||||
else {
|
||||
/* this is a window-system buffer */
|
||||
template.bind = (PIPE_BIND_DISPLAY_TARGET |
|
||||
PIPE_BIND_RENDER_TARGET);
|
||||
}
|
||||
@@ -203,6 +208,7 @@ st_new_renderbuffer(struct gl_context *ctx, GLuint name)
|
||||
{
|
||||
struct st_renderbuffer *strb = ST_CALLOC_STRUCT(st_renderbuffer);
|
||||
if (strb) {
|
||||
assert(name != 0);
|
||||
_mesa_init_renderbuffer(&strb->Base, name);
|
||||
strb->Base.Delete = st_renderbuffer_delete;
|
||||
strb->Base.AllocStorage = st_renderbuffer_alloc_storage;
|
||||
@@ -666,6 +672,8 @@ st_MapRenderbuffer(struct gl_context *ctx,
|
||||
usage |= PIPE_TRANSFER_READ;
|
||||
if (mode & GL_MAP_WRITE_BIT)
|
||||
usage |= PIPE_TRANSFER_WRITE;
|
||||
if (mode & GL_MAP_INVALIDATE_RANGE_BIT)
|
||||
usage |= PIPE_TRANSFER_DISCARD_RANGE;
|
||||
|
||||
/* Note: y=0=bottom of buffer while y2=0=top of buffer.
|
||||
* 'invert' will be true for window-system buffers and false for
|
||||
|
@@ -189,6 +189,8 @@ st_MapTextureImage(struct gl_context *ctx,
|
||||
pipeMode |= PIPE_TRANSFER_READ;
|
||||
if (mode & GL_MAP_WRITE_BIT)
|
||||
pipeMode |= PIPE_TRANSFER_WRITE;
|
||||
if (mode & GL_MAP_INVALIDATE_RANGE_BIT)
|
||||
pipeMode |= PIPE_TRANSFER_DISCARD_RANGE;
|
||||
|
||||
map = st_texture_image_map(st, stImage, slice, pipeMode, x, y, w, h);
|
||||
if (map) {
|
||||
@@ -406,6 +408,8 @@ guess_and_alloc_texture(struct st_context *st,
|
||||
ptLayers,
|
||||
bindings);
|
||||
|
||||
stObj->lastLevel = lastLevel;
|
||||
|
||||
DBG("%s returning %d\n", __FUNCTION__, (stObj->pt != NULL));
|
||||
|
||||
return stObj->pt != NULL;
|
||||
@@ -607,8 +611,7 @@ decompress_with_blit(struct gl_context * ctx,
|
||||
struct pipe_context *pipe = st->pipe;
|
||||
struct st_texture_image *stImage = st_texture_image(texImage);
|
||||
struct st_texture_object *stObj = st_texture_object(texImage->TexObject);
|
||||
struct pipe_sampler_view *src_view =
|
||||
st_get_texture_sampler_view(stObj, pipe);
|
||||
struct pipe_sampler_view *src_view;
|
||||
const GLuint width = texImage->Width;
|
||||
const GLuint height = texImage->Height;
|
||||
struct pipe_surface *dst_surface;
|
||||
@@ -630,8 +633,22 @@ decompress_with_blit(struct gl_context * ctx,
|
||||
pipe->render_condition(pipe, NULL, 0);
|
||||
}
|
||||
|
||||
/* Choose the source mipmap level */
|
||||
src_view->u.tex.first_level = src_view->u.tex.last_level = texImage->Level;
|
||||
/* Create sampler view that limits fetches to the source mipmap level */
|
||||
{
|
||||
struct pipe_sampler_view sv_temp;
|
||||
|
||||
u_sampler_view_default_template(&sv_temp, stObj->pt, stObj->pt->format);
|
||||
|
||||
sv_temp.format = util_format_linear(sv_temp.format);
|
||||
sv_temp.u.tex.first_level =
|
||||
sv_temp.u.tex.last_level = texImage->Level;
|
||||
|
||||
src_view = pipe->create_sampler_view(pipe, stObj->pt, &sv_temp);
|
||||
if (!src_view) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* blit/render/decompress */
|
||||
util_blit_pixels_tex(st->blit,
|
||||
@@ -700,6 +717,8 @@ decompress_with_blit(struct gl_context * ctx,
|
||||
|
||||
/* destroy the temp / dest surface */
|
||||
util_destroy_rgba_surface(dst_texture, dst_surface);
|
||||
|
||||
pipe_sampler_view_reference(&src_view, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -979,6 +979,7 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
struct pipe_index_buffer ibuffer;
|
||||
struct pipe_draw_info info;
|
||||
unsigned i, num_instances = 1;
|
||||
unsigned max_index_plus_base;
|
||||
GLboolean new_array =
|
||||
st->dirty.st &&
|
||||
(st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT)) != 0;
|
||||
@@ -987,6 +988,8 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
assert(ctx->NewState == 0x0);
|
||||
|
||||
if (ib) {
|
||||
int max_base_vertex = 0;
|
||||
|
||||
/* Gallium probably doesn't want this in some cases. */
|
||||
if (!index_bounds_valid)
|
||||
if (!all_varyings_in_vbos(arrays))
|
||||
@@ -994,7 +997,16 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
|
||||
for (i = 0; i < nr_prims; i++) {
|
||||
num_instances = MAX2(num_instances, prims[i].num_instances);
|
||||
max_base_vertex = MAX2(max_base_vertex, prims[i].basevertex);
|
||||
}
|
||||
|
||||
/* Compute the sum of max_index and max_base_vertex. That's the value
|
||||
* we need to use when creating buffers.
|
||||
*/
|
||||
if (max_index == ~0)
|
||||
max_index_plus_base = max_index;
|
||||
else
|
||||
max_index_plus_base = max_index + max_base_vertex;
|
||||
}
|
||||
else {
|
||||
/* Get min/max index for non-indexed drawing. */
|
||||
@@ -1006,6 +1018,9 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
max_index = MAX2(max_index, prims[i].start + prims[i].count - 1);
|
||||
num_instances = MAX2(num_instances, prims[i].num_instances);
|
||||
}
|
||||
|
||||
/* The base vertex offset only applies to indexed drawing */
|
||||
max_index_plus_base = max_index;
|
||||
}
|
||||
|
||||
/* Validate state. */
|
||||
@@ -1025,7 +1040,8 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
st_validate_state(st);
|
||||
|
||||
if (new_array) {
|
||||
if (!st_validate_varrays(ctx, arrays, max_index, num_instances)) {
|
||||
if (!st_validate_varrays(ctx, arrays, max_index_plus_base,
|
||||
num_instances)) {
|
||||
/* probably out of memory, no-op the draw call */
|
||||
return;
|
||||
}
|
||||
@@ -1049,7 +1065,7 @@ st_draw_vbo(struct gl_context *ctx,
|
||||
unsigned element_size = st->user_attrib[i].element_size;
|
||||
unsigned stride = st->user_attrib[i].stride;
|
||||
unsigned min_offset = min_index * stride;
|
||||
unsigned max_offset = max_index * stride + element_size;
|
||||
unsigned max_offset = max_index_plus_base * stride + element_size;
|
||||
|
||||
assert(max_offset > min_offset);
|
||||
|
||||
|
@@ -739,6 +739,15 @@ struct format_mapping
|
||||
PIPE_FORMAT_S8_UINT_Z24_UNORM, \
|
||||
0
|
||||
|
||||
#define DEFAULT_SNORM8_RGBA_FORMATS \
|
||||
PIPE_FORMAT_R8G8B8A8_SNORM, \
|
||||
0
|
||||
|
||||
#define DEFAULT_UNORM16_RGBA_FORMATS \
|
||||
PIPE_FORMAT_R16G16B16A16_UNORM, \
|
||||
DEFAULT_RGBA_FORMATS
|
||||
|
||||
|
||||
/**
|
||||
* This table maps OpenGL texture format enums to Gallium pipe_format enums.
|
||||
* Multiple GL enums might map to multiple pipe_formats.
|
||||
@@ -1045,54 +1054,55 @@ static const struct format_mapping format_map[] = {
|
||||
/* R, RG formats */
|
||||
{
|
||||
{ GL_RED, GL_R8, 0 },
|
||||
{ PIPE_FORMAT_R8_UNORM, 0 }
|
||||
{ PIPE_FORMAT_R8_UNORM, PIPE_FORMAT_R8G8_UNORM, DEFAULT_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_RG, GL_RG8, 0 },
|
||||
{ PIPE_FORMAT_R8G8_UNORM, 0 }
|
||||
{ PIPE_FORMAT_R8G8_UNORM, DEFAULT_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_R16, 0 },
|
||||
{ PIPE_FORMAT_R16_UNORM, 0 }
|
||||
{ PIPE_FORMAT_R16_UNORM, PIPE_FORMAT_R16G16_UNORM,
|
||||
DEFAULT_UNORM16_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_RG16, 0 },
|
||||
{ PIPE_FORMAT_R16G16_UNORM, 0 }
|
||||
{ PIPE_FORMAT_R16G16_UNORM, DEFAULT_UNORM16_RGBA_FORMATS }
|
||||
},
|
||||
|
||||
/* compressed R, RG formats */
|
||||
{
|
||||
{ GL_COMPRESSED_RED, GL_COMPRESSED_RED_RGTC1, 0 },
|
||||
{ PIPE_FORMAT_RGTC1_UNORM, PIPE_FORMAT_R8_UNORM, 0 }
|
||||
{ PIPE_FORMAT_RGTC1_UNORM, PIPE_FORMAT_R8_UNORM, DEFAULT_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_SIGNED_RED_RGTC1, 0 },
|
||||
{ PIPE_FORMAT_RGTC1_SNORM, 0 }
|
||||
{ PIPE_FORMAT_RGTC1_SNORM, DEFAULT_SNORM8_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_RG, GL_COMPRESSED_RG_RGTC2, 0 },
|
||||
{ PIPE_FORMAT_RGTC2_UNORM, PIPE_FORMAT_R8G8_UNORM, 0 }
|
||||
{ PIPE_FORMAT_RGTC2_UNORM, PIPE_FORMAT_R8G8_UNORM, DEFAULT_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_SIGNED_RG_RGTC2, 0 },
|
||||
{ PIPE_FORMAT_RGTC2_SNORM, 0 }
|
||||
{ PIPE_FORMAT_RGTC2_SNORM, DEFAULT_SNORM8_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_LUMINANCE, GL_COMPRESSED_LUMINANCE_LATC1_EXT, 0 },
|
||||
{ PIPE_FORMAT_LATC1_UNORM, PIPE_FORMAT_L8_UNORM, 0 }
|
||||
{ PIPE_FORMAT_LATC1_UNORM, PIPE_FORMAT_L8_UNORM, DEFAULT_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT, 0 },
|
||||
{ PIPE_FORMAT_LATC1_SNORM, 0 }
|
||||
{ PIPE_FORMAT_LATC1_SNORM, DEFAULT_SNORM8_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_LUMINANCE_ALPHA, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT,
|
||||
GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0 },
|
||||
{ PIPE_FORMAT_LATC2_UNORM, PIPE_FORMAT_L8A8_UNORM, 0 }
|
||||
{ PIPE_FORMAT_LATC2_UNORM, PIPE_FORMAT_L8A8_UNORM, DEFAULT_RGBA_FORMATS }
|
||||
},
|
||||
{
|
||||
{ GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT, 0 },
|
||||
{ PIPE_FORMAT_LATC2_SNORM, 0 }
|
||||
{ PIPE_FORMAT_LATC2_SNORM, DEFAULT_SNORM8_RGBA_FORMATS }
|
||||
},
|
||||
|
||||
/* ETC1 */
|
||||
|
@@ -229,10 +229,22 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
|
||||
= _mesa_get_tex_image(ctx, texObj, target, srcLevel);
|
||||
struct gl_texture_image *dstImage;
|
||||
struct st_texture_image *stImage;
|
||||
uint dstWidth = u_minify(pt->width0, dstLevel);
|
||||
uint dstHeight = u_minify(pt->height0, dstLevel);
|
||||
uint dstDepth = u_minify(pt->depth0, dstLevel);
|
||||
uint border = srcImage->Border;
|
||||
uint dstWidth, dstHeight, dstDepth;
|
||||
|
||||
dstWidth = u_minify(pt->width0, dstLevel);
|
||||
if (texObj->Target == GL_TEXTURE_1D_ARRAY) {
|
||||
dstHeight = pt->array_size;
|
||||
}
|
||||
else {
|
||||
dstHeight = u_minify(pt->height0, dstLevel);
|
||||
}
|
||||
if (texObj->Target == GL_TEXTURE_2D_ARRAY) {
|
||||
dstDepth = pt->array_size;
|
||||
}
|
||||
else {
|
||||
dstDepth = u_minify(pt->depth0, dstLevel);
|
||||
}
|
||||
|
||||
dstImage = _mesa_get_tex_image(ctx, texObj, target, dstLevel);
|
||||
if (!dstImage) {
|
||||
|
@@ -357,7 +357,7 @@ public:
|
||||
|
||||
/** List of immediate_storage */
|
||||
exec_list immediates;
|
||||
int num_immediates;
|
||||
unsigned num_immediates;
|
||||
|
||||
/** List of function_entry */
|
||||
exec_list function_signatures;
|
||||
@@ -2815,6 +2815,10 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor()
|
||||
indirect_addr_temps = false;
|
||||
indirect_addr_consts = false;
|
||||
mem_ctx = ralloc_context(NULL);
|
||||
ctx = NULL;
|
||||
prog = NULL;
|
||||
shader_program = NULL;
|
||||
options = NULL;
|
||||
}
|
||||
|
||||
glsl_to_tgsi_visitor::~glsl_to_tgsi_visitor()
|
||||
@@ -3645,6 +3649,7 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
|
||||
v->indirect_addr_temps = original->indirect_addr_temps;
|
||||
v->indirect_addr_consts = original->indirect_addr_consts;
|
||||
memcpy(&v->immediates, &original->immediates, sizeof(v->immediates));
|
||||
v->num_immediates = original->num_immediates;
|
||||
|
||||
/*
|
||||
* Get initial pixel color from the texture.
|
||||
@@ -3775,6 +3780,7 @@ get_bitmap_visitor(struct st_fragment_program *fp,
|
||||
v->indirect_addr_temps = original->indirect_addr_temps;
|
||||
v->indirect_addr_consts = original->indirect_addr_consts;
|
||||
memcpy(&v->immediates, &original->immediates, sizeof(v->immediates));
|
||||
v->num_immediates = original->num_immediates;
|
||||
|
||||
/* TEX tmp0, fragment.texcoord[0], texture[0], 2D; */
|
||||
coord = st_src_reg(PROGRAM_INPUT, FRAG_ATTRIB_TEX0, glsl_type::vec2_type);
|
||||
@@ -4679,8 +4685,10 @@ st_translate_program(
|
||||
i = 0;
|
||||
foreach_iter(exec_list_iterator, iter, program->immediates) {
|
||||
immediate_storage *imm = (immediate_storage *)iter.get();
|
||||
assert(i < program->num_immediates);
|
||||
t->immediates[i++] = emit_immediate(t, imm->values, imm->type, imm->size);
|
||||
}
|
||||
assert(i == program->num_immediates);
|
||||
|
||||
/* texture samplers */
|
||||
for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
|
||||
|
@@ -222,6 +222,9 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
|
||||
|
||||
DBG("%s \n", __FUNCTION__);
|
||||
|
||||
if (!stImage->pt)
|
||||
return NULL;
|
||||
|
||||
if (stObj->pt != stImage->pt)
|
||||
level = 0;
|
||||
else
|
||||
|
@@ -1,6 +1,6 @@
|
||||
AM_CFLAGS = -I$(top_builddir)/src/glx -I$(top_builddir)/src/mapi \
|
||||
AM_CFLAGS = -I$(top_builddir)/src/glx -I$(top_builddir)/src/mapi -I$(top_builddir)/include \
|
||||
$(X11_CFLAGS) $(GTEST_CFLAGS)
|
||||
AM_CXXFLAGS = -I$(top_builddir)/src/glx -I$(top_builddir)/src/mapi \
|
||||
AM_CXXFLAGS = -I$(top_builddir)/src/glx -I$(top_builddir)/src/mapi -I$(top_builddir)/include \
|
||||
$(X11_CFLAGS) $(GTEST_CFLAGS)
|
||||
|
||||
if HAVE_GTEST
|
||||
|
@@ -40,7 +40,7 @@ public:
|
||||
this->display = glx_dpy;
|
||||
this->dpy = (glx_dpy != NULL) ? glx_dpy->dpy : NULL;
|
||||
|
||||
this->serverGLXexts = new char[strlen(ext)];
|
||||
this->serverGLXexts = new char[strlen(ext) + 1];
|
||||
strcpy((char *) this->serverGLXexts, ext);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user