Compare commits
46 Commits
mesa-10.6.
...
10.6
Author | SHA1 | Date | |
---|---|---|---|
|
8957b696f9 | ||
|
ab9aacce2d | ||
|
1c261a97ec | ||
|
00aa3ee7cf | ||
|
256df77d51 | ||
|
f20d5a7bfc | ||
|
a1a567c125 | ||
|
f6c645d9d6 | ||
|
0dae12ac6e | ||
|
41b44abdcb | ||
|
1805e64739 | ||
|
5b6ac61231 | ||
|
dad649b66c | ||
|
e0a6546ddd | ||
|
34ad2da6b9 | ||
|
e158605a37 | ||
|
430c84f73c | ||
|
be6c2706c1 | ||
|
78b0f48c3b | ||
|
15020937bd | ||
|
69f2e709aa | ||
|
02387926ad | ||
|
91c6302734 | ||
|
9a4ebbe1ec | ||
|
eb06d2b649 | ||
|
0fe894db48 | ||
|
7b583e0583 | ||
|
8fd7f10ae0 | ||
|
a9df9b1854 | ||
|
a6714a9a04 | ||
|
022892323d | ||
|
34bfebda14 | ||
|
cb2209e9ef | ||
|
2ecfc4e38d | ||
|
3fa83e99de | ||
|
0869fefe1a | ||
|
cefbc3f7c1 | ||
|
3cbe492fb4 | ||
|
1f4ff00356 | ||
|
39ececa386 | ||
|
0a8c727a9d | ||
|
72785668ad | ||
|
d7cdb5be87 | ||
|
ff8f2402fd | ||
|
c5016cc9cb | ||
|
8789dd627c |
8
bin/.cherry-ignore
Normal file
8
bin/.cherry-ignore
Normal file
@@ -0,0 +1,8 @@
|
||||
# The vec4 nir i965 work landed after the 10.6 branchpoint
|
||||
b8d2263c83d29f4626ac0fe0316978aa6262aefb i965/vec4_nir: Load constants as integers
|
||||
|
||||
# The issue/commit it fixes has landed post 10.6 branchpoint
|
||||
afa1efdc8522d987e3af7c7a6272021caa33eb82 mesa: fix errors when reading depth with glReadPixels
|
||||
|
||||
# The issue/commit is fixes has landed post 10.6 branchpoint
|
||||
7f8815bcb9af9b4b374ad7bd6e7cfa7529a6c980 i965: fix textureGrad for cubemaps
|
10
configure.ac
10
configure.ac
@@ -1150,6 +1150,16 @@ AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
|
||||
AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
|
||||
[DEFINES="${DEFINES} -DGLX_USE_TLS"])
|
||||
|
||||
dnl Read-only text section on x86 hardened platforms
|
||||
AC_ARG_ENABLE([glx-read-only-text],
|
||||
[AS_HELP_STRING([--enable-glx-read-only-text],
|
||||
[Disable writable .text section on x86 (decreases performance) @<:@default=disabled@:>@])],
|
||||
[enable_glx_read_only_text="$enableval"],
|
||||
[enable_glx_read_only_text=no])
|
||||
if test "x$enable_glx_read_only_text" = xyes; then
|
||||
DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl More DRI setup
|
||||
dnl
|
||||
|
@@ -31,7 +31,8 @@ because compatibility contexts are not supported.
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
4ba10c59abee30d72476543a57afd2f33803dabf4620dc333b335d47966ff842 mesa-10.6.7.tar.gz
|
||||
feb1f640b915dada88a7c793dfaff0ae23580f8903f87a6b76469253de0d28d8 mesa-10.6.7.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
|
136
docs/relnotes/10.6.8.html
Normal file
136
docs/relnotes/10.6.8.html
Normal file
@@ -0,0 +1,136 @@
|
||||
<!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.6.8 Release Notes / September 20, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.8 is a bug fix release which fixes bugs found since the 10.6.7 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.8 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>
|
||||
1f34dba2a8059782e3e4e0f18b9628004e253b2c69085f735b846d2e63c9e250 mesa-10.6.8.tar.gz
|
||||
e36ee5ceeadb3966fb5ce5b4cf18322dbb76a4f075558ae49c3bba94f57d58fd mesa-10.6.8.tar.xz
|
||||
</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=90621">Bug 90621</a> - Mesa fail to build from git</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91526">Bug 91526</a> - World of Warcraft (on Wine) has UI corruption with nouveau</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91719">Bug 91719</a> - [SNB,HSW,BYT] dEQP regressions associated with using NIR for vertex shaders</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Alejandro Piñeiro (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: fill src_reg type using the constructor type parameter</li>
|
||||
</ul>
|
||||
|
||||
<p>Antia Puentes (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Fix saturation errors when coalescing registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 10.6.7</li>
|
||||
<li>cherry-ignore: add commit non applicable for 10.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Hans de Goede (4):</p>
|
||||
<ul>
|
||||
<li>nv30: Fix creation of scanout buffers</li>
|
||||
<li>nv30: Implement color resolve for msaa</li>
|
||||
<li>nv30: Fix max width / height checks in nv30 sifm code</li>
|
||||
<li>nv30: Disable msaa unless requested from the env by NV30_MAX_MSAA</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (2):</p>
|
||||
<ul>
|
||||
<li>mesa: Pass the type to _mesa_uniform_matrix as a glsl_base_type</li>
|
||||
<li>mesa: Don't allow wrong type setters for matrix uniforms</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (5):</p>
|
||||
<ul>
|
||||
<li>st/mesa: don't fall back to 16F when 32F is requested</li>
|
||||
<li>nvc0: always emit a full shader colormask</li>
|
||||
<li>nvc0: remove BGRA4 format support</li>
|
||||
<li>st/mesa: avoid integer overflows with buffers >= 512MB</li>
|
||||
<li>nv50, nvc0: fix max texture buffer size to 128M elements</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/vec4: Don't reswizzle hardware registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Jose Fonseca (1):</p>
|
||||
<ul>
|
||||
<li>gallivm: Workaround LLVM PR23628.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>i965: Momentarily pretend to support ARB_texture_stencil8 for blits.</li>
|
||||
</ul>
|
||||
|
||||
<p>Oded Gabbay (1):</p>
|
||||
<ul>
|
||||
<li>llvmpipe: convert double to long long instead of unsigned long long</li>
|
||||
</ul>
|
||||
|
||||
<p>Ray Strode (1):</p>
|
||||
<ul>
|
||||
<li>gbm: convert gbm bo format to fourcc format on dma-buf import</li>
|
||||
</ul>
|
||||
|
||||
<p>Ulrich Weigand (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix texture compression on big-endian systems</li>
|
||||
</ul>
|
||||
|
||||
<p>Vinson Lee (1):</p>
|
||||
<ul>
|
||||
<li>gallivm: Do not use NoFramePointerElim with LLVM 3.7.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
130
docs/relnotes/10.6.9.html
Normal file
130
docs/relnotes/10.6.9.html
Normal file
@@ -0,0 +1,130 @@
|
||||
<!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.6.9 Release Notes / Octover 03, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.9 is a bug fix release which fixes bugs found since the 10.6.8 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.6.9 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>
|
||||
3406876aac67546d0c3e2cb97da330b62644c313e7992b95618662e13c54296a mesa-10.6.9.tar.gz
|
||||
b04c4de6280b863babc2929573da17218d92e9e4ba6272d548d135415723e8c3 mesa-10.6.9.tar.xz
|
||||
</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=38109">Bug 38109</a> - i915 driver crashes if too few vertices are submitted (Mesa 7.10.2)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=55552">Bug 55552</a> - Compile errors with --enable-mangling</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86281">Bug 86281</a> - brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08, fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2, partial_clear=partial_clear@entry=false)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91970">Bug 91970</a> - [BSW regression] dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92072">Bug 92072</a> - Wine breakage since d082c5324 (st/mesa: don't call st_validate_state in BlitFramebuffer)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Brian Paul (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats</li>
|
||||
</ul>
|
||||
|
||||
<p>Chris Wilson (1):</p>
|
||||
<ul>
|
||||
<li>i965: Remove early release of DRI2 miptree</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 10.6.8</li>
|
||||
<li>cherry-ignore: add commit non applicable for 10.6</li>
|
||||
<li>cherry-ignore: add commit non applicable for 10.6</li>
|
||||
<li>Update version to 10.6.9</li>
|
||||
</ul>
|
||||
|
||||
<p>Iago Toral Quiroga (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (5):</p>
|
||||
<ul>
|
||||
<li>t_dd_dmatmp: Make "count" actually be the count</li>
|
||||
<li>t_dd_dmatmp: Clean up improper code formatting from previous patch</li>
|
||||
<li>t_dd_dmatmp: Use '& 3' instead of '% 4' everywhere</li>
|
||||
<li>t_dd_dmatmp: Pull out common 'count -= count & 3' code</li>
|
||||
<li>t_dd_dmatmp: Use addition instead of subtraction in loop bounds</li>
|
||||
</ul>
|
||||
|
||||
<p>Jeremy Huddleston (1):</p>
|
||||
<ul>
|
||||
<li>configure.ac: Add support to enable read-only text segment on x86.</li>
|
||||
</ul>
|
||||
|
||||
<p>Kristian Høgsberg Kristensen (1):</p>
|
||||
<ul>
|
||||
<li>i965: Respect stride and subreg_offset for ATTR registers</li>
|
||||
</ul>
|
||||
|
||||
<p>Kyle Brenneman (3):</p>
|
||||
<ul>
|
||||
<li>glx: Fix build errors with --enable-mangling (v2)</li>
|
||||
<li>mapi: Make _glapi_get_stub work with "gl" or "mgl" prefix.</li>
|
||||
<li>glx: Don't hard-code the name "libGL.so.1" in driOpenDriver (v3)</li>
|
||||
</ul>
|
||||
|
||||
<p>Leo Liu (1):</p>
|
||||
<ul>
|
||||
<li>radeon/vce: fix vui time_scale zero error</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>st/mesa: fix front buffer regression after dropping st_validate_state in Blit</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>mesa: fix mipmap generation for immutable, compressed textures</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -311,7 +311,7 @@ lp_build_const_elem(struct gallivm_state *gallivm,
|
||||
else {
|
||||
double dscale = lp_const_scale(type);
|
||||
|
||||
elem = LLVMConstInt(elem_type, round(val*dscale), 0);
|
||||
elem = LLVMConstInt(elem_type, (long long) round(val*dscale), 0);
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
@@ -277,7 +277,9 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
options.StackAlignmentOverride = 4;
|
||||
#endif
|
||||
#if defined(DEBUG) || defined(PROFILE)
|
||||
#if HAVE_LLVM < 0x0307
|
||||
options.NoFramePointerElim = true;
|
||||
#endif
|
||||
#endif
|
||||
OwningPtr<TargetMachine> TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "", options));
|
||||
|
||||
|
@@ -50,6 +50,12 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
// Workaround http://llvm.org/PR23628
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
# pragma push_macro("DEBUG")
|
||||
# undef DEBUG
|
||||
#endif
|
||||
|
||||
#include <llvm-c/Core.h>
|
||||
#include <llvm-c/ExecutionEngine.h>
|
||||
#include <llvm/Target/TargetOptions.h>
|
||||
@@ -70,6 +76,11 @@
|
||||
#include <llvm/IR/Module.h>
|
||||
#include <llvm/Support/CBindingWrapping.h>
|
||||
|
||||
// Workaround http://llvm.org/PR23628
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
# pragma pop_macro("DEBUG")
|
||||
#endif
|
||||
|
||||
#include "pipe/p_config.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_cpu_detect.h"
|
||||
@@ -439,7 +450,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
||||
#if HAVE_LLVM < 0x0304
|
||||
options.NoFramePointerElimNonLeaf = true;
|
||||
#endif
|
||||
#if HAVE_LLVM < 0x0307
|
||||
options.NoFramePointerElim = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
builder.setEngineKind(EngineKind::JIT)
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include "util/u_surface.h"
|
||||
|
||||
#include "nv_m2mf.xml.h"
|
||||
#include "nv_object.xml.h"
|
||||
#include "nv30/nv30_screen.h"
|
||||
#include "nv30/nv30_context.h"
|
||||
#include "nv30/nv30_resource.h"
|
||||
@@ -144,21 +145,18 @@ nv30_resource_copy_region(struct pipe_context *pipe,
|
||||
nv30_transfer_rect(nv30, NEAREST, &src, &dst);
|
||||
}
|
||||
|
||||
void
|
||||
nv30_resource_resolve(struct pipe_context *pipe,
|
||||
const struct pipe_resolve_info *info)
|
||||
static void
|
||||
nv30_resource_resolve(struct nv30_context *nv30,
|
||||
const struct pipe_blit_info *info)
|
||||
{
|
||||
#if 0
|
||||
struct nv30_context *nv30 = nv30_context(pipe);
|
||||
struct nv30_rect src, dst;
|
||||
|
||||
define_rect(info->src.res, 0, 0, info->src.x0, info->src.y0,
|
||||
info->src.x1 - info->src.x0, info->src.y1 - info->src.y0, &src);
|
||||
define_rect(info->dst.res, info->dst.level, 0, info->dst.x0, info->dst.y0,
|
||||
info->dst.x1 - info->dst.x0, info->dst.y1 - info->dst.y0, &dst);
|
||||
define_rect(info->src.resource, 0, info->src.box.z, info->src.box.x,
|
||||
info->src.box.y, info->src.box.width, info->src.box.height, &src);
|
||||
define_rect(info->dst.resource, 0, info->dst.box.z, info->dst.box.x,
|
||||
info->dst.box.y, info->dst.box.width, info->dst.box.height, &dst);
|
||||
|
||||
nv30_transfer_rect(nv30, BILINEAR, &src, &dst);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -172,7 +170,7 @@ nv30_blit(struct pipe_context *pipe,
|
||||
info.dst.resource->nr_samples <= 1 &&
|
||||
!util_format_is_depth_or_stencil(info.src.resource->format) &&
|
||||
!util_format_is_pure_integer(info.src.resource->format)) {
|
||||
debug_printf("nv30: color resolve unimplemented\n");
|
||||
nv30_resource_resolve(nv30, blit_info);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -362,6 +360,7 @@ nv30_miptree_create(struct pipe_screen *pscreen,
|
||||
blocksz = util_format_get_blocksize(pt->format);
|
||||
|
||||
if ((pt->target == PIPE_TEXTURE_RECT) ||
|
||||
(pt->bind & PIPE_BIND_SCANOUT) ||
|
||||
!util_is_power_of_two(pt->width0) ||
|
||||
!util_is_power_of_two(pt->height0) ||
|
||||
!util_is_power_of_two(pt->depth0) ||
|
||||
@@ -369,6 +368,14 @@ nv30_miptree_create(struct pipe_screen *pscreen,
|
||||
util_format_is_float(pt->format) || mt->ms_mode) {
|
||||
mt->uniform_pitch = util_format_get_nblocksx(pt->format, w) * blocksz;
|
||||
mt->uniform_pitch = align(mt->uniform_pitch, 64);
|
||||
if (pt->bind & PIPE_BIND_SCANOUT) {
|
||||
struct nv30_screen *screen = nv30_screen(pscreen);
|
||||
int pitch_align = MAX2(
|
||||
screen->eng3d->oclass >= NV40_3D_CLASS ? 1024 : 256,
|
||||
/* round_down_pow2(mt->uniform_pitch / 4) */
|
||||
1 << (util_last_bit(mt->uniform_pitch / 4) - 1));
|
||||
mt->uniform_pitch = align(mt->uniform_pitch, pitch_align);
|
||||
}
|
||||
}
|
||||
|
||||
if (!mt->uniform_pitch)
|
||||
|
@@ -65,9 +65,6 @@ nv30_resource_copy_region(struct pipe_context *pipe,
|
||||
struct pipe_resource *src, unsigned src_level,
|
||||
const struct pipe_box *src_box);
|
||||
|
||||
void
|
||||
nv30_resource_resolve(struct pipe_context *, const struct pipe_resolve_info *);
|
||||
|
||||
void
|
||||
nv30_blit(struct pipe_context *pipe,
|
||||
const struct pipe_blit_info *blit_info);
|
||||
|
@@ -310,8 +310,9 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen,
|
||||
unsigned sample_count,
|
||||
unsigned bindings)
|
||||
{
|
||||
if (sample_count > 4)
|
||||
if (sample_count > nv30_screen(pscreen)->max_sample_count)
|
||||
return FALSE;
|
||||
|
||||
if (!(0x00000017 & (1 << sample_count)))
|
||||
return FALSE;
|
||||
|
||||
@@ -441,6 +442,23 @@ nv30_screen_create(struct nouveau_device *dev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some modern apps try to use msaa without keeping in mind the
|
||||
* restrictions on videomem of older cards. Resulting in dmesg saying:
|
||||
* [ 1197.850642] nouveau E[soffice.bin[3785]] fail ttm_validate
|
||||
* [ 1197.850648] nouveau E[soffice.bin[3785]] validating bo list
|
||||
* [ 1197.850654] nouveau E[soffice.bin[3785]] validate: -12
|
||||
*
|
||||
* Because we are running out of video memory, after which the program
|
||||
* using the msaa visual freezes, and eventually the entire system freezes.
|
||||
*
|
||||
* To work around this we do not allow msaa visauls by default and allow
|
||||
* the user to override this via NV30_MAX_MSAA.
|
||||
*/
|
||||
screen->max_sample_count = debug_get_num_option("NV30_MAX_MSAA", 0);
|
||||
if (screen->max_sample_count > 4)
|
||||
screen->max_sample_count = 4;
|
||||
|
||||
pscreen = &screen->base.base;
|
||||
pscreen->destroy = nv30_screen_destroy;
|
||||
pscreen->get_param = nv30_screen_get_param;
|
||||
|
@@ -38,6 +38,8 @@ struct nv30_screen {
|
||||
/*XXX: nvfx state */
|
||||
struct nouveau_heap *vp_exec_heap;
|
||||
struct nouveau_heap *vp_data_heap;
|
||||
|
||||
unsigned max_sample_count;
|
||||
};
|
||||
|
||||
static INLINE struct nv30_screen *
|
||||
|
@@ -371,7 +371,7 @@ nv30_transfer_rect_blit(XFER_ARGS)
|
||||
static boolean
|
||||
nv30_transfer_sifm(XFER_ARGS)
|
||||
{
|
||||
if (!src->pitch || (src->w | src->h) > 1024 || src->w < 2 || src->h < 2)
|
||||
if (!src->pitch || src->w > 1024 || src->h > 1024 || src->w < 2 || src->h < 2)
|
||||
return FALSE;
|
||||
|
||||
if (src->d > 1 || dst->d > 1)
|
||||
@@ -381,7 +381,7 @@ nv30_transfer_sifm(XFER_ARGS)
|
||||
return FALSE;
|
||||
|
||||
if (!dst->pitch) {
|
||||
if ((dst->w | dst->h) > 2048 || dst->w < 2 || dst->h < 2)
|
||||
if (dst->w > 2048 || dst->h > 2048 || dst->w < 2 || dst->h < 2)
|
||||
return FALSE;
|
||||
} else {
|
||||
if (dst->domain != NOUVEAU_BO_VRAM)
|
||||
|
@@ -203,8 +203,10 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] =
|
||||
F3B(B5G6R5_UNORM, B5G6R5_UNORM, C2, C1, C0, xx, UNORM, 5_6_5, TD),
|
||||
C4B(B5G5R5A1_UNORM, BGR5_A1_UNORM, C2, C1, C0, C3, UNORM, 5_5_5_1, TD),
|
||||
F3B(B5G5R5X1_UNORM, BGR5_X1_UNORM, C2, C1, C0, xx, UNORM, 5_5_5_1, TD),
|
||||
#if NOUVEAU_DRIVER != 0xc0
|
||||
C4B(B4G4R4A4_UNORM, NONE, C2, C1, C0, C3, UNORM, 4_4_4_4, T),
|
||||
F3B(B4G4R4X4_UNORM, NONE, C2, C1, C0, xx, UNORM, 4_4_4_4, T),
|
||||
#endif
|
||||
F3B(R9G9B9E5_FLOAT, NONE, C0, C1, C2, xx, FLOAT, 9_9_9_E5, T),
|
||||
|
||||
C4A(R10G10B10A2_UNORM, RGB10_A2_UNORM, C0, C1, C2, C3, UNORM, 10_10_10_2,
|
||||
|
@@ -100,7 +100,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_MAX_TEXEL_OFFSET:
|
||||
return 7;
|
||||
case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
|
||||
return 65536;
|
||||
return 128 * 1024 * 1024;
|
||||
case PIPE_CAP_GLSL_FEATURE_LEVEL:
|
||||
return 330;
|
||||
case PIPE_CAP_MAX_RENDER_TARGETS:
|
||||
|
@@ -459,7 +459,7 @@ nvc0_fp_gen_header(struct nvc0_program *fp, struct nv50_ir_prog_info *info)
|
||||
|
||||
for (i = 0; i < info->numOutputs; ++i) {
|
||||
if (info->out[i].sn == TGSI_SEMANTIC_COLOR)
|
||||
fp->hdr[18] |= info->out[i].mask << info->out[i].slot[0];
|
||||
fp->hdr[18] |= 0xf << info->out[i].slot[0];
|
||||
}
|
||||
|
||||
fp->fp.early_z = info->prop.fp.earlyFragTests;
|
||||
|
@@ -87,7 +87,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
|
||||
return 31;
|
||||
case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
|
||||
return 65536;
|
||||
return 128 * 1024 * 1024;
|
||||
case PIPE_CAP_GLSL_FEATURE_LEVEL:
|
||||
return 410;
|
||||
case PIPE_CAP_MAX_RENDER_TARGETS:
|
||||
|
@@ -251,6 +251,9 @@ static void vui(struct rvce_encoder *enc)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!enc->pic.rate_ctrl.frame_rate_num)
|
||||
return;
|
||||
|
||||
RVCE_BEGIN(0x04000009); // vui
|
||||
RVCE_CS(0x00000000); //aspectRatioInfoPresentFlag
|
||||
RVCE_CS(0x00000000); //aspectRatioInfo.aspectRatioIdc
|
||||
|
@@ -706,14 +706,30 @@ gbm_dri_bo_import(struct gbm_device *gbm,
|
||||
{
|
||||
struct gbm_import_fd_data *fd_data = buffer;
|
||||
int stride = fd_data->stride, offset = 0;
|
||||
int dri_format;
|
||||
|
||||
switch (fd_data->format) {
|
||||
case GBM_BO_FORMAT_XRGB8888:
|
||||
dri_format = GBM_FORMAT_XRGB8888;
|
||||
break;
|
||||
case GBM_BO_FORMAT_ARGB8888:
|
||||
dri_format = GBM_FORMAT_ARGB8888;
|
||||
break;
|
||||
default:
|
||||
dri_format = fd_data->format;
|
||||
}
|
||||
|
||||
image = dri->image->createImageFromFds(dri->screen,
|
||||
fd_data->width,
|
||||
fd_data->height,
|
||||
fd_data->format,
|
||||
dri_format,
|
||||
&fd_data->fd, 1,
|
||||
&stride, &offset,
|
||||
NULL);
|
||||
if (image == NULL) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
gbm_format = fd_data->format;
|
||||
break;
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ AM_CFLAGS = \
|
||||
$(EXTRA_DEFINES_XF86VIDMODE) \
|
||||
-D_REENTRANT \
|
||||
-DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" \
|
||||
-DGL_LIB_NAME=\"lib@GL_LIB@.so.1\" \
|
||||
$(DEFINES) \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
$(DRI2PROTO_CFLAGS) \
|
||||
|
@@ -73,6 +73,10 @@ dri_message(int level, const char *f, ...)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef GL_LIB_NAME
|
||||
#define GL_LIB_NAME "libGL.so.1"
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_DRIVER_DIR
|
||||
/* this is normally defined in Mesa/configs/default with DRI_DRIVER_SEARCH_PATH */
|
||||
#define DEFAULT_DRIVER_DIR "/usr/local/lib/dri"
|
||||
@@ -99,7 +103,7 @@ driOpenDriver(const char *driverName)
|
||||
int len;
|
||||
|
||||
/* Attempt to make sure libGL symbols will be visible to the driver */
|
||||
glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
|
||||
glhandle = dlopen(GL_LIB_NAME, RTLD_NOW | RTLD_GLOBAL);
|
||||
|
||||
libPaths = NULL;
|
||||
if (geteuid() == getuid()) {
|
||||
|
@@ -2646,7 +2646,11 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
|
||||
*/
|
||||
_X_EXPORT void (*glXGetProcAddress(const GLubyte * procName)) (void)
|
||||
#if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
|
||||
# if defined(USE_MGL_NAMESPACE)
|
||||
__attribute__ ((alias("mglXGetProcAddressARB")));
|
||||
# else
|
||||
__attribute__ ((alias("glXGetProcAddressARB")));
|
||||
# endif
|
||||
#else
|
||||
{
|
||||
return glXGetProcAddressARB(procName);
|
||||
|
@@ -280,11 +280,17 @@ typedef void (*PFNGLXDISABLEEXTENSIONPROC) (const char *name);
|
||||
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func)
|
||||
#else
|
||||
# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
|
||||
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
|
||||
/* GLX_ALIAS and GLX_ALIAS_VOID both expand to the macro GLX_ALIAS2. Using the
|
||||
* extra expansion means that the name mangling macros in glx_mangle.h will
|
||||
* apply before stringification, so the alias attribute will have a string like
|
||||
* "mglXFoo" instead of "glXFoo". */
|
||||
# define GLX_ALIAS2(return_type, real_func, proto_args, args, aliased_func) \
|
||||
return_type real_func proto_args \
|
||||
__attribute__ ((alias( # aliased_func ) ));
|
||||
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
|
||||
GLX_ALIAS2(return_type, real_func, proto_args, args, aliased_func)
|
||||
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
|
||||
GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
|
||||
GLX_ALIAS2(void, real_func, proto_args, args, aliased_func)
|
||||
# else
|
||||
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
|
||||
return_type real_func proto_args \
|
||||
|
@@ -175,7 +175,7 @@ _glapi_get_stub(const char *name, int generate)
|
||||
const struct mapi_stub *stub;
|
||||
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
if (name)
|
||||
if (name && name[0] == 'm')
|
||||
name++;
|
||||
#endif
|
||||
|
||||
|
@@ -251,7 +251,7 @@ intel_run_render(struct gl_context * ctx, struct tnl_pipeline_stage *stage)
|
||||
continue;
|
||||
|
||||
intel_render_tab_verts[prim & PRIM_MODE_MASK] (ctx, start,
|
||||
start + length, prim);
|
||||
length, prim);
|
||||
}
|
||||
|
||||
tnl->Driver.Render.Finish(ctx);
|
||||
|
@@ -1413,7 +1413,6 @@ intel_process_dri2_buffer(struct brw_context *brw,
|
||||
buffer->cpp, buffer->pitch);
|
||||
}
|
||||
|
||||
intel_miptree_release(&rb->mt);
|
||||
bo = drm_intel_bo_gem_create_from_name(brw->bufmgr, buffer_name,
|
||||
buffer->name);
|
||||
if (!bo) {
|
||||
|
@@ -1942,7 +1942,10 @@ fs_visitor::assign_vs_urb_setup()
|
||||
|
||||
inst->src[i].file = HW_REG;
|
||||
inst->src[i].fixed_hw_reg =
|
||||
retype(brw_vec8_grf(grf, 0), inst->src[i].type);
|
||||
stride(byte_offset(retype(brw_vec8_grf(grf, 0), inst->src[i].type),
|
||||
inst->src[i].subreg_offset),
|
||||
inst->exec_size * inst->src[i].stride,
|
||||
inst->exec_size, inst->src[i].stride);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -414,6 +414,12 @@ brw_meta_stencil_blit(struct brw_context *brw,
|
||||
GLenum target;
|
||||
|
||||
_mesa_meta_fb_tex_blit_begin(ctx, &blit);
|
||||
/* XXX: Pretend to support stencil textures so _mesa_base_tex_format()
|
||||
* returns a valid format. When we properly support the extension, we
|
||||
* should remove this.
|
||||
*/
|
||||
assert(ctx->Extensions.ARB_texture_stencil8 == false);
|
||||
ctx->Extensions.ARB_texture_stencil8 = true;
|
||||
|
||||
_mesa_GenFramebuffers(1, &fbo);
|
||||
/* Force the surface to be configured for level zero. */
|
||||
@@ -451,6 +457,7 @@ brw_meta_stencil_blit(struct brw_context *brw,
|
||||
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
error:
|
||||
ctx->Extensions.ARB_texture_stencil8 = false;
|
||||
_mesa_meta_fb_tex_blit_end(ctx, target, &blit);
|
||||
_mesa_meta_end(ctx);
|
||||
|
||||
|
@@ -60,6 +60,8 @@ src_reg::src_reg(register_file file, int reg, const glsl_type *type)
|
||||
this->swizzle = brw_swizzle_for_size(type->vector_elements);
|
||||
else
|
||||
this->swizzle = BRW_SWIZZLE_XYZW;
|
||||
if (type)
|
||||
this->type = brw_type_for_base_type(type);
|
||||
}
|
||||
|
||||
/** Generic unset register constructor. */
|
||||
@@ -938,6 +940,14 @@ vec4_instruction::can_reswizzle(int dst_writemask,
|
||||
if (mlen > 0)
|
||||
return false;
|
||||
|
||||
/* We can't use swizzles on the accumulator and that's really the only
|
||||
* HW_REG we would care to reswizzle so just disallow them all.
|
||||
*/
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (src[i].file == HW_REG)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1041,6 +1051,17 @@ vec4_visitor::opt_register_coalesce()
|
||||
}
|
||||
}
|
||||
|
||||
/* This doesn't handle saturation on the instruction we
|
||||
* want to coalesce away if the register types do not match.
|
||||
* But if scan_inst is a non type-converting 'mov', we can fix
|
||||
* the types later.
|
||||
*/
|
||||
if (inst->saturate &&
|
||||
inst->dst.type != scan_inst->dst.type &&
|
||||
!(scan_inst->opcode == BRW_OPCODE_MOV &&
|
||||
scan_inst->dst.type == scan_inst->src[0].type))
|
||||
break;
|
||||
|
||||
/* If we can't handle the swizzle, bail. */
|
||||
if (!scan_inst->can_reswizzle(inst->dst.writemask,
|
||||
inst->src[0].swizzle,
|
||||
@@ -1116,6 +1137,16 @@ vec4_visitor::opt_register_coalesce()
|
||||
scan_inst->dst.file = inst->dst.file;
|
||||
scan_inst->dst.reg = inst->dst.reg;
|
||||
scan_inst->dst.reg_offset = inst->dst.reg_offset;
|
||||
if (inst->saturate &&
|
||||
inst->dst.type != scan_inst->dst.type) {
|
||||
/* If we have reached this point, scan_inst is a non
|
||||
* type-converting 'mov' and we can modify its register types
|
||||
* to match the ones in inst. Otherwise, we could have an
|
||||
* incorrect saturation result.
|
||||
*/
|
||||
scan_inst->dst.type = inst->dst.type;
|
||||
scan_inst->src[0].type = inst->src[0].type;
|
||||
}
|
||||
scan_inst->saturate |= inst->saturate;
|
||||
}
|
||||
scan_inst = (vec4_instruction *)scan_inst->next;
|
||||
|
@@ -446,7 +446,7 @@ static GLboolean radeon_run_render( struct gl_context *ctx,
|
||||
start, start+length);
|
||||
|
||||
if (length)
|
||||
tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim );
|
||||
tab[prim & PRIM_MODE_MASK](ctx, start, length, prim);
|
||||
}
|
||||
|
||||
tnl->Driver.Render.Finish( ctx );
|
||||
|
@@ -3422,7 +3422,16 @@ _mesa_get_framebuffer_attachment_parameter(struct gl_context *ctx,
|
||||
|
||||
switch (pname) {
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
|
||||
*params = _mesa_is_winsys_fbo(buffer)
|
||||
/* From the OpenGL spec, 9.2. Binding and Managing Framebuffer Objects:
|
||||
*
|
||||
* "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
|
||||
* either no framebuffer is bound to target; or the default framebuffer
|
||||
* is bound, attachment is DEPTH or STENCIL, and the number of depth or
|
||||
* stencil bits, respectively, is zero."
|
||||
*/
|
||||
*params = (_mesa_is_winsys_fbo(buffer) &&
|
||||
((attachment != GL_DEPTH && attachment != GL_STENCIL) ||
|
||||
(att->Type != GL_NONE)))
|
||||
? GL_FRAMEBUFFER_DEFAULT : att->Type;
|
||||
return;
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT:
|
||||
|
@@ -1922,11 +1922,8 @@ generate_mipmap_uncompressed(struct gl_context *ctx, GLenum target,
|
||||
}
|
||||
|
||||
/* get dest gl_texture_image */
|
||||
dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
|
||||
if (!dstImage) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
|
||||
return;
|
||||
}
|
||||
dstImage = _mesa_select_tex_image(texObj, target, level + 1);
|
||||
assert(dstImage);
|
||||
|
||||
if (target == GL_TEXTURE_1D_ARRAY) {
|
||||
srcDepth = srcHeight;
|
||||
@@ -2107,7 +2104,19 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
|
||||
srcWidth, srcHeight, srcDepth,
|
||||
&dstWidth, &dstHeight, &dstDepth);
|
||||
if (!nextLevel)
|
||||
break;
|
||||
goto end;
|
||||
|
||||
if (!_mesa_prepare_mipmap_level(ctx, texObj, level + 1,
|
||||
dstWidth, dstHeight, dstDepth,
|
||||
border, srcImage->InternalFormat,
|
||||
srcImage->TexFormat)) {
|
||||
/* all done */
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* get dest gl_texture_image */
|
||||
dstImage = _mesa_select_tex_image(texObj, target, level + 1);
|
||||
assert(dstImage);
|
||||
|
||||
/* Compute dst image strides and alloc memory on first iteration */
|
||||
temp_dst_row_stride = _mesa_format_row_stride(temp_format, dstWidth);
|
||||
@@ -2121,13 +2130,6 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
|
||||
}
|
||||
}
|
||||
|
||||
/* get dest gl_texture_image */
|
||||
dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
|
||||
if (!dstImage) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* for 2D arrays, setup array[depth] of slice pointers */
|
||||
for (i = 0; i < srcDepth; i++) {
|
||||
temp_src_slices[i] = temp_src + temp_src_img_stride * i;
|
||||
@@ -2146,14 +2148,6 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
|
||||
dstWidth, dstHeight, dstDepth,
|
||||
temp_dst_slices, temp_dst_row_stride);
|
||||
|
||||
if (!_mesa_prepare_mipmap_level(ctx, texObj, level + 1,
|
||||
dstWidth, dstHeight, dstDepth,
|
||||
border, srcImage->InternalFormat,
|
||||
srcImage->TexFormat)) {
|
||||
/* all done */
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* The image space was allocated above so use glTexSubImage now */
|
||||
ctx->Driver.TexSubImage(ctx, 2, dstImage,
|
||||
0, 0, 0, dstWidth, dstHeight, dstDepth,
|
||||
|
@@ -1291,7 +1291,8 @@ _mesa_texstore_bptc_rgba_unorm(TEXSTORE_PARAMS)
|
||||
tempImageSlices[0] = (GLubyte *) tempImage;
|
||||
_mesa_texstore(ctx, dims,
|
||||
baseInternalFormat,
|
||||
MESA_FORMAT_R8G8B8A8_UNORM,
|
||||
_mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
|
||||
: MESA_FORMAT_A8B8G8R8_UNORM,
|
||||
rgbaRowStride, tempImageSlices,
|
||||
srcWidth, srcHeight, srcDepth,
|
||||
srcFormat, srcType, srcAddr,
|
||||
|
@@ -130,7 +130,8 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
|
||||
tempImageSlices[0] = (GLubyte *) tempImage;
|
||||
_mesa_texstore(ctx, dims,
|
||||
baseInternalFormat,
|
||||
MESA_FORMAT_R8G8B8A8_UNORM,
|
||||
_mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
|
||||
: MESA_FORMAT_A8B8G8R8_UNORM,
|
||||
rgbaRowStride, tempImageSlices,
|
||||
srcWidth, srcHeight, srcDepth,
|
||||
srcFormat, srcType, srcAddr,
|
||||
|
@@ -196,9 +196,11 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
|
||||
dstFormat == MESA_FORMAT_LA_LATC2_UNORM);
|
||||
|
||||
if (baseInternalFormat == GL_RG)
|
||||
tempFormat = MESA_FORMAT_R8G8_UNORM;
|
||||
tempFormat = _mesa_little_endian() ? MESA_FORMAT_R8G8_UNORM
|
||||
: MESA_FORMAT_G8R8_UNORM;
|
||||
else
|
||||
tempFormat = MESA_FORMAT_L8A8_UNORM;
|
||||
tempFormat = _mesa_little_endian() ? MESA_FORMAT_L8A8_UNORM
|
||||
: MESA_FORMAT_A8L8_UNORM;
|
||||
|
||||
rgRowStride = 2 * srcWidth * sizeof(GLubyte);
|
||||
tempImage = malloc(srcWidth * srcHeight * 2 * sizeof(GLubyte));
|
||||
|
@@ -198,7 +198,8 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
|
||||
tempImageSlices[0] = (GLubyte *) tempImage;
|
||||
_mesa_texstore(ctx, dims,
|
||||
baseInternalFormat,
|
||||
MESA_FORMAT_R8G8B8A8_UNORM,
|
||||
_mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
|
||||
: MESA_FORMAT_A8B8G8R8_UNORM,
|
||||
rgbaRowStride, tempImageSlices,
|
||||
srcWidth, srcHeight, srcDepth,
|
||||
srcFormat, srcType, srcAddr,
|
||||
@@ -255,7 +256,8 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
|
||||
tempImageSlices[0] = (GLubyte *) tempImage;
|
||||
_mesa_texstore(ctx, dims,
|
||||
baseInternalFormat,
|
||||
MESA_FORMAT_R8G8B8A8_UNORM,
|
||||
_mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
|
||||
: MESA_FORMAT_A8B8G8R8_UNORM,
|
||||
rgbaRowStride, tempImageSlices,
|
||||
srcWidth, srcHeight, srcDepth,
|
||||
srcFormat, srcType, srcAddr,
|
||||
@@ -311,7 +313,8 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
|
||||
tempImageSlices[0] = (GLubyte *) tempImage;
|
||||
_mesa_texstore(ctx, dims,
|
||||
baseInternalFormat,
|
||||
MESA_FORMAT_R8G8B8A8_UNORM,
|
||||
_mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
|
||||
: MESA_FORMAT_A8B8G8R8_UNORM,
|
||||
rgbaRowStride, tempImageSlices,
|
||||
srcWidth, srcHeight, srcDepth,
|
||||
srcFormat, srcType, srcAddr,
|
||||
|
@@ -864,7 +864,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||
GLuint cols, GLuint rows,
|
||||
GLint location, GLsizei count,
|
||||
GLboolean transpose,
|
||||
const GLvoid *values, GLenum type)
|
||||
const GLvoid *values, enum glsl_base_type basicType)
|
||||
{
|
||||
unsigned offset;
|
||||
unsigned vectors;
|
||||
@@ -883,8 +883,8 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||
return;
|
||||
}
|
||||
|
||||
assert(type == GL_FLOAT || type == GL_DOUBLE);
|
||||
size_mul = type == GL_DOUBLE ? 2 : 1;
|
||||
assert(basicType == GLSL_TYPE_FLOAT || basicType == GLSL_TYPE_DOUBLE);
|
||||
size_mul = basicType == GLSL_TYPE_DOUBLE ? 2 : 1;
|
||||
|
||||
assert(!uni->type->is_sampler());
|
||||
vectors = uni->type->matrix_columns;
|
||||
@@ -910,6 +910,31 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||
}
|
||||
}
|
||||
|
||||
/* Section 2.11.7 (Uniform Variables) of the OpenGL 4.2 Core Profile spec
|
||||
* says:
|
||||
*
|
||||
* "If any of the following conditions occur, an INVALID_OPERATION
|
||||
* error is generated by the Uniform* commands, and no uniform values
|
||||
* are changed:
|
||||
*
|
||||
* ...
|
||||
*
|
||||
* - if the uniform declared in the shader is not of type boolean and
|
||||
* the type indicated in the name of the Uniform* command used does
|
||||
* not match the type of the uniform"
|
||||
*
|
||||
* There are no Boolean matrix types, so we do not need to allow
|
||||
* GLSL_TYPE_BOOL here (as _mesa_uniform does).
|
||||
*/
|
||||
if (uni->type->base_type != basicType) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glUniformMatrix%ux%u(\"%s\"@%d is %s, not %s)",
|
||||
cols, rows, uni->name, location,
|
||||
glsl_type_name(uni->type->base_type),
|
||||
glsl_type_name(basicType));
|
||||
return;
|
||||
}
|
||||
|
||||
if (unlikely(ctx->_Shader->Flags & GLSL_UNIFORMS)) {
|
||||
log_uniform(values, uni->type->base_type, components, vectors, count,
|
||||
bool(transpose), shProg, location, uni);
|
||||
@@ -939,7 +964,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||
if (!transpose) {
|
||||
memcpy(&uni->storage[elements * offset], values,
|
||||
sizeof(uni->storage[0]) * elements * count * size_mul);
|
||||
} else if (type == GL_FLOAT) {
|
||||
} else if (basicType == GLSL_TYPE_FLOAT) {
|
||||
/* Copy and transpose the matrix.
|
||||
*/
|
||||
const float *src = (const float *)values;
|
||||
@@ -956,7 +981,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||
src += elements;
|
||||
}
|
||||
} else {
|
||||
assert(type == GL_DOUBLE);
|
||||
assert(basicType == GLSL_TYPE_DOUBLE);
|
||||
const double *src = (const double *)values;
|
||||
double *dst = (double *)&uni->storage[elements * offset].f;
|
||||
|
||||
|
@@ -553,7 +553,7 @@ _mesa_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
2, 2, location, count, transpose, value, GL_FLOAT);
|
||||
2, 2, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -562,7 +562,7 @@ _mesa_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
3, 3, location, count, transpose, value, GL_FLOAT);
|
||||
3, 3, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -571,7 +571,7 @@ _mesa_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
4, 4, location, count, transpose, value, GL_FLOAT);
|
||||
4, 4, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
/** Same as above with direct state access **/
|
||||
@@ -683,7 +683,7 @@ _mesa_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix2fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -694,7 +694,7 @@ _mesa_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix3fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -705,7 +705,7 @@ _mesa_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix4fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ _mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
2, 3, location, count, transpose, value, GL_FLOAT);
|
||||
2, 3, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -727,7 +727,7 @@ _mesa_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
3, 2, location, count, transpose, value, GL_FLOAT);
|
||||
3, 2, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -736,7 +736,7 @@ _mesa_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
2, 4, location, count, transpose, value, GL_FLOAT);
|
||||
2, 4, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -745,7 +745,7 @@ _mesa_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
4, 2, location, count, transpose, value, GL_FLOAT);
|
||||
4, 2, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -754,7 +754,7 @@ _mesa_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
3, 4, location, count, transpose, value, GL_FLOAT);
|
||||
3, 4, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -763,7 +763,7 @@ _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
4, 3, location, count, transpose, value, GL_FLOAT);
|
||||
4, 3, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
/** Same as above with direct state access **/
|
||||
@@ -776,7 +776,7 @@ _mesa_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix2x3fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -787,7 +787,7 @@ _mesa_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix3x2fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -798,7 +798,7 @@ _mesa_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix2x4fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -809,7 +809,7 @@ _mesa_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix4x2fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -820,7 +820,7 @@ _mesa_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix3x4fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -831,7 +831,7 @@ _mesa_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix4x3fv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value, GL_FLOAT);
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value, GLSL_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
|
||||
@@ -1293,7 +1293,7 @@ _mesa_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
2, 2, location, count, transpose, value, GL_DOUBLE);
|
||||
2, 2, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1302,7 +1302,7 @@ _mesa_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
3, 3, location, count, transpose, value, GL_DOUBLE);
|
||||
3, 3, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1311,7 +1311,7 @@ _mesa_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
4, 4, location, count, transpose, value, GL_DOUBLE);
|
||||
4, 4, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1320,7 +1320,7 @@ _mesa_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
2, 3, location, count, transpose, value, GL_DOUBLE);
|
||||
2, 3, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1329,7 +1329,7 @@ _mesa_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
3, 2, location, count, transpose, value, GL_DOUBLE);
|
||||
3, 2, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1338,7 +1338,7 @@ _mesa_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
2, 4, location, count, transpose, value, GL_DOUBLE);
|
||||
2, 4, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1347,7 +1347,7 @@ _mesa_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
4, 2, location, count, transpose, value, GL_DOUBLE);
|
||||
4, 2, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1356,7 +1356,7 @@ _mesa_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
3, 4, location, count, transpose, value, GL_DOUBLE);
|
||||
3, 4, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1365,7 +1365,7 @@ _mesa_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose,
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_uniform_matrix(ctx, ctx->_Shader->ActiveProgram,
|
||||
4, 3, location, count, transpose, value, GL_DOUBLE);
|
||||
4, 3, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1471,7 +1471,7 @@ _mesa_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix2dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 2, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1482,7 +1482,7 @@ _mesa_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix3dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 3, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1493,7 +1493,7 @@ _mesa_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix4dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 4, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1504,7 +1504,7 @@ _mesa_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix2x3dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 3, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1515,7 +1515,7 @@ _mesa_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix3x2dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 2, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1526,7 +1526,7 @@ _mesa_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix2x4dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 2, 4, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1537,7 +1537,7 @@ _mesa_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix4x2dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 2, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1548,7 +1548,7 @@ _mesa_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix3x4dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 3, 4, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -1559,5 +1559,5 @@ _mesa_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count,
|
||||
struct gl_shader_program *shProg =
|
||||
_mesa_lookup_shader_program_err(ctx, program,
|
||||
"glProgramUniformMatrix4x3dv");
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value, GL_DOUBLE);
|
||||
_mesa_uniform_matrix(ctx, shProg, 4, 3, location, count, transpose, value, GLSL_TYPE_DOUBLE);
|
||||
}
|
||||
|
@@ -363,7 +363,7 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
|
||||
GLuint cols, GLuint rows,
|
||||
GLint location, GLsizei count,
|
||||
GLboolean transpose,
|
||||
const GLvoid *values, GLenum type);
|
||||
const GLvoid *values, enum glsl_base_type basicType);
|
||||
|
||||
void
|
||||
_mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location,
|
||||
|
@@ -253,8 +253,8 @@ st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
|
||||
return NULL;
|
||||
size = MIN2(stObj->pt->width0 - base, (unsigned)stObj->base.BufferSize);
|
||||
|
||||
f = ((base * 8) / desc->block.bits) * desc->block.width;
|
||||
n = ((size * 8) / desc->block.bits) * desc->block.width;
|
||||
f = (base / (desc->block.bits / 8)) * desc->block.width;
|
||||
n = (size / (desc->block.bits / 8)) * desc->block.width;
|
||||
if (!n)
|
||||
return NULL;
|
||||
templ.u.buf.first_element = f;
|
||||
|
@@ -228,6 +228,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
|
||||
st_adjust_blit_for_msaa_resolve(&blit);
|
||||
|
||||
st->pipe->blit(st->pipe, &blit);
|
||||
dstRb->defined = true; /* front buffer tracking */
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -265,6 +266,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
|
||||
st_adjust_blit_for_msaa_resolve(&blit);
|
||||
|
||||
st->pipe->blit(st->pipe, &blit);
|
||||
dstRb->defined = true; /* front buffer tracking */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1270,46 +1270,40 @@ static const struct format_mapping format_map[] = {
|
||||
/* 32-bit float formats */
|
||||
{
|
||||
{ GL_RGBA32F_ARB, 0 },
|
||||
{ PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
{ PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_RGB32F_ARB, 0 },
|
||||
{ PIPE_FORMAT_R32G32B32_FLOAT, PIPE_FORMAT_R32G32B32X32_FLOAT,
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_LUMINANCE_ALPHA32F_ARB, 0 },
|
||||
{ PIPE_FORMAT_L32A32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT,
|
||||
PIPE_FORMAT_L16A16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
{ PIPE_FORMAT_L32A32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_ALPHA32F_ARB, 0 },
|
||||
{ PIPE_FORMAT_A32_FLOAT, PIPE_FORMAT_L32A32_FLOAT,
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_A16_FLOAT,
|
||||
PIPE_FORMAT_L16A16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_INTENSITY32F_ARB, 0 },
|
||||
{ PIPE_FORMAT_I32_FLOAT, PIPE_FORMAT_L32A32_FLOAT,
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_I16_FLOAT,
|
||||
PIPE_FORMAT_L16A16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_LUMINANCE32F_ARB, 0 },
|
||||
{ PIPE_FORMAT_L32_FLOAT, PIPE_FORMAT_L32A32_FLOAT,
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_L16_FLOAT,
|
||||
PIPE_FORMAT_L16A16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_R32F, 0 },
|
||||
{ PIPE_FORMAT_R32_FLOAT, PIPE_FORMAT_R32G32_FLOAT,
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_R16_FLOAT,
|
||||
PIPE_FORMAT_R16G16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
{
|
||||
{ GL_RG32F, 0 },
|
||||
{ PIPE_FORMAT_R32G32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT,
|
||||
PIPE_FORMAT_R16G16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
|
||||
{ PIPE_FORMAT_R32G32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
|
||||
},
|
||||
|
||||
/* R, RG formats */
|
||||
@@ -1966,7 +1960,11 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
|
||||
else if (internalFormat == 3 || internalFormat == 4 ||
|
||||
internalFormat == GL_RGB || internalFormat == GL_RGBA ||
|
||||
internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 ||
|
||||
internalFormat == GL_BGRA)
|
||||
internalFormat == GL_BGRA ||
|
||||
internalFormat == GL_RGB16F ||
|
||||
internalFormat == GL_RGBA16F ||
|
||||
internalFormat == GL_RGB32F ||
|
||||
internalFormat == GL_RGBA32F)
|
||||
bindings |= PIPE_BIND_RENDER_TARGET;
|
||||
|
||||
/* GLES allows the driver to choose any format which matches
|
||||
|
@@ -121,9 +121,9 @@ static void TAG(render_points_verts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr ) {
|
||||
for (j = 0; j < count; j += nr) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
|
||||
|
||||
/* Emit whole number of lines in total and in each buffer:
|
||||
*/
|
||||
count -= (count-start) & 1;
|
||||
count -= count & 1;
|
||||
currentsz = GET_CURRENT_VB_MAX_VERTS();
|
||||
currentsz -= currentsz & 1;
|
||||
dmasz -= dmasz & 1;
|
||||
@@ -156,9 +156,9 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr ) {
|
||||
for (j = 0; j < count; j += nr) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
@@ -186,9 +186,9 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j + 1 < count; j += nr - 1 ) {
|
||||
for (j = 0; j + 1 < count; j += nr - 1 ) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
@@ -214,10 +214,7 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
|
||||
|
||||
INIT( GL_LINE_STRIP );
|
||||
|
||||
if (flags & PRIM_BEGIN)
|
||||
j = start;
|
||||
else
|
||||
j = start + 1;
|
||||
j = (flags & PRIM_BEGIN) ? 0 : 1;
|
||||
|
||||
/* Ensure last vertex won't wrap buffers:
|
||||
*/
|
||||
@@ -234,23 +231,23 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
|
||||
nr = MIN2( currentsz, count - j );
|
||||
|
||||
if (j + nr >= count &&
|
||||
start < count - 1 &&
|
||||
count > 1 &&
|
||||
(flags & PRIM_END))
|
||||
{
|
||||
void *tmp;
|
||||
tmp = ALLOC_VERTS(nr+1);
|
||||
tmp = TAG(emit_verts)( ctx, j, nr, tmp );
|
||||
tmp = TAG(emit_verts)(ctx, start + j, nr, tmp);
|
||||
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
|
||||
(void) tmp;
|
||||
}
|
||||
else {
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (start + 1 < count && (flags & PRIM_END)) {
|
||||
else if (count > 1 && (flags & PRIM_END)) {
|
||||
void *tmp;
|
||||
tmp = ALLOC_VERTS(2);
|
||||
tmp = TAG(emit_verts)( ctx, start+1, 1, tmp );
|
||||
@@ -284,14 +281,14 @@ static void TAG(render_triangles_verts)( struct gl_context *ctx,
|
||||
/* Emit whole number of tris in total. dmasz is already a multiple
|
||||
* of 3.
|
||||
*/
|
||||
count -= (count-start)%3;
|
||||
count -= count % 3;
|
||||
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr) {
|
||||
for (j = 0; j < count; j += nr) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
}
|
||||
@@ -322,9 +319,9 @@ static void TAG(render_tri_strip_verts)( struct gl_context *ctx,
|
||||
dmasz -= (dmasz & 1);
|
||||
currentsz -= (currentsz & 1);
|
||||
|
||||
for (j = start ; j + 2 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 2 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
@@ -354,12 +351,12 @@ static void TAG(render_tri_fan_verts)( struct gl_context *ctx,
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
|
||||
for (j = 1; j + 1 < count; j += nr - 2) {
|
||||
void *tmp;
|
||||
nr = MIN2( currentsz, count - j + 1 );
|
||||
tmp = ALLOC_VERTS( nr );
|
||||
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
|
||||
tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
|
||||
tmp = TAG(emit_verts)( ctx, start + j, nr - 1, tmp );
|
||||
(void) tmp;
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -394,12 +391,12 @@ static void TAG(render_poly_verts)( struct gl_context *ctx,
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
for (j = start + 1 ; j + 1 < count ; j += nr - 2 ) {
|
||||
for (j = 1 ; j + 1 < count ; j += nr - 2 ) {
|
||||
void *tmp;
|
||||
nr = MIN2( currentsz, count - j + 1 );
|
||||
tmp = ALLOC_VERTS( nr );
|
||||
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
|
||||
tmp = TAG(emit_verts)( ctx, j, nr - 1, tmp );
|
||||
tmp = TAG(emit_verts)(ctx, start + j, nr - 1, tmp);
|
||||
(void) tmp;
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -437,9 +434,9 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
|
||||
dmasz -= (dmasz & 2);
|
||||
currentsz -= (currentsz & 2);
|
||||
|
||||
for (j = start ; j + 3 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 3 < count; j += nr - 2 ) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
@@ -465,7 +462,7 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
|
||||
/* Emit whole number of quads in total, and in each buffer.
|
||||
*/
|
||||
dmasz -= dmasz & 1;
|
||||
count -= (count-start) & 1;
|
||||
count -= count & 1;
|
||||
currentsz -= currentsz & 1;
|
||||
|
||||
if (currentsz < 12)
|
||||
@@ -474,14 +471,14 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
|
||||
currentsz = currentsz/6*2;
|
||||
dmasz = dmasz/6*2;
|
||||
|
||||
for (j = start; j + 3 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 3 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
if (nr >= 4) {
|
||||
GLint quads = (nr/2)-1;
|
||||
GLint i;
|
||||
ELTS_VARS( ALLOC_ELTS( quads*6 ) );
|
||||
|
||||
for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) {
|
||||
for (i = j; i < j + quads * 2; i += 2) {
|
||||
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
|
||||
EMIT_TWO_ELTS( 2, (i+2), (i+1) );
|
||||
EMIT_TWO_ELTS( 4, (i+3), (i+2) );
|
||||
@@ -519,15 +516,15 @@ static void TAG(render_quad_strip_verts)( struct gl_context *ctx,
|
||||
dmasz -= dmasz & 1;
|
||||
currentsz = GET_CURRENT_VB_MAX_VERTS();
|
||||
currentsz -= currentsz & 1;
|
||||
count -= (count-start) & 1;
|
||||
count -= count & 1;
|
||||
|
||||
if (currentsz < 8) {
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
for (j = start; j + 3 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 3 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
@@ -545,6 +542,9 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
|
||||
GLuint count,
|
||||
GLuint flags )
|
||||
{
|
||||
/* Emit whole number of quads in total. */
|
||||
count -= count & 3;
|
||||
|
||||
if (HAVE_QUADS) {
|
||||
LOCAL_VARS;
|
||||
int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS()/4) * 4;
|
||||
@@ -553,18 +553,13 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
|
||||
|
||||
INIT(GL_QUADS);
|
||||
|
||||
/* Emit whole number of quads in total. dmasz is already a multiple
|
||||
* of 4.
|
||||
*/
|
||||
count -= (count-start)%4;
|
||||
|
||||
currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4;
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr) {
|
||||
for (j = 0; j < count; j += nr) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
|
||||
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
}
|
||||
@@ -587,7 +582,6 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
|
||||
/* Emit whole number of quads in total, and in each buffer.
|
||||
*/
|
||||
dmasz -= dmasz & 3;
|
||||
count -= (count-start) & 3;
|
||||
currentsz -= currentsz & 3;
|
||||
|
||||
/* Adjust for rendering as triangles:
|
||||
@@ -598,14 +592,14 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr ) {
|
||||
for (j = 0; j < count; j += nr ) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
if (nr >= 4) {
|
||||
GLint quads = nr/4;
|
||||
GLint i;
|
||||
ELTS_VARS( ALLOC_ELTS( quads*6 ) );
|
||||
|
||||
for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) {
|
||||
for (i = j; i < j + quads * 4; i += 4) {
|
||||
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
|
||||
EMIT_TWO_ELTS( 2, (i+3), (i+1) );
|
||||
EMIT_TWO_ELTS( 4, (i+2), (i+3) );
|
||||
@@ -629,15 +623,15 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
|
||||
|
||||
INIT(GL_TRIANGLES);
|
||||
|
||||
for (j = start; j < count-3; j += 4) {
|
||||
for (j = 0; j + 3 < count; j += 4) {
|
||||
void *tmp = ALLOC_VERTS( 6 );
|
||||
/* Send v0, v1, v3
|
||||
*/
|
||||
tmp = EMIT_VERTS(ctx, j, 2, tmp);
|
||||
tmp = EMIT_VERTS(ctx, j + 3, 1, tmp);
|
||||
tmp = EMIT_VERTS(ctx, start + j, 2, tmp);
|
||||
tmp = EMIT_VERTS(ctx, start + j + 3, 1, tmp);
|
||||
/* Send v1, v2, v3
|
||||
*/
|
||||
tmp = EMIT_VERTS(ctx, j + 1, 3, tmp);
|
||||
tmp = EMIT_VERTS(ctx, start + j + 1, 3, tmp);
|
||||
(void) tmp;
|
||||
}
|
||||
}
|
||||
@@ -698,9 +692,9 @@ static void TAG(render_points_elts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr ) {
|
||||
for (j = 0; j < count; j += nr ) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -728,7 +722,7 @@ static void TAG(render_lines_elts)( struct gl_context *ctx,
|
||||
|
||||
/* Emit whole number of lines in total and in each buffer:
|
||||
*/
|
||||
count -= (count-start) & 1;
|
||||
count -= count & 1;
|
||||
currentsz -= currentsz & 1;
|
||||
dmasz -= dmasz & 1;
|
||||
|
||||
@@ -736,9 +730,9 @@ static void TAG(render_lines_elts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr ) {
|
||||
for (j = 0; j < count; j += nr ) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -768,9 +762,9 @@ static void TAG(render_line_strip_elts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j + 1 < count; j += nr - 1 ) {
|
||||
for (j = 0; j + 1 < count; j += nr - 1) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)( ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -798,10 +792,7 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
|
||||
FLUSH();
|
||||
ELT_INIT( GL_LINE_STRIP );
|
||||
|
||||
if (flags & PRIM_BEGIN)
|
||||
j = start;
|
||||
else
|
||||
j = start + 1;
|
||||
j = (flags & PRIM_BEGIN) ? 0 : 1;
|
||||
|
||||
currentsz = GET_CURRENT_VB_MAX_ELTS();
|
||||
if (currentsz < 8) {
|
||||
@@ -818,23 +809,23 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
|
||||
nr = MIN2( currentsz, count - j );
|
||||
|
||||
if (j + nr >= count &&
|
||||
start < count - 1 &&
|
||||
count > 1 &&
|
||||
(flags & PRIM_END))
|
||||
{
|
||||
void *tmp;
|
||||
tmp = ALLOC_ELTS(nr+1);
|
||||
tmp = TAG(emit_elts)( ctx, elts+j, nr, tmp );
|
||||
tmp = TAG(emit_elts)(ctx, elts + start + j, nr, tmp);
|
||||
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
|
||||
(void) tmp;
|
||||
}
|
||||
else {
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
currentsz = dmasz;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (start + 1 < count && (flags & PRIM_END)) {
|
||||
else if (count > 1 && (flags & PRIM_END)) {
|
||||
void *tmp;
|
||||
tmp = ALLOC_ELTS(2);
|
||||
tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp );
|
||||
@@ -874,14 +865,14 @@ static void TAG(render_triangles_elts)( struct gl_context *ctx,
|
||||
/* Emit whole number of tris in total. dmasz is already a multiple
|
||||
* of 3.
|
||||
*/
|
||||
count -= (count-start)%3;
|
||||
count -= count % 3;
|
||||
currentsz -= currentsz%3;
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr) {
|
||||
for (j = 0; j < count; j += nr) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -914,9 +905,9 @@ static void TAG(render_tri_strip_elts)( struct gl_context *ctx,
|
||||
dmasz -= (dmasz & 1);
|
||||
currentsz -= (currentsz & 1);
|
||||
|
||||
for (j = start ; j + 2 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 2 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)( ctx, elts + start + j, nr, ALLOC_ELTS(nr) );
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -947,12 +938,12 @@ static void TAG(render_tri_fan_elts)( struct gl_context *ctx,
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
|
||||
for (j = 1; j + 1 < count; j += nr - 2) {
|
||||
void *tmp;
|
||||
nr = MIN2( currentsz, count - j + 1 );
|
||||
tmp = ALLOC_ELTS( nr );
|
||||
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
|
||||
tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
|
||||
tmp = TAG(emit_elts)(ctx, elts + start + j, nr - 1, tmp);
|
||||
(void) tmp;
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
@@ -985,12 +976,12 @@ static void TAG(render_poly_elts)( struct gl_context *ctx,
|
||||
currentsz = dmasz;
|
||||
}
|
||||
|
||||
for (j = start + 1 ; j + 1 < count; j += nr - 2 ) {
|
||||
for (j = 1 ; j + 1 < count; j += nr - 2) {
|
||||
void *tmp;
|
||||
nr = MIN2( currentsz, count - j + 1 );
|
||||
tmp = ALLOC_ELTS( nr );
|
||||
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
|
||||
tmp = TAG(emit_elts)( ctx, elts+j, nr - 1, tmp );
|
||||
tmp = TAG(emit_elts)(ctx, elts + start + j, nr - 1, tmp);
|
||||
(void) tmp;
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
@@ -1023,7 +1014,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
|
||||
/* Emit whole number of quads in total, and in each buffer.
|
||||
*/
|
||||
dmasz -= dmasz & 1;
|
||||
count -= (count-start) & 1;
|
||||
count -= count & 1;
|
||||
currentsz -= currentsz & 1;
|
||||
|
||||
if (currentsz < 12)
|
||||
@@ -1035,7 +1026,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
|
||||
currentsz = currentsz/6*2;
|
||||
dmasz = dmasz/6*2;
|
||||
|
||||
for (j = start; j + 3 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 3 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
|
||||
if (nr >= 4)
|
||||
@@ -1044,7 +1035,7 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
|
||||
GLint quads = (nr/2)-1;
|
||||
ELTS_VARS( ALLOC_ELTS( quads*6 ) );
|
||||
|
||||
for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
|
||||
for (i = j; i < j + quads; i++, elts += 2) {
|
||||
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
|
||||
EMIT_TWO_ELTS( 2, elts[2], elts[1] );
|
||||
EMIT_TWO_ELTS( 4, elts[3], elts[2] );
|
||||
@@ -1060,9 +1051,9 @@ static void TAG(render_quad_strip_elts)( struct gl_context *ctx,
|
||||
else {
|
||||
ELT_INIT( GL_TRIANGLE_STRIP );
|
||||
|
||||
for (j = start; j + 3 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 3 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -1076,6 +1067,9 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
|
||||
GLuint count,
|
||||
GLuint flags )
|
||||
{
|
||||
/* Emit whole number of quads in total. */
|
||||
count -= count & 3;
|
||||
|
||||
if (HAVE_QUADS) {
|
||||
LOCAL_VARS;
|
||||
GLuint *elts = TNL_CONTEXT(ctx)->vb.Elts;
|
||||
@@ -1088,14 +1082,12 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
|
||||
|
||||
currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4;
|
||||
|
||||
count -= (count-start)%4;
|
||||
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j < count; j += nr) {
|
||||
for (j = 0; j < count; j += nr) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
TAG(emit_elts)( ctx, elts+j, nr, ALLOC_ELTS(nr) );
|
||||
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
|
||||
FLUSH();
|
||||
currentsz = dmasz;
|
||||
}
|
||||
@@ -1112,7 +1104,6 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
|
||||
/* Emit whole number of quads in total, and in each buffer.
|
||||
*/
|
||||
dmasz -= dmasz & 3;
|
||||
count -= (count-start) & 3;
|
||||
currentsz -= currentsz & 3;
|
||||
|
||||
/* Adjust for rendering as triangles:
|
||||
@@ -1123,7 +1114,7 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
|
||||
if (currentsz < 8)
|
||||
currentsz = dmasz;
|
||||
|
||||
for (j = start; j + 3 < count; j += nr - 2 ) {
|
||||
for (j = 0; j + 3 < count; j += nr - 2) {
|
||||
nr = MIN2( currentsz, count - j );
|
||||
|
||||
if (nr >= 4)
|
||||
@@ -1132,7 +1123,7 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
|
||||
GLint i;
|
||||
ELTS_VARS( ALLOC_ELTS( quads * 6 ) );
|
||||
|
||||
for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
|
||||
for (i = j; i < j + quads; i++, elts += 4) {
|
||||
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
|
||||
EMIT_TWO_ELTS( 2, elts[3], elts[1] );
|
||||
EMIT_TWO_ELTS( 4, elts[2], elts[3] );
|
||||
|
Reference in New Issue
Block a user