diff options
Diffstat (limited to 'mesalib')
29 files changed, 392 insertions, 94 deletions
diff --git a/mesalib/Makefile.am b/mesalib/Makefile.am index c9aadc827..453e5f672 100644 --- a/mesalib/Makefile.am +++ b/mesalib/Makefile.am @@ -102,4 +102,4 @@ checksums: $(ARCHIVES) @-sha256sum $(PACKAGE_NAME).tar.bz2 @-sha256sum $(PACKAGE_NAME).zip -.PHONY: tarballs md5 +.PHONY: tarballs checksums diff --git a/mesalib/configure.ac b/mesalib/configure.ac index aa7d1f27d..be85fd51b 100644 --- a/mesalib/configure.ac +++ b/mesalib/configure.ac @@ -41,6 +41,7 @@ GLPROTO_REQUIRED=1.4.14 LIBOMXIL_BELLAGIO_REQUIRED=0.0 VDPAU_REQUIRED=0.4.1 WAYLAND_REQUIRED=1.2.0 +XCB_REQUIRED=1.9.3 XCBDRI2_REQUIRED=1.8 XCBGLX_REQUIRED=1.8.1 XSHMFENCE_REQUIRED=1.1 @@ -57,6 +58,8 @@ AC_CHECK_PROGS([PYTHON2], [python2 python]) AC_PROG_SED AC_PROG_MKDIR_P +AC_SYS_LARGEFILE + LT_PREREQ([2.2]) LT_INIT([disable-static]) @@ -356,6 +359,24 @@ LDFLAGS=$save_LDFLAGS AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") dnl +dnl Check if linker supports dynamic list files +dnl +AC_MSG_CHECKING([if the linker supports --dynamic-list]) +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,--dynamic-list=conftest.dyn" +cat > conftest.dyn <<EOF +{ + radeon_drm_winsys_create; +}; +EOF +AC_LINK_IFELSE( + [AC_LANG_SOURCE([int main() { return 0;}])], + [have_ld_dynamic_list=yes;AC_MSG_RESULT(yes)], + [have_ld_dynamic_list=no; AC_MSG_RESULT(no)]) +LDFLAGS=$save_LDFLAGS +AM_CONDITIONAL(HAVE_LD_DYNAMIC_LIST, test "$have_ld_dynamic_list" = "yes") + +dnl dnl compatibility symlinks dnl case "$host_os" in @@ -886,8 +907,9 @@ dnl case "x$enable_glx$enable_xlib_glx" in xyesyes) # Xlib-based GLX - PKG_CHECK_MODULES([XLIBGL], [x11 xext]) - GL_PC_REQ_PRIV="x11 xext" + dri_modules="x11 xext xcb" + PKG_CHECK_MODULES([XLIBGL], [$dri_modules]) + GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" GL_LIB_DEPS="$XLIBGL_LIBS" GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" @@ -898,7 +920,7 @@ xyesno) PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) # find the DRI deps for libGL - dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= $XCBGLX_REQUIRED" + dri_modules="x11 xext xdamage xfixes x11-xcb xcb xcb-glx >= $XCBGLX_REQUIRED" if test x"$driglx_direct" = xyes; then if test x"$dri_platform" = xdrm ; then @@ -919,6 +941,7 @@ xyesno) fi if test x"$enable_dri3" = xyes; then + PKG_CHECK_EXISTS([xcb >= $XCB_REQUIRED], [], AC_MSG_ERROR([DRI3 requires xcb >= $XCB_REQUIRED])) dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED" fi fi @@ -1387,22 +1410,22 @@ if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then fi if test "x$enable_xvmc" = xyes; then - PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) + PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc" enable_gallium_loader=yes fi AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes) if test "x$enable_vdpau" = xyes; then - PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED], - [VDPAU_LIBS="`$PKG_CONFIG --libs x11-xcb xcb-dri2`"]) + PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED], + [VDPAU_LIBS="`$PKG_CONFIG --libs x11-xcb xcb xcb-dri2`"]) GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau" enable_gallium_loader=yes fi AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes) if test "x$enable_omx" = xyes; then - PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) + PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS omx" enable_gallium_loader=yes fi @@ -1525,7 +1548,7 @@ for plat in $egl_platforms; do ;; x11) - PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes]) + PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes]) ;; drm) diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html index 5fb55670e..5d18dd25c 100644 --- a/mesalib/docs/index.html +++ b/mesalib/docs/index.html @@ -16,6 +16,12 @@ <h1>News</h1> +<h2>September 6, 2014</h2> +<p> +<a href="relnotes/10.2.7.html">Mesa 10.2.7</a> is released. +This is a bug-fix release. +</p> + <h2>August 19, 2014</h2> <p> <a href="relnotes/10.2.6.html">Mesa 10.2.6</a> is released. diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html index b84f498ca..36bcd139b 100644 --- a/mesalib/docs/relnotes.html +++ b/mesalib/docs/relnotes.html @@ -21,6 +21,7 @@ The release notes summarize what's new or changed in each Mesa release. </p> <ul> +<li><a href="relnotes/10.2.7.html">10.2.7 release notes</a> <li><a href="relnotes/10.2.6.html">10.2.6 release notes</a> <li><a href="relnotes/10.2.5.html">10.2.5 release notes</a> <li><a href="relnotes/10.2.4.html">10.2.4 release notes</a> diff --git a/mesalib/docs/relnotes/10.2.7.html b/mesalib/docs/relnotes/10.2.7.html new file mode 100644 index 000000000..1439e409c --- /dev/null +++ b/mesalib/docs/relnotes/10.2.7.html @@ -0,0 +1,211 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>Mesa Release Notes</title> + <link rel="stylesheet" type="text/css" href="../mesa.css"> +</head> +<body> + +<div class="header"> + <h1>The Mesa 3D Graphics Library</h1> +</div> + +<iframe src="../contents.html"></iframe> +<div class="content"> + +<h1>Mesa 10.2.7 Release Notes / September 06, 2014</h1> + +<p> +Mesa 10.2.7 is a bug fix release which fixes bugs found since the 10.2.6 release. +</p> +<p> +Mesa 10.2.7 implements the OpenGL 3.3 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 3.3. OpenGL +3.3 is <strong>only</strong> available if requested at context creation +because compatibility contexts are not supported. +</p> + +<h2>SHA256 checksums</h2> +<pre> +cb67dfaabf88acba29aa2cf0dd58ee17b21ebf9594f8d1226c41794da8de3e9d MesaLib-10.2.7.tar.gz +27b958063a4c002071f14ed45c7d2a1ee52cd85e4ac8876e8a1c273495a7d43f MesaLib-10.2.7.tar.bz2 +a2796a2d5bbbc2edd22857ecc267cba68dfe5d0296f5d84ba7510877b216cc40 MesaLib-10.2.7.zip +</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=36193">Bug 36193</a> - [i965] brw_eu_emit.c:182: validate_reg: Assertion `execsize >= width' failed.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=66184">Bug 66184</a> - src/mesa/state_tracker/st_glsl_to_tgsi.cpp:3216:simplify_cmp: Assertion `inst->dst.index < 4096' failed.</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=70441">Bug 70441</a> - [Gen4-5 clip] Piglit spec_OpenGL_1.1_polygon-offset hits (execsize >= width) assertion</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76188">Bug 76188</a> - EGL_EXT_image_dma_buf_import fd ownership is incorrect</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=76789">Bug 76789</a> - [radeonsi] si_descriptors.c requires -std=gnu99 or -fms-extensions</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82139">Bug 82139</a> - [r600g, bisected] multiple ubo piglit regressions</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82255">Bug 82255</a> - [VP2] Chroma planes are vertically stretched during VDPAU playback</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82671">Bug 82671</a> - [r600g-evergreen][compute]Empty kernel execution causes crash</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82709">Bug 82709</a> - OpenCL not working on radeon hainan</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82814">Bug 82814</a> - glDrawBuffers(0, NULL) segfaults in _mesa_drawbuffers</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83079">Bug 83079</a> - [NVC0] Dota 2 (Linux native and Wine) crash with Nouveau Drivers</li> + +<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83355">Bug 83355</a> - FTBFS: src/mesa/program/program_lexer.l:122:64: error: unknown type name 'YYSTYPE'</li> + +</ul> + + +<h2>Changes</h2> + +<p>Adam Jackson (1):</p> +<ul> + <li>radeonsi: Don't use anonymous struct trick in atom tracking</li> +</ul> + +<p>Alex Deucher (2):</p> +<ul> + <li>radeonsi: add new CIK pci ids</li> + <li>radeonsi: add new SI pci ids</li> +</ul> + +<p>Andreas Boll (1):</p> +<ul> + <li>winsys/radeon: fix nop packet padding for hawaii</li> +</ul> + +<p>Anuj Phogat (1):</p> +<ul> + <li>i965: Bail on vec4 copy propagation for scratch writes with source modifiers</li> +</ul> + +<p>Brian Paul (1):</p> +<ul> + <li>mesa: fix NULL pointer deref bug in _mesa_drawbuffers()</li> +</ul> + +<p>Carl Worth (2):</p> +<ul> + <li>docs: Add sha256 sums for the 10.2.6 release</li> + <li>Makefile: Switch from md5sums to sha256sums</li> +</ul> + +<p>Dave Airlie (1):</p> +<ul> + <li>i965: add missing parens in vec4 visitor</li> +</ul> + +<p>Emil Velikov (17):</p> +<ul> + <li>configure.ac: bail out if building gallium_gbm without gallium_egl</li> + <li>android: gallium/nouveau: fix include folders, link against libstlport</li> + <li>android: egl/main: fixup the nouveau build</li> + <li>automake: gallium/freedreno: drop spurious include dirs</li> + <li>android: gallium/freedreno: add preliminary build</li> + <li>android: egl/main: add/enable freedreno</li> + <li>android: gallium/auxiliary: drop log2/log2f redefitions</li> + <li>android: drop HAL_PIXEL_FORMAT_RGBA_{5551,4444}</li> + <li>android: glsl: the stlport over the limited Android STL</li> + <li>android: dri/i915: do not build an 'empty' driver</li> + <li>cherry-ignore: remove patch that lacking previous dependencies</li> + <li>cherry-ignore: PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE is not it 10.2</li> + <li>cherry-ignore: drop whitespace fix</li> + <li>cherry-ignore: reject a15088338eb</li> + <li>get-pick-list.sh: Require explicit "10.2" for nominating stable patches</li> + <li>mesa: fix make tarballs</li> + <li>Update VERSION to 10.2.7</li> +</ul> + +<p>Ian Romanick (1):</p> +<ul> + <li>mesa: Handle uninitialized textures like other textures in get_tex_level_parameter_image</li> +</ul> + +<p>Ilia Mirkin (9):</p> +<ul> + <li>nouveau: make sure to invalidate any vbo state as well</li> + <li>nouveau: don't keep stale pointer to free'd data</li> + <li>nvc0/ir: avoid infinite recursion when finding first uses of tex</li> + <li>nv50: zero out unbound samplers</li> + <li>nvc0: don't make 1d staging textures linear</li> + <li>nv50/ir: avoid creating instructions that can't be emitted</li> + <li>nv50: set the miptree address when clearing bo's in vp2 init</li> + <li>nv50: mt address may not be the underlying bo's start address</li> + <li>nv50: attach the buffer bo to the miptree structures</li> +</ul> + +<p>Jan Vesely (1):</p> +<ul> + <li>gallivm: Fix build with latest LLVM</li> +</ul> + +<p>José Fonseca (1):</p> +<ul> + <li>mesa: Move declaration to top of block.</li> +</ul> + +<p>Kenneth Graunke (3):</p> +<ul> + <li>i965/vec4: Set NoMask for GS_OPCODE_SET_VERTEX_COUNT on Gen8+.</li> + <li>i965/vec4: Respect ir->force_writemask_all in Gen8 code generation.</li> + <li>i965/clip: Fix brw_clip_unfilled.c/compute_offset's assembly.</li> +</ul> + +<p>Marek Olšák (3):</p> +<ul> + <li>r600g: fix constant buffer fetches</li> + <li>radeonsi: save scissor state and sample mask for u_blitter</li> + <li>glsl_to_tgsi: allocate and enlarge arrays for temporaries on demand</li> +</ul> + +<p>Paulo Sergio Travaglia (2):</p> +<ul> + <li>android: gallium/radeon: attempt to fix the android build</li> + <li>android: egl/main: resolve radeon linking issues</li> +</ul> + +<p>Pekka Paalanen (1):</p> +<ul> + <li>egl_dri2: fix EXT_image_dma_buf_import fds</li> +</ul> + +<p>Robert Bragg (1):</p> +<ul> + <li>meta: save and restore swizzle for _GenerateMipmap</li> +</ul> + +<p>Tom Stellard (7):</p> +<ul> + <li>radeon/compute: Fix reported values for MAX_GLOBAL_SIZE and MAX_MEM_ALLOC_SIZE</li> + <li>radeonsi/compute: Update reference counts for buffers in si_set_global_binding()</li> + <li>radeonsi/compute: Call si_pm4_free_state() after emitting compute state</li> + <li>clover: Flush the command queue in clReleaseCommandQueue()</li> + <li>radeon: Add work-around for missing Hainan support in clang < 3.6 v2</li> + <li>pipe-loader: Fix memory leak v2</li> + <li>r600g/compute: Don't initialize vertex_buffer_state masks to 0x2</li> +</ul> + +<p>Vinson Lee (1):</p> +<ul> + <li>gallivm: Fix build with LLVM >= 3.6 r215967.</li> +</ul> + + +</div> +</body> +</html> diff --git a/mesalib/src/gallium/Makefile.am b/mesalib/src/gallium/Makefile.am index e4ef00346..32a5dc709 100644 --- a/mesalib/src/gallium/Makefile.am +++ b/mesalib/src/gallium/Makefile.am @@ -177,7 +177,11 @@ endif ## EXTRA_DIST += \ - state_trackers/hgl targets/haiku-softpipe + state_trackers/README \ + state_trackers/wgl targets/libgl-gdi \ + targets/graw-gdi targets/graw-null targets/graw-xlib \ + state_trackers/hgl targets/haiku-softpipe \ + tools ## @@ -189,3 +193,7 @@ SUBDIRS += \ tests/trivial \ tests/unit endif + +EXTRA_DIST += \ + tests/graw \ + tests/python diff --git a/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp b/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp index 7c5d80f43..d878cb078 100644 --- a/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp +++ b/mesalib/src/glsl/lower_variable_index_to_cond_assign.cpp @@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index, ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index); assert(index->type->is_scalar()); - assert(index->type->base_type == GLSL_TYPE_INT); + assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT); assert(components >= 1 && components <= 4); if (components > 1) { diff --git a/mesalib/src/glsl/opt_copy_propagation_elements.cpp b/mesalib/src/glsl/opt_copy_propagation_elements.cpp index f5f59b7d3..c3e55bcd1 100644 --- a/mesalib/src/glsl/opt_copy_propagation_elements.cpp +++ b/mesalib/src/glsl/opt_copy_propagation_elements.cpp @@ -207,8 +207,9 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) int swizzle_chan[4]; ir_dereference_variable *deref_var; ir_variable *source[4] = {NULL, NULL, NULL, NULL}; - int source_chan[4]; + int source_chan[4] = {0, 0, 0, 0}; int chans; + bool noop_swizzle = true; if (!*ir) return; @@ -250,6 +251,9 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) if (entry->write_mask & (1 << swizzle_chan[c])) { source[c] = entry->rhs; source_chan[c] = entry->swizzle[swizzle_chan[c]]; + + if (source_chan[c] != swizzle_chan[c]) + noop_swizzle = false; } } } @@ -266,6 +270,12 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) if (!shader_mem_ctx) shader_mem_ctx = ralloc_parent(deref_var); + /* Don't pointlessly replace the rvalue with itself (or a noop swizzle + * of itself, which would just be deleted by opt_noop_swizzle). + */ + if (source[0] == var && noop_swizzle) + return; + if (debug) { printf("Copy propagation from:\n"); (*ir)->print(); @@ -278,6 +288,7 @@ ir_copy_propagation_elements_visitor::handle_rvalue(ir_rvalue **ir) source_chan[2], source_chan[3], chans); + progress = true; if (debug) { printf("to:\n"); diff --git a/mesalib/src/loader/loader.c b/mesalib/src/loader/loader.c index 47e1f5874..bdd390691 100644 --- a/mesalib/src/loader/loader.c +++ b/mesalib/src/loader/loader.c @@ -402,7 +402,7 @@ int loader_get_user_preferred_fd(int default_fd, int *different_device) } fd = drm_open_device(device_name); - if (fd > 0) { + if (fd >= 0) { close(default_fd); } else { fd = default_fd; diff --git a/mesalib/src/mapi/glapi/gen/gl_gentable.py b/mesalib/src/mapi/glapi/gen/gl_gentable.py index f71e06fe4..73e39ae4b 100755 --- a/mesalib/src/mapi/glapi/gen/gl_gentable.py +++ b/mesalib/src/mapi/glapi/gen/gl_gentable.py @@ -113,7 +113,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table * _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) { - struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc)); + struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(_glapi_proc)); char symboln[512]; if(!disp) diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 90befd42d..7a8e627ba 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -396,25 +396,6 @@ _mesa_meta_init(struct gl_context *ctx) ctx->Meta = CALLOC_STRUCT(gl_meta_state); } -static GLenum -gl_buffer_index_to_drawbuffers_enum(gl_buffer_index bufindex) -{ - assert(bufindex < BUFFER_COUNT); - - if (bufindex >= BUFFER_COLOR0) - return GL_COLOR_ATTACHMENT0 + bufindex - BUFFER_COLOR0; - else if (bufindex == BUFFER_FRONT_LEFT) - return GL_FRONT_LEFT; - else if (bufindex == BUFFER_FRONT_RIGHT) - return GL_FRONT_RIGHT; - else if (bufindex == BUFFER_BACK_LEFT) - return GL_BACK_LEFT; - else if (bufindex == BUFFER_BACK_RIGHT) - return GL_BACK_RIGHT; - - return GL_NONE; -} - /** * Free context meta-op state. * To be called once during context destruction. @@ -806,20 +787,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) } if (state & MESA_META_DRAW_BUFFERS) { - int buf, real_color_buffers = 0; - memset(save->ColorDrawBuffers, 0, sizeof(save->ColorDrawBuffers)); - - for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { - int buf_index = ctx->DrawBuffer->_ColorDrawBufferIndexes[buf]; - if (buf_index == -1) - continue; - - save->ColorDrawBuffers[buf] = - gl_buffer_index_to_drawbuffers_enum(buf_index); - - if (++real_color_buffers >= ctx->DrawBuffer->_NumColorDrawBuffers) - break; - } + struct gl_framebuffer *fb = ctx->DrawBuffer; + memcpy(save->ColorDrawBuffers, fb->ColorDrawBuffer, + sizeof(save->ColorDrawBuffers)); } /* misc */ @@ -1224,7 +1194,7 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_BindRenderbuffer(GL_RENDERBUFFER, save->RenderbufferName); if (state & MESA_META_DRAW_BUFFERS) { - _mesa_DrawBuffers(ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers); + _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers, NULL); } ctx->Meta->SaveStackDepth--; @@ -1250,7 +1220,7 @@ _mesa_meta_in_progress(struct gl_context *ctx) * Used by the meta-Clear, Draw/CopyPixels and Bitmap functions where the Z * value comes from the clear value or raster position. */ -static INLINE GLfloat +static inline GLfloat invert_z(GLfloat normZ) { GLfloat objZ = 1.0f - 2.0f * normZ; diff --git a/mesalib/src/mesa/drivers/common/meta.h b/mesalib/src/mesa/drivers/common/meta.h index 56ba9bc65..edc3e8c20 100644 --- a/mesalib/src/mesa/drivers/common/meta.h +++ b/mesalib/src/mesa/drivers/common/meta.h @@ -235,21 +235,45 @@ struct blit_shader_table { /** * Indices in the blit_state->msaa_shaders[] array * - * Note that setup_glsl_msaa_blit_shader() assumes that the _INT enums are one - * more than the non-_INT version and _UINT is one beyond that. + * Note that setup_glsl_msaa_blit_shader() assumes that the _INT enums are five + * more than the corresponding non-_INT versions and _UINT are five beyond that. */ enum blit_msaa_shader { - BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE, - BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT, - BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT, + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE, + BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE, + BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE, + BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE, + BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE, + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT, + BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT, + BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT, + BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT, + BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT, + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT, + BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT, + BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT, + BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT, + BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT, BLIT_MSAA_SHADER_2D_MULTISAMPLE_COPY, BLIT_MSAA_SHADER_2D_MULTISAMPLE_COPY_INT, BLIT_MSAA_SHADER_2D_MULTISAMPLE_COPY_UINT, BLIT_MSAA_SHADER_2D_MULTISAMPLE_DEPTH_RESOLVE, BLIT_MSAA_SHADER_2D_MULTISAMPLE_DEPTH_COPY, - BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, - BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, - BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, + BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, + BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, + BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, + BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE, + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, + BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, + BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, + BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, + BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_INT, + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, + BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, + BLIT_4X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, + BLIT_8X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, + BLIT_16X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE_UINT, BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_COPY, BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_COPY_INT, BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_COPY_UINT, diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c index 955e73f57..fc9848a7a 100644 --- a/mesalib/src/mesa/drivers/common/meta_blit.c +++ b/mesalib/src/mesa/drivers/common/meta_blit.c @@ -70,6 +70,16 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, const char *sampler_array_suffix = ""; char *name; const char *texcoord_type = "vec2"; + const int samples = MAX2(src_rb->NumSamples, 1); + int shader_offset = 0; + + /* We expect only power of 2 samples in source multisample buffer. */ + assert((samples & (samples - 1)) == 0); + while (samples >> (shader_offset + 1)) { + shader_offset++; + } + /* Update the assert if we plan to support more than 16X MSAA. */ + assert(shader_offset >= 0 && shader_offset <= 4); if (src_rb) { src_datatype = _mesa_get_format_datatype(src_rb->Format); @@ -107,13 +117,15 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, } else { if (dst_is_msaa) shader_index = BLIT_MSAA_SHADER_2D_MULTISAMPLE_COPY; - else - shader_index = BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE; + else { + shader_index = BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE + + shader_offset; + } } if (target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) { - shader_index += (BLIT_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE - - BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE); + shader_index += (BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_ARRAY_RESOLVE - + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE); sampler_array_suffix = "Array"; texcoord_type = "vec3"; } @@ -121,19 +133,19 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, default: _mesa_problem(ctx, "Unkown texture target %s\n", _mesa_lookup_enum_by_nr(target)); - shader_index = BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE; + shader_index = BLIT_2X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE; } /* We rely on the enum being sorted this way. */ - STATIC_ASSERT(BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT == - BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE + 1); - STATIC_ASSERT(BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT == - BLIT_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE + 2); + STATIC_ASSERT(BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_INT == + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE + 5); + STATIC_ASSERT(BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE_UINT == + BLIT_1X_MSAA_SHADER_2D_MULTISAMPLE_RESOLVE + 10); if (src_datatype == GL_INT) { - shader_index++; + shader_index += 5; vec4_prefix = "i"; } else if (src_datatype == GL_UNSIGNED_INT) { - shader_index += 2; + shader_index += 10; vec4_prefix = "u"; } else { vec4_prefix = ""; @@ -209,7 +221,6 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, /* You can create 2D_MULTISAMPLE textures with 0 sample count (meaning 1 * sample). Yes, this is ridiculous. */ - int samples; char *sample_resolve; const char *arb_sample_shading_extension_string; const char *merge_function; @@ -217,8 +228,6 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx, vec4_prefix, dst_is_msaa ? "copy" : "resolve"); - samples = MAX2(src_rb->NumSamples, 1); - if (dst_is_msaa) { arb_sample_shading_extension_string = "#extension GL_ARB_sample_shading : enable"; sample_resolve = ralloc_asprintf(mem_ctx, " out_color = texelFetch(texSampler, i%s(texCoords), gl_SampleID);", texcoord_type); diff --git a/mesalib/src/mesa/drivers/common/meta_copy_image.c b/mesalib/src/mesa/drivers/common/meta_copy_image.c index c40c2f011..0c204b87d 100644 --- a/mesalib/src/mesa/drivers/common/meta_copy_image.c +++ b/mesalib/src/mesa/drivers/common/meta_copy_image.c @@ -74,7 +74,7 @@ make_view(struct gl_context *ctx, struct gl_texture_image *tex_image, tex_image->Depth, 0, internal_format, tex_format); - view_tex_obj->MinLevel = 0; + view_tex_obj->MinLevel = tex_image->Level; view_tex_obj->NumLevels = 1; view_tex_obj->MinLayer = tex_obj->MinLayer; view_tex_obj->NumLayers = tex_obj->NumLayers; diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c index e0b3db8cf..f2e63c0b9 100644 --- a/mesalib/src/mesa/drivers/dri/common/utils.c +++ b/mesalib/src/mesa/drivers/dri/common/utils.c @@ -238,7 +238,7 @@ driCreateConfigs(mesa_format format, is_srgb = _mesa_get_format_color_encoding(format) == GL_SRGB; num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes; - configs = calloc(1, (num_modes + 1) * sizeof *configs); + configs = calloc(num_modes + 1, sizeof *configs); if (configs == NULL) return NULL; diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index ebeba8883..536326f6e 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -75,7 +75,7 @@ typedef struct { /** Cast wrapper */ -static INLINE AEcontext * +static inline AEcontext * AE_CONTEXT(struct gl_context *ctx) { return (AEcontext *) ctx->aelt_context; @@ -87,7 +87,7 @@ AE_CONTEXT(struct gl_context *ctx) * in the range [0, 7]. Luckily these type tokens are sequentially * numbered in gl.h, except for GL_DOUBLE. */ -static INLINE int +static inline int TYPE_IDX(GLenum t) { return t == GL_DOUBLE ? 7 : t & 7; diff --git a/mesalib/src/mesa/main/atifragshader.c b/mesalib/src/mesa/main/atifragshader.c index 7077c96f1..1eab7731a 100644 --- a/mesalib/src/mesa/main/atifragshader.c +++ b/mesalib/src/mesa/main/atifragshader.c @@ -325,11 +325,11 @@ _mesa_BeginFragmentShaderATI(void) a start */ for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { ctx->ATIFragmentShader.Current->Instructions[i] = - calloc(1, sizeof(struct atifs_instruction) * - (MAX_NUM_INSTRUCTIONS_PER_PASS_ATI)); + calloc(sizeof(struct atifs_instruction), + MAX_NUM_INSTRUCTIONS_PER_PASS_ATI); ctx->ATIFragmentShader.Current->SetupInst[i] = - calloc(1, sizeof(struct atifs_setupinst) * - (MAX_NUM_FRAGMENT_REGISTERS_ATI)); + calloc(sizeof(struct atifs_setupinst), + MAX_NUM_FRAGMENT_REGISTERS_ATI); } /* can't rely on calloc for initialization as it's possible to redefine a shader (?) */ diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index c656845df..2e289b6f1 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -1488,6 +1488,10 @@ copy_array_attrib(struct gl_context *ctx, /* skip ArrayBufferObj */ /* skip IndexBufferObj */ + + /* Invalidate draw state. It will be updated during the next draw. */ + dest->DrawMethod = DRAW_NONE; + dest->_DrawArrays = NULL; } /** diff --git a/mesalib/src/mesa/main/compiler.h b/mesalib/src/mesa/main/compiler.h index 35160223e..813bf1905 100644 --- a/mesalib/src/mesa/main/compiler.h +++ b/mesalib/src/mesa/main/compiler.h @@ -151,7 +151,7 @@ extern "C" { #include <CoreFoundation/CFByteOrder.h> #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) #elif (defined(_AIX) || defined(__blrts)) -static INLINE GLuint CPU_TO_LE32(GLuint x) +static inline GLuint CPU_TO_LE32(GLuint x) { return (((x & 0x000000ff) << 24) | ((x & 0x0000ff00) << 8) | diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index fbdbd680a..8b5693e37 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -653,6 +653,9 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api) /* GL_ARB_framebuffer_object */ consts->MaxSamples = 0; + /* GLSL default if NativeIntegers == FALSE */ + consts->UniformBooleanTrue = FLT_AS_UINT(1.0f); + /* GL_ARB_sync */ consts->MaxServerWaitTimeout = 0x1fff7fffffffULL; diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index 947efac1f..e1880f59b 100644 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -184,12 +184,19 @@ static inline GLfloat UINT_AS_FLT(GLuint u) return tmp.f; } +static inline unsigned FLT_AS_UINT(float f) +{ + fi_type tmp; + tmp.f = f; + return tmp.u; +} + /** * Convert a floating point value to an unsigned fixed point value. * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE uint32_t +static inline uint32_t U_FIXED(float value, uint32_t frac_bits) { value *= (1 << frac_bits); @@ -201,7 +208,7 @@ U_FIXED(float value, uint32_t frac_bits) * * \param frac_bits The number of bits used to store the fractional part. */ -static INLINE int32_t +static inline int32_t S_FIXED(float value, uint32_t frac_bits) { return (int32_t) (value * (1 << frac_bits)); diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index d2aba8ba1..f913e42d3 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -1634,6 +1634,8 @@ texstore_via_float(TEXSTORE_PARAMS) } } + free(tmp_row); + return GL_TRUE; } @@ -1702,6 +1704,8 @@ texstore_rgba_integer(TEXSTORE_PARAMS) } } + free(tmp_row); + return GL_TRUE; } diff --git a/mesalib/src/mesa/program/prog_instruction.c b/mesalib/src/mesa/program/prog_instruction.c index dcfedb77b..dc0a5109f 100644 --- a/mesalib/src/mesa/program/prog_instruction.c +++ b/mesalib/src/mesa/program/prog_instruction.c @@ -70,7 +70,7 @@ struct prog_instruction * _mesa_alloc_instructions(GLuint numInst) { return - calloc(1, numInst * sizeof(struct prog_instruction)); + calloc(numInst, sizeof(struct prog_instruction)); } diff --git a/mesalib/src/mesa/program/prog_optimize.c b/mesalib/src/mesa/program/prog_optimize.c index 6153f5e2c..08c1c3046 100644 --- a/mesalib/src/mesa/program/prog_optimize.c +++ b/mesalib/src/mesa/program/prog_optimize.c @@ -260,7 +260,7 @@ _mesa_remove_dead_code_global(struct gl_program *prog) } removeInst = - calloc(1, prog->NumInstructions * sizeof(GLboolean)); + calloc(prog->NumInstructions, sizeof(GLboolean)); /* Determine which temps are read and written */ for (i = 0; i < prog->NumInstructions; i++) { @@ -602,7 +602,7 @@ _mesa_remove_dead_code_local(struct gl_program *prog) GLuint i, arg, rem = 0; removeInst = - calloc(1, prog->NumInstructions * sizeof(GLboolean)); + calloc(prog->NumInstructions, sizeof(GLboolean)); for (i = 0; i < prog->NumInstructions; i++) { const struct prog_instruction *inst = prog->Instructions + i; @@ -743,7 +743,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) } removeInst = - calloc(1, prog->NumInstructions * sizeof(GLboolean)); + calloc(prog->NumInstructions, sizeof(GLboolean)); /* * Look for sequences such as this: diff --git a/mesalib/src/mesa/program/prog_parameter.c b/mesalib/src/mesa/program/prog_parameter.c index 54531d255..f43deba0b 100644 --- a/mesalib/src/mesa/program/prog_parameter.c +++ b/mesalib/src/mesa/program/prog_parameter.c @@ -54,7 +54,7 @@ _mesa_new_parameter_list_sized(unsigned size) /* alloc arrays */ p->Parameters = (struct gl_program_parameter *) - calloc(1, size * sizeof(struct gl_program_parameter)); + calloc(size, sizeof(struct gl_program_parameter)); p->ParameterValues = (gl_constant_value (*)[4]) _mesa_align_malloc(size * 4 *sizeof(gl_constant_value), 16); diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 9db648c03..07bd12567 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -34,6 +34,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" +#include "util/u_math.h" #include "st_context.h" #include "st_extensions.h" @@ -274,8 +275,6 @@ void st_init_limits(struct pipe_screen *screen, c->MinProgramTextureGatherOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET); c->MaxProgramTextureGatherOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET); - c->UniformBooleanTrue = ~0; - c->MaxTransformFeedbackBuffers = screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS); c->MaxTransformFeedbackBuffers = MIN2(c->MaxTransformFeedbackBuffers, MAX_FEEDBACK_BUFFERS); @@ -621,7 +620,6 @@ void st_init_extensions(struct pipe_screen *screen, extensions->NV_fog_distance = GL_TRUE; extensions->NV_texture_env_combine4 = GL_TRUE; extensions->NV_texture_rectangle = GL_TRUE; - extensions->NV_vdpau_interop = GL_TRUE; extensions->OES_EGL_image = GL_TRUE; extensions->OES_EGL_image_external = GL_TRUE; @@ -700,6 +698,8 @@ void st_init_extensions(struct pipe_screen *screen, } } + consts->UniformBooleanTrue = consts->NativeIntegers ? ~0 : fui(1.0f); + /* Below are the cases which cannot be moved into tables easily. */ if (!has_lib_dxtc && !options->force_s3tc_enable) { @@ -884,4 +884,11 @@ void st_init_extensions(struct pipe_screen *screen, PIPE_BIND_SAMPLER_VIEW)) { extensions->ARB_ES3_compatibility = GL_TRUE; } + + if (screen->get_video_param && + screen->get_video_param(screen, PIPE_VIDEO_PROFILE_UNKNOWN, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_SUPPORTS_INTERLACED)) { + extensions->NV_vdpau_interop = GL_TRUE; + } } diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index dd9c84f1a..62e4101d1 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3091,8 +3091,18 @@ glsl_to_tgsi_visitor::visit(ir_discard *ir) { if (ir->condition) { ir->condition->accept(this); - this->result.negate = ~this->result.negate; - emit(ir, TGSI_OPCODE_KILL_IF, undef_dst, this->result); + st_src_reg condition = this->result; + + /* Convert the bool condition to a float so we can negate. */ + if (native_integers) { + st_src_reg temp = get_temp(ir->condition->type); + emit(ir, TGSI_OPCODE_AND, st_dst_reg(temp), + condition, st_src_reg_for_float(1.0)); + condition = temp; + } + + condition.negate = ~condition.negate; + emit(ir, TGSI_OPCODE_KILL_IF, undef_dst, condition); } else { /* unconditional kil */ emit(ir, TGSI_OPCODE_KILL); diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c index c3fd900b4..65cf52e21 100644 --- a/mesalib/src/mesa/swrast/s_texfilter.c +++ b/mesalib/src/mesa/swrast/s_texfilter.c @@ -804,7 +804,7 @@ get_border_color(const struct gl_sampler_object *samp, /** * Put z into texel according to GL_DEPTH_MODE. */ -static INLINE void +static inline void apply_depth_mode(GLenum depthMode, GLfloat z, GLfloat texel[4]) { switch (depthMode) { diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index 3f7058da1..22557e168 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -1313,7 +1313,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, if (primcount == 0) return; - prim = calloc(1, primcount * sizeof(*prim)); + prim = calloc(primcount, sizeof(*prim)); if (prim == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements"); return; |