Compare commits
28 Commits
mesa-7.0.2
...
mesa-7.0.2
Author | SHA1 | Date | |
---|---|---|---|
|
09504dde1f | ||
|
c04885f072 | ||
|
48ae5cf09d | ||
|
45cdb6eb45 | ||
|
b9f3f732aa | ||
|
17006ddd6b | ||
|
b77a354df3 | ||
|
71d46beebf | ||
|
454e296eb1 | ||
|
f9b696be2b | ||
|
c923edbc71 | ||
|
e20c1d987f | ||
|
cd354eb10f | ||
|
e9ac27ee23 | ||
|
3f9dc9f5b6 | ||
|
ba709875ae | ||
|
80f8397b35 | ||
|
b45fa27fa1 | ||
|
b59480645d | ||
|
148cb36979 | ||
|
c1eb78f7ff | ||
|
8aa0fd6b20 | ||
|
a1b3a908f5 | ||
|
f9e70d951a | ||
|
41ed6be1da | ||
|
27de28fc3e | ||
|
dd2f01c229 | ||
|
deb5c56c77 |
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -1,3 +1,10 @@
|
||||
mesa (7.0.2-4) unstable; urgency=low
|
||||
|
||||
* Update to mesa_7_0_branch head (commit 48ae5cf0).
|
||||
* Add Vcs-Git, Vcs-Browser and Homepage fields in debian/control.
|
||||
|
||||
-- Julien Cristau <jcristau@debian.org> Thu, 17 Jan 2008 22:23:06 +0100
|
||||
|
||||
mesa (7.0.2-3) unstable; urgency=low
|
||||
|
||||
* Update to mesa_7_0_branch head (commit 0107acde).
|
||||
|
3
debian/control
vendored
3
debian/control
vendored
@@ -5,6 +5,9 @@ Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
|
||||
Uploaders: Thierry Reding <thierry@gilfi.de>, Julien Cristau <jcristau@debian.org>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
|
||||
Standards-Version: 3.7.3
|
||||
Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev, libxext-dev
|
||||
Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/mesa
|
||||
Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/mesa.git
|
||||
Homepage: http://mesa3d.sourceforge.net/
|
||||
|
||||
Package: libgl1-mesa-swx11
|
||||
Section: libs
|
||||
|
@@ -342,7 +342,7 @@ will fix the problem.
|
||||
|
||||
<h2>4.1 How can I contribute?</a></h2>
|
||||
<p>
|
||||
First, join the <a href="http://www.mesa3d.org/lists.html>Mesa3d-dev
|
||||
First, join the <a href="http://www.mesa3d.org/lists.html">Mesa3d-dev
|
||||
mailing list</a>.
|
||||
That's where Mesa development is discussed.
|
||||
</a></p>
|
||||
|
@@ -33,6 +33,9 @@ Mesa 7.0.3 is a stable release with bug fixes since version 7.0.2.
|
||||
<li>Two-sided stencil test didn't work in software rendering
|
||||
<li>Fix two-sided lighting bugs/crashes (bug 13368)
|
||||
<li>GLSL gl_FrontFacing didn't work properly
|
||||
<li>glGetActiveUniform returned incorrect sizes (bug 13751)
|
||||
<li>Fix several bugs relating to uniforms and attributes in GLSL API (Bruce Merry, bug 13753)
|
||||
<li>glTexImage3D(GL_PROXY_TEXTURE_3D) mis-set teximage depth field
|
||||
</ul>
|
||||
|
||||
|
||||
|
@@ -50,7 +50,6 @@ SHARED_INCLUDES = \
|
||||
-I$(TOP)/src/mesa/main \
|
||||
-I$(TOP)/src/mesa/glapi \
|
||||
-I$(TOP)/src/mesa/math \
|
||||
-I$(TOP)/src/mesa/transform \
|
||||
-I$(TOP)/src/mesa/shader \
|
||||
-I$(TOP)/src/mesa/swrast \
|
||||
-I$(TOP)/src/mesa/swrast_setup \
|
||||
|
@@ -193,7 +193,7 @@ static GLboolean gamma_run_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -144,7 +144,7 @@ static GLboolean i810_run_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -213,7 +213,7 @@ static GLboolean intel_run_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -54,7 +54,7 @@ static GLint step_offsets[6][2] = { {0, 2},
|
||||
};
|
||||
|
||||
GLboolean
|
||||
i915_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
i915_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt)
|
||||
{
|
||||
GLint level;
|
||||
|
||||
@@ -67,7 +67,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
assert(lvlWidth == lvlHeight); /* cubemap images are square */
|
||||
|
||||
/* double pitch for cube layouts */
|
||||
mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp;
|
||||
mt->pitch = intel_miptree_pitch_align (intel, mt, dim * 2);
|
||||
mt->total_height = dim * 4;
|
||||
|
||||
for (level = mt->first_level; level <= mt->last_level; level++) {
|
||||
@@ -107,7 +107,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
|
||||
/* Calculate the size of a single slice.
|
||||
*/
|
||||
mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
|
||||
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
|
||||
|
||||
/* XXX: hardware expects/requires 9 levels at minimum.
|
||||
*/
|
||||
@@ -150,7 +150,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
GLuint height = mt->height0;
|
||||
GLuint img_height;
|
||||
|
||||
mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
|
||||
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
|
||||
mt->total_height = 0;
|
||||
|
||||
for (level = mt->first_level; level <= mt->last_level; level++) {
|
||||
@@ -180,7 +180,7 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
|
||||
|
||||
GLboolean
|
||||
i945_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
i945_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree * mt)
|
||||
{
|
||||
GLint level;
|
||||
|
||||
@@ -197,7 +197,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
* or the final row of 4x4, 2x2 and 1x1 faces below this.
|
||||
*/
|
||||
if (dim > 32)
|
||||
mt->pitch = ((dim * mt->cpp * 2 + 3) & ~3) / mt->cpp;
|
||||
mt->pitch = intel_miptree_pitch_align (intel, mt, dim);
|
||||
else
|
||||
mt->pitch = 14 * 8;
|
||||
|
||||
@@ -279,7 +279,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
GLuint pack_y_pitch;
|
||||
GLuint level;
|
||||
|
||||
mt->pitch = ((mt->width0 * mt->cpp + 3) & ~3) / mt->cpp;
|
||||
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->width0);
|
||||
mt->total_height = 0;
|
||||
|
||||
pack_y_pitch = MAX2(mt->height0, 2);
|
||||
@@ -329,7 +329,7 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
|
||||
case GL_TEXTURE_1D:
|
||||
case GL_TEXTURE_2D:
|
||||
case GL_TEXTURE_RECTANGLE_ARB:
|
||||
i945_miptree_layout_2d(mt);
|
||||
i945_miptree_layout_2d(intel, mt);
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(NULL, "Unexpected tex target in i945_miptree_layout()");
|
||||
|
@@ -75,6 +75,7 @@ intel_miptree_create(struct intel_context *intel,
|
||||
mt->cpp = compress_byte ? compress_byte : cpp;
|
||||
mt->compressed = compress_byte ? 1 : 0;
|
||||
mt->refcount = 1;
|
||||
mt->pitch = 0;
|
||||
|
||||
switch (intel->intelScreen->deviceID) {
|
||||
case PCI_CHIP_I945_G:
|
||||
@@ -83,7 +84,7 @@ intel_miptree_create(struct intel_context *intel,
|
||||
case PCI_CHIP_G33_G:
|
||||
case PCI_CHIP_Q33_G:
|
||||
case PCI_CHIP_Q35_G:
|
||||
ok = i945_miptree_layout(mt);
|
||||
ok = i945_miptree_layout(intel, mt);
|
||||
break;
|
||||
case PCI_CHIP_I915_G:
|
||||
case PCI_CHIP_I915_GM:
|
||||
@@ -93,28 +94,12 @@ intel_miptree_create(struct intel_context *intel,
|
||||
default:
|
||||
/* All the i830 chips and the i915 use this layout:
|
||||
*/
|
||||
ok = i915_miptree_layout(mt);
|
||||
ok = i915_miptree_layout(intel, mt);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
if (!mt->compressed) {
|
||||
/* XXX: Align pitch to multiple of 64 bytes for now to allow
|
||||
* render-to-texture to work in all cases. This should probably be
|
||||
* replaced at some point by some scheme to only do this when really
|
||||
* necessary.
|
||||
*/
|
||||
mt->pitch = (mt->pitch * cpp + 63) & ~63;
|
||||
|
||||
/* XXX: At least the i915 seems very upset when the pitch is a multiple
|
||||
* of 1024 and sometimes 512 bytes - performance can drop by several
|
||||
* times. Go to the next multiple of 64 for now.
|
||||
*/
|
||||
if (!(mt->pitch & 511))
|
||||
mt->pitch += 64;
|
||||
|
||||
mt->pitch /= cpp;
|
||||
}
|
||||
assert (mt->pitch);
|
||||
|
||||
mt->region = intel_region_alloc(intel->intelScreen,
|
||||
mt->cpp, mt->pitch, mt->total_height);
|
||||
@@ -128,6 +113,42 @@ intel_miptree_create(struct intel_context *intel,
|
||||
return mt;
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_miptree_pitch_align:
|
||||
*
|
||||
* @intel: intel context pointer
|
||||
*
|
||||
* @mt: the miptree to compute pitch alignment for
|
||||
*
|
||||
* @pitch: the natural pitch value
|
||||
*
|
||||
* Given @pitch, compute a larger value which accounts for
|
||||
* any necessary alignment required by the device
|
||||
*/
|
||||
|
||||
int intel_miptree_pitch_align (struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt,
|
||||
int pitch)
|
||||
{
|
||||
if (!mt->compressed) {
|
||||
/* XXX: Align pitch to multiple of 64 bytes for now to allow
|
||||
* render-to-texture to work in all cases. This should probably be
|
||||
* replaced at some point by some scheme to only do this when really
|
||||
* necessary.
|
||||
*/
|
||||
pitch = (pitch * mt->cpp + 63) & ~63;
|
||||
|
||||
/* XXX: At least the i915 seems very upset when the pitch is a multiple
|
||||
* of 1024 and sometimes 512 bytes - performance can drop by several
|
||||
* times. Go to the next multiple of the required alignment for now.
|
||||
*/
|
||||
if (!(pitch & 511))
|
||||
pitch += 64;
|
||||
|
||||
pitch /= mt->cpp;
|
||||
}
|
||||
return pitch;
|
||||
}
|
||||
|
||||
void
|
||||
intel_miptree_reference(struct intel_mipmap_tree **dst,
|
||||
|
@@ -123,6 +123,10 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
|
||||
GLuint cpp,
|
||||
GLuint compress_byte);
|
||||
|
||||
int intel_miptree_pitch_align (struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt,
|
||||
int pitch);
|
||||
|
||||
void intel_miptree_reference(struct intel_mipmap_tree **dst,
|
||||
struct intel_mipmap_tree *src);
|
||||
|
||||
@@ -190,8 +194,10 @@ void intel_miptree_image_copy(struct intel_context *intel,
|
||||
|
||||
/* i915_mipmap_tree.c:
|
||||
*/
|
||||
GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt);
|
||||
GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt);
|
||||
GLboolean i915_miptree_layout(struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt);
|
||||
GLboolean i945_miptree_layout(struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt);
|
||||
|
||||
|
||||
|
||||
|
@@ -214,7 +214,7 @@ intel_run_render(GLcontext * ctx, struct tnl_pipeline_stage *stage)
|
||||
tnl->Driver.Render.Start(ctx);
|
||||
|
||||
for (i = 0; i < VB->PrimitiveCount; i++) {
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -82,15 +82,15 @@ static void compile_sf_prog( struct brw_context *brw,
|
||||
switch (key->primitive) {
|
||||
case SF_TRIANGLES:
|
||||
c.nr_verts = 3;
|
||||
brw_emit_tri_setup( &c );
|
||||
brw_emit_tri_setup( &c, GL_TRUE );
|
||||
break;
|
||||
case SF_LINES:
|
||||
c.nr_verts = 2;
|
||||
brw_emit_line_setup( &c );
|
||||
brw_emit_line_setup( &c, GL_TRUE );
|
||||
break;
|
||||
case SF_POINTS:
|
||||
c.nr_verts = 1;
|
||||
brw_emit_point_setup( &c );
|
||||
brw_emit_point_setup( &c, GL_TRUE );
|
||||
break;
|
||||
case SF_UNFILLED_TRIS:
|
||||
c.nr_verts = 3;
|
||||
|
@@ -97,9 +97,9 @@ struct brw_sf_compile {
|
||||
};
|
||||
|
||||
|
||||
void brw_emit_tri_setup( struct brw_sf_compile *c );
|
||||
void brw_emit_line_setup( struct brw_sf_compile *c );
|
||||
void brw_emit_point_setup( struct brw_sf_compile *c );
|
||||
void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate );
|
||||
void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate );
|
||||
void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate );
|
||||
void brw_emit_anyprim_setup( struct brw_sf_compile *c );
|
||||
|
||||
#endif
|
||||
|
@@ -343,13 +343,16 @@ static GLboolean calculate_masks( struct brw_sf_compile *c,
|
||||
|
||||
|
||||
|
||||
void brw_emit_tri_setup( struct brw_sf_compile *c )
|
||||
void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate)
|
||||
{
|
||||
struct brw_compile *p = &c->func;
|
||||
GLuint i;
|
||||
|
||||
c->nr_verts = 3;
|
||||
alloc_regs(c);
|
||||
|
||||
if (allocate)
|
||||
alloc_regs(c);
|
||||
|
||||
invert_det(c);
|
||||
copy_z_inv_w(c);
|
||||
|
||||
@@ -428,14 +431,17 @@ void brw_emit_tri_setup( struct brw_sf_compile *c )
|
||||
|
||||
|
||||
|
||||
void brw_emit_line_setup( struct brw_sf_compile *c )
|
||||
void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate)
|
||||
{
|
||||
struct brw_compile *p = &c->func;
|
||||
GLuint i;
|
||||
|
||||
|
||||
c->nr_verts = 2;
|
||||
alloc_regs(c);
|
||||
|
||||
if (allocate)
|
||||
alloc_regs(c);
|
||||
|
||||
invert_det(c);
|
||||
copy_z_inv_w(c);
|
||||
|
||||
@@ -497,17 +503,19 @@ void brw_emit_line_setup( struct brw_sf_compile *c )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Points setup - several simplifications as all attributes are
|
||||
* constant across the face of the point (point sprites excluded!)
|
||||
*/
|
||||
void brw_emit_point_setup( struct brw_sf_compile *c )
|
||||
void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate)
|
||||
{
|
||||
struct brw_compile *p = &c->func;
|
||||
GLuint i;
|
||||
|
||||
c->nr_verts = 1;
|
||||
alloc_regs(c);
|
||||
|
||||
if (allocate)
|
||||
alloc_regs(c);
|
||||
|
||||
copy_z_inv_w(c);
|
||||
|
||||
brw_MOV(p, c->m1Cx, brw_imm_ud(0)); /* zero - move out of loop */
|
||||
@@ -564,7 +572,10 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c )
|
||||
struct brw_reg primmask;
|
||||
struct brw_instruction *jmp;
|
||||
struct brw_reg v1_null_ud = vec1(retype(brw_null_reg(), BRW_REGISTER_TYPE_UD));
|
||||
|
||||
GLuint saveflag;
|
||||
|
||||
c->nr_verts = 3;
|
||||
alloc_regs(c);
|
||||
|
||||
primmask = retype(get_element(c->tmp, 0), BRW_REGISTER_TYPE_UD);
|
||||
@@ -582,10 +593,15 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c )
|
||||
(1<<_3DPRIM_TRIFAN_NOSTIPPLE)));
|
||||
jmp = brw_JMPI(p, ip, ip, brw_imm_w(0));
|
||||
{
|
||||
brw_push_insn_state(p);
|
||||
brw_emit_tri_setup( c );
|
||||
saveflag = p->flag_value;
|
||||
brw_push_insn_state(p);
|
||||
brw_emit_tri_setup( c, GL_FALSE );
|
||||
brw_pop_insn_state(p);
|
||||
/* note - thread killed in subroutine */
|
||||
p->flag_value = saveflag;
|
||||
/* note - thread killed in subroutine, so must
|
||||
* restore the flag which is changed when building
|
||||
* the subroutine. fix #13240
|
||||
*/
|
||||
}
|
||||
brw_land_fwd_jump(p, jmp);
|
||||
|
||||
@@ -598,14 +614,16 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c )
|
||||
(1<<_3DPRIM_LINESTRIP_CONT_BF)));
|
||||
jmp = brw_JMPI(p, ip, ip, brw_imm_w(0));
|
||||
{
|
||||
saveflag = p->flag_value;
|
||||
brw_push_insn_state(p);
|
||||
brw_emit_line_setup( c );
|
||||
brw_emit_line_setup( c, GL_FALSE );
|
||||
brw_pop_insn_state(p);
|
||||
p->flag_value = saveflag;
|
||||
/* note - thread killed in subroutine */
|
||||
}
|
||||
brw_land_fwd_jump(p, jmp);
|
||||
|
||||
brw_emit_point_setup( c );
|
||||
brw_emit_point_setup( c, GL_FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
#include "macros.h"
|
||||
|
||||
|
||||
GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
|
||||
GLboolean brw_miptree_layout( struct intel_context *intel, struct intel_mipmap_tree *mt )
|
||||
{
|
||||
/* XXX: these vary depending on image format:
|
||||
*/
|
||||
@@ -102,7 +102,7 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
|
||||
}
|
||||
|
||||
default:
|
||||
i945_miptree_layout_2d(mt);
|
||||
i945_miptree_layout_2d(intel, mt);
|
||||
break;
|
||||
}
|
||||
DBG("%s: %dx%dx%d - sz 0x%x\n", __FUNCTION__,
|
||||
|
@@ -91,7 +91,7 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
|
||||
default:
|
||||
if (INTEL_DEBUG & DEBUG_TEXTURE)
|
||||
_mesa_printf("assuming BRW texture layouts\n");
|
||||
ok = brw_miptree_layout( mt );
|
||||
ok = brw_miptree_layout( intel, mt );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,29 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* intel_miptree_pitch_align:
|
||||
*
|
||||
* @intel: intel context pointer
|
||||
*
|
||||
* @mt: the miptree to compute pitch alignment for
|
||||
*
|
||||
* @pitch: the natural pitch value
|
||||
*
|
||||
* Given @pitch, compute a larger value which accounts for
|
||||
* any necessary alignment required by the device
|
||||
*/
|
||||
|
||||
int intel_miptree_pitch_align (struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt,
|
||||
int pitch)
|
||||
{
|
||||
if (!mt->compressed)
|
||||
pitch = ((pitch * mt->cpp + 3) & ~3) / mt->cpp;
|
||||
|
||||
return pitch;
|
||||
}
|
||||
|
||||
|
||||
void intel_miptree_destroy( struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt )
|
||||
|
@@ -115,6 +115,10 @@ struct intel_mipmap_tree *intel_miptree_create( struct intel_context *intel,
|
||||
GLuint cpp,
|
||||
GLboolean compressed);
|
||||
|
||||
int intel_miptree_pitch_align (struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt,
|
||||
int pitch);
|
||||
|
||||
void intel_miptree_destroy( struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt );
|
||||
|
||||
@@ -159,7 +163,8 @@ GLboolean intel_miptree_image_data(struct intel_context *intel,
|
||||
*/
|
||||
GLboolean i915_miptree_layout( struct intel_mipmap_tree *mt );
|
||||
GLboolean i945_miptree_layout( struct intel_mipmap_tree *mt );
|
||||
GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt );
|
||||
GLboolean brw_miptree_layout( struct intel_context *intel,
|
||||
struct intel_mipmap_tree *mt );
|
||||
|
||||
|
||||
|
||||
|
@@ -40,7 +40,7 @@ static int align(int value, int alignment)
|
||||
return (value + alignment - 1) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
|
||||
void i945_miptree_layout_2d( struct intel_context *intel, struct intel_mipmap_tree *mt )
|
||||
{
|
||||
GLint align_h = 2, align_w = 4;
|
||||
GLuint level;
|
||||
@@ -67,7 +67,7 @@ void i945_miptree_layout_2d( struct intel_mipmap_tree *mt )
|
||||
/* Pitch must be a whole number of dwords, even though we
|
||||
* express it in texels.
|
||||
*/
|
||||
mt->pitch = align(mt->pitch * mt->cpp, 4) / mt->cpp;
|
||||
mt->pitch = intel_miptree_pitch_align (intel, mt, mt->pitch);
|
||||
mt->total_height = 0;
|
||||
|
||||
for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
|
||||
|
@@ -38,4 +38,4 @@ static GLuint minify( GLuint d )
|
||||
return MAX2(1, d>>1);
|
||||
}
|
||||
|
||||
extern void i945_miptree_layout_2d( struct intel_mipmap_tree *mt );
|
||||
extern void i945_miptree_layout_2d( struct intel_context *intel, struct intel_mipmap_tree *mt );
|
||||
|
@@ -144,7 +144,7 @@ static GLboolean mga_run_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -489,7 +489,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -418,7 +418,7 @@ static GLboolean radeon_run_tcl_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -170,7 +170,7 @@ static GLboolean s3v_run_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++ )
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -198,7 +198,7 @@ static GLboolean savage_run_render( GLcontext *ctx,
|
||||
|
||||
for (i = 0 ; i < VB->PrimitiveCount ; i++)
|
||||
{
|
||||
GLuint prim = VB->Primitive[i].mode;
|
||||
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
|
||||
|
@@ -106,7 +106,7 @@ static GLboolean via_run_fastrender(GLcontext *ctx,
|
||||
tnl->clipspace.new_inputs |= VERT_BIT_POS;
|
||||
|
||||
for (i = 0; i < VB->PrimitiveCount; ++i) {
|
||||
GLuint mode = VB->Primitive[i].mode;
|
||||
GLuint mode = _tnl_translate_prim(&VB->Primitive[i]);
|
||||
GLuint start = VB->Primitive[i].start;
|
||||
GLuint length = VB->Primitive[i].count;
|
||||
if (length)
|
||||
|
@@ -1500,15 +1500,19 @@ void gl_dispatch_stub_650(void){}
|
||||
void gl_dispatch_stub_651(void){}
|
||||
void gl_dispatch_stub_652(void){}
|
||||
void gl_dispatch_stub_653(void){}
|
||||
void gl_dispatch_stub_733(void){}
|
||||
void gl_dispatch_stub_734(void){}
|
||||
void gl_dispatch_stub_735(void){}
|
||||
void gl_dispatch_stub_736(void){}
|
||||
void gl_dispatch_stub_737(void){}
|
||||
void gl_dispatch_stub_738(void){}
|
||||
void gl_dispatch_stub_744(void){}
|
||||
void gl_dispatch_stub_745(void){}
|
||||
void gl_dispatch_stub_746(void){}
|
||||
void gl_dispatch_stub_760(void){}
|
||||
void gl_dispatch_stub_761(void){}
|
||||
void gl_dispatch_stub_763(void){}
|
||||
void gl_dispatch_stub_765(void){}
|
||||
void gl_dispatch_stub_766(void){}
|
||||
void gl_dispatch_stub_767(void){}
|
||||
void gl_dispatch_stub_768(void){}
|
||||
|
@@ -59,12 +59,18 @@
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT" value="0x8CDC"/>
|
||||
<enum name="FRAMEBUFFER_UNSUPPORTED_EXT" value="0x8CDD"/>
|
||||
<enum name="FRAMEBUFFER_STATUS_ERROR_EXT" value="0x8CDE"/>
|
||||
|
||||
<enum name="FRAMEBUFFER_BINDING_EXT" value="0x8CA6"/>
|
||||
<enum name="RENDERBUFFER_BINDING_EXT" value="0x8CA7"/>
|
||||
<enum name="MAX_COLOR_ATTACHMENTS_EXT" value="0x8CDF"/>
|
||||
<enum name="MAX_RENDERBUFFER_SIZE_EXT" value="0x84E8"/>
|
||||
|
||||
<enum name="FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CA6">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<enum name="RENDERBUFFER_BINDING_EXT" count="1" value="0x8CA7">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<enum name="MAX_COLOR_ATTACHMENTS_EXT" count="1" value="0x8CDF">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<enum name="MAX_RENDERBUFFER_SIZE_EXT" count="1" value="0x84E8">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<enum name="INVALID_FRAMEBUFFER_OPERATION_EXT" value="0x0506"/>
|
||||
|
||||
<function name="IsRenderbufferEXT" offset="assign">
|
||||
|
@@ -3380,7 +3380,9 @@
|
||||
<size name="GetTexParameterfv" mode="get"/>
|
||||
<size name="GetTexParameteriv" mode="get"/>
|
||||
</enum>
|
||||
<enum name="MAX_3D_TEXTURE_SIZE" value="0x8073"/>
|
||||
<enum name="MAX_3D_TEXTURE_SIZE" count="1" value="0x8073">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<enum name="UNSIGNED_BYTE_2_3_3_REV" value="0x8362"/>
|
||||
<enum name="UNSIGNED_SHORT_5_6_5" value="0x8363"/>
|
||||
<enum name="UNSIGNED_SHORT_5_6_5_REV" value="0x8364"/>
|
||||
@@ -12131,8 +12133,12 @@
|
||||
<category name="GL_EXT_framebuffer_blit" number="316">
|
||||
<enum name="READ_FRAMEBUFFER_EXT" value="0x8CA8"/>
|
||||
<enum name="DRAW_FRAMEBUFFER_EXT" value="0x8CA9"/>
|
||||
<enum name="DRAW_FRAMEBUFFER_BINDING_EXT" value="0x8CA6"/>
|
||||
<enum name="READ_FRAMEBUFFER_BINDING_EXT" value="0x8CAA"/>
|
||||
<enum name="DRAW_FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CA6">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<enum name="READ_FRAMEBUFFER_BINDING_EXT" count="1" value="0x8CAA">
|
||||
<size name="Get" mode="get"/>
|
||||
</enum>
|
||||
<function name="BlitFramebufferEXT" offset="assign" static_dispatch="false">
|
||||
<param name="srcX0" type="GLint"/>
|
||||
<param name="srcY0" type="GLint"/>
|
||||
|
@@ -271,6 +271,14 @@ draw_buffer_enum_to_bitmask(GLenum buffer)
|
||||
return BUFFER_BIT_COLOR2;
|
||||
case GL_COLOR_ATTACHMENT3_EXT:
|
||||
return BUFFER_BIT_COLOR3;
|
||||
case GL_COLOR_ATTACHMENT4_EXT:
|
||||
return BUFFER_BIT_COLOR4;
|
||||
case GL_COLOR_ATTACHMENT5_EXT:
|
||||
return BUFFER_BIT_COLOR5;
|
||||
case GL_COLOR_ATTACHMENT6_EXT:
|
||||
return BUFFER_BIT_COLOR6;
|
||||
case GL_COLOR_ATTACHMENT7_EXT:
|
||||
return BUFFER_BIT_COLOR7;
|
||||
default:
|
||||
/* error */
|
||||
return BAD_MASK;
|
||||
@@ -320,6 +328,14 @@ read_buffer_enum_to_index(GLenum buffer)
|
||||
return BUFFER_COLOR2;
|
||||
case GL_COLOR_ATTACHMENT3_EXT:
|
||||
return BUFFER_COLOR3;
|
||||
case GL_COLOR_ATTACHMENT4_EXT:
|
||||
return BUFFER_COLOR4;
|
||||
case GL_COLOR_ATTACHMENT5_EXT:
|
||||
return BUFFER_COLOR5;
|
||||
case GL_COLOR_ATTACHMENT6_EXT:
|
||||
return BUFFER_COLOR6;
|
||||
case GL_COLOR_ATTACHMENT7_EXT:
|
||||
return BUFFER_COLOR7;
|
||||
default:
|
||||
/* error */
|
||||
return -1;
|
||||
|
@@ -272,10 +272,10 @@ do { \
|
||||
(((CTX)->Light.Enabled && \
|
||||
(CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \
|
||||
|| (CTX)->Fog.ColorSumEnabled \
|
||||
|| ((CTX)->VertexProgram._Enabled && \
|
||||
((CTX)->VertexProgram.Current->Base.InputsRead & VERT_BIT_COLOR1)) \
|
||||
|| ((CTX)->FragmentProgram._Enabled && \
|
||||
((CTX)->FragmentProgram.Current->Base.InputsRead & FRAG_BIT_COL1)) \
|
||||
|| ((CTX)->VertexProgram._Current && \
|
||||
((CTX)->VertexProgram._Current->Base.InputsRead & VERT_BIT_COLOR1)) \
|
||||
|| ((CTX)->FragmentProgram._Current && \
|
||||
((CTX)->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL1)) \
|
||||
)
|
||||
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.0.1
|
||||
* Version: 7.0.3
|
||||
*
|
||||
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -2554,8 +2554,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
|
||||
}
|
||||
else {
|
||||
/* no error, set the tex image parameters */
|
||||
_mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
|
||||
border, internalFormat);
|
||||
_mesa_init_teximage_fields(ctx, target, texImage, width, height,
|
||||
depth, border, internalFormat);
|
||||
texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
|
||||
internalFormat, format, type);
|
||||
}
|
||||
|
@@ -369,6 +369,54 @@ copy_string(GLchar *dst, GLsizei maxLength, GLsizei *length, const GLchar *src)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return size (in floats) of the given GLSL type.
|
||||
* See also _slang_sizeof_type_specifier().
|
||||
*/
|
||||
static GLint
|
||||
sizeof_glsl_type(GLenum type)
|
||||
{
|
||||
switch (type) {
|
||||
case GL_BOOL:
|
||||
case GL_FLOAT:
|
||||
case GL_INT:
|
||||
return 1;
|
||||
case GL_BOOL_VEC2:
|
||||
case GL_FLOAT_VEC2:
|
||||
case GL_INT_VEC2:
|
||||
return 2;
|
||||
case GL_BOOL_VEC3:
|
||||
case GL_FLOAT_VEC3:
|
||||
case GL_INT_VEC3:
|
||||
return 3;
|
||||
case GL_BOOL_VEC4:
|
||||
case GL_FLOAT_VEC4:
|
||||
case GL_INT_VEC4:
|
||||
return 4;
|
||||
case GL_FLOAT_MAT2:
|
||||
return 8; /* 2 rows of 4, actually */
|
||||
case GL_FLOAT_MAT3:
|
||||
return 12; /* 3 rows of 4, actually */
|
||||
case GL_FLOAT_MAT4:
|
||||
return 16;
|
||||
case GL_FLOAT_MAT2x3:
|
||||
return 8; /* 2 rows of 4, actually */
|
||||
case GL_FLOAT_MAT2x4:
|
||||
return 8;
|
||||
case GL_FLOAT_MAT3x2:
|
||||
return 12; /* 3 rows of 4, actually */
|
||||
case GL_FLOAT_MAT3x4:
|
||||
return 12;
|
||||
case GL_FLOAT_MAT4x2:
|
||||
return 16; /* 4 rows of 4, actually */
|
||||
case GL_FLOAT_MAT4x3:
|
||||
return 16; /* 4 rows of 4, actually */
|
||||
default:
|
||||
return 0; /* error */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called via ctx->Driver.AttachShader()
|
||||
*/
|
||||
@@ -633,9 +681,9 @@ _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index,
|
||||
shProg->Attributes->Parameters[index].Name);
|
||||
sz = shProg->Attributes->Parameters[index].Size;
|
||||
if (size)
|
||||
*size = sz;
|
||||
if (type)
|
||||
*type = vec_types[sz]; /* XXX this is a temporary hack */
|
||||
*size = 1; /* attributes may not be arrays */
|
||||
if (type && sz > 0 && sz <= 4) /* XXX this is a temporary hack */
|
||||
*type = vec_types[sz - 1];
|
||||
}
|
||||
|
||||
|
||||
@@ -666,13 +714,17 @@ _mesa_get_active_uniform(GLcontext *ctx, GLuint program, GLuint index,
|
||||
if (shProg->Uniforms->Parameters[j].Type == PROGRAM_UNIFORM ||
|
||||
shProg->Uniforms->Parameters[j].Type == PROGRAM_SAMPLER) {
|
||||
if (ind == index) {
|
||||
GLuint uSize = shProg->Uniforms->Parameters[j].Size;
|
||||
GLenum uType = shProg->Uniforms->Parameters[j].DataType;
|
||||
/* found it */
|
||||
copy_string(nameOut, maxLength, length,
|
||||
shProg->Uniforms->Parameters[j].Name);
|
||||
if (size)
|
||||
*size = shProg->Uniforms->Parameters[j].Size;
|
||||
if (size) {
|
||||
/* convert from floats to 'type' (eg: sizeof(mat4x4)=1) */
|
||||
*size = uSize / sizeof_glsl_type(uType);
|
||||
}
|
||||
if (type)
|
||||
*type = shProg->Uniforms->Parameters[j].DataType;
|
||||
*type = uType;
|
||||
return;
|
||||
}
|
||||
ind++;
|
||||
@@ -903,9 +955,40 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
|
||||
if (shProg) {
|
||||
GLint i;
|
||||
if (location >= 0 && location < shProg->Uniforms->NumParameters) {
|
||||
for (i = 0; i < shProg->Uniforms->Parameters[location].Size; i++) {
|
||||
params[i] = shProg->Uniforms->ParameterValues[location][i];
|
||||
GLuint uSize;
|
||||
GLenum uType;
|
||||
GLint rows = 0;
|
||||
uType = shProg->Uniforms->Parameters[location].DataType;
|
||||
uSize = sizeof_glsl_type(uType);
|
||||
/* Matrix types need special handling, because they span several
|
||||
* parameters, and may also not be fully packed.
|
||||
*/
|
||||
switch (shProg->Uniforms->Parameters[location].DataType) {
|
||||
case GL_FLOAT_MAT2:
|
||||
case GL_FLOAT_MAT3x2:
|
||||
case GL_FLOAT_MAT4x2:
|
||||
rows = 2;
|
||||
break;
|
||||
case GL_FLOAT_MAT2x3:
|
||||
case GL_FLOAT_MAT3:
|
||||
case GL_FLOAT_MAT4x3:
|
||||
rows = 3;
|
||||
break;
|
||||
case GL_FLOAT_MAT2x4:
|
||||
case GL_FLOAT_MAT3x4:
|
||||
case GL_FLOAT_MAT4:
|
||||
rows = 4;
|
||||
}
|
||||
if (rows != 0) {
|
||||
GLint r, c;
|
||||
for (c = 0, i = 0; c * 4 < uSize; c++)
|
||||
for (r = 0; r < rows; r++, i++)
|
||||
params[i] = shProg->Uniforms->ParameterValues[location + c][r];
|
||||
}
|
||||
else
|
||||
for (i = 0; i < uSize; i++) {
|
||||
params[i] = shProg->Uniforms->ParameterValues[location][i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glGetUniformfv(location)");
|
||||
@@ -1059,19 +1142,28 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
|
||||
{
|
||||
struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
|
||||
GLint elems, i, k;
|
||||
GLenum uType;
|
||||
GLsizei maxCount;
|
||||
|
||||
if (!shProg || !shProg->LinkStatus) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(program not linked)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (location == -1)
|
||||
return; /* The standard specifies this as a no-op */
|
||||
|
||||
/* The spec says this is GL_INVALID_OPERATION, although it seems like it
|
||||
* ought to be GL_INVALID_VALUE
|
||||
*/
|
||||
if (location < 0 || location >= (GLint) shProg->Uniforms->NumParameters) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glUniform(location)");
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(location)");
|
||||
return;
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
|
||||
|
||||
uType = shProg->Uniforms->Parameters[location].DataType;
|
||||
/*
|
||||
* If we're setting a sampler, we must use glUniformi1()!
|
||||
*/
|
||||
@@ -1119,11 +1211,37 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
|
||||
return;
|
||||
}
|
||||
|
||||
if (count * elems > shProg->Uniforms->Parameters[location].Size) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count too large)");
|
||||
return;
|
||||
/* OpenGL requires types to match exactly, except that one can convert
|
||||
* float or int array to boolean array.
|
||||
*/
|
||||
switch (uType)
|
||||
{
|
||||
case GL_BOOL:
|
||||
case GL_BOOL_VEC2:
|
||||
case GL_BOOL_VEC3:
|
||||
case GL_BOOL_VEC4:
|
||||
if (elems != sizeof_glsl_type(uType)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(count mismatch)");
|
||||
}
|
||||
break;
|
||||
case PROGRAM_SAMPLER:
|
||||
break;
|
||||
default:
|
||||
if (shProg->Uniforms->Parameters[location].Type != PROGRAM_SAMPLER
|
||||
&& uType != type) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* XXX if this is a base type, then count must equal 1. However, we
|
||||
* don't have enough information from the compiler to distinguish a
|
||||
* base type from a 1-element array of that type. The standard allows
|
||||
* count to overrun an array, in which case the overflow is ignored.
|
||||
*/
|
||||
maxCount = shProg->Uniforms->Parameters[location].Size / elems;
|
||||
if (count > maxCount) count = maxCount;
|
||||
|
||||
for (k = 0; k < count; k++) {
|
||||
GLfloat *uniformVal = shProg->Uniforms->ParameterValues[location + k];
|
||||
if (type == GL_INT ||
|
||||
@@ -1141,6 +1259,13 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count,
|
||||
uniformVal[i] = fValues[i];
|
||||
}
|
||||
}
|
||||
if (uType == GL_BOOL ||
|
||||
uType == GL_BOOL_VEC2 ||
|
||||
uType == GL_BOOL_VEC3 ||
|
||||
uType == GL_BOOL_VEC4) {
|
||||
for (i = 0; i < elems; i++)
|
||||
uniformVal[i] = uniformVal[i] ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (shProg->Uniforms->Parameters[location].Type == PROGRAM_SAMPLER) {
|
||||
@@ -1161,20 +1286,30 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
|
||||
GLenum matrixType, GLint location, GLsizei count,
|
||||
GLboolean transpose, const GLfloat *values)
|
||||
{
|
||||
GLsizei maxCount, i;
|
||||
struct gl_shader_program *shProg = ctx->Shader.CurrentProgram;
|
||||
if (!shProg || !shProg->LinkStatus) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glUniformMatrix(program not linked)");
|
||||
return;
|
||||
}
|
||||
if (location < 0 || location >= shProg->Uniforms->NumParameters) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(location)");
|
||||
if (location == -1)
|
||||
return; /* The standard specifies this as a no-op */
|
||||
/* The spec says this is GL_INVALID_OPERATION, although it seems like it
|
||||
* ought to be GL_INVALID_VALUE
|
||||
*/
|
||||
if (location < 0 || location >= (GLint) shProg->Uniforms->NumParameters) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(location)");
|
||||
return;
|
||||
}
|
||||
if (values == NULL) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix");
|
||||
return;
|
||||
}
|
||||
if (count < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glUniformMatrix(count < 0)");
|
||||
return;
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
|
||||
|
||||
@@ -1183,23 +1318,30 @@ _mesa_uniform_matrix(GLcontext *ctx, GLint cols, GLint rows,
|
||||
* the rows.
|
||||
*/
|
||||
/* XXXX need to test 3x3 and 2x2 matrices... */
|
||||
if (transpose) {
|
||||
GLuint row, col;
|
||||
for (col = 0; col < cols; col++) {
|
||||
GLfloat *v = shProg->Uniforms->ParameterValues[location + col];
|
||||
for (row = 0; row < rows; row++) {
|
||||
v[row] = values[row * cols + col];
|
||||
maxCount = shProg->Uniforms->Parameters[location].Size / (4 * cols);
|
||||
if (count > maxCount)
|
||||
count = maxCount;
|
||||
for (i = 0; i < count; i++) {
|
||||
if (transpose) {
|
||||
GLuint row, col;
|
||||
for (col = 0; col < cols; col++) {
|
||||
GLfloat *v = shProg->Uniforms->ParameterValues[location + col];
|
||||
for (row = 0; row < rows; row++) {
|
||||
v[row] = values[row * cols + col];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GLuint row, col;
|
||||
for (col = 0; col < cols; col++) {
|
||||
GLfloat *v = shProg->Uniforms->ParameterValues[location + col];
|
||||
for (row = 0; row < rows; row++) {
|
||||
v[row] = values[col * rows + row];
|
||||
else {
|
||||
GLuint row, col;
|
||||
for (col = 0; col < cols; col++) {
|
||||
GLfloat *v = shProg->Uniforms->ParameterValues[location + col];
|
||||
for (row = 0; row < rows; row++) {
|
||||
v[row] = values[col * rows + row];
|
||||
}
|
||||
}
|
||||
}
|
||||
location += cols;
|
||||
values += rows * cols;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -294,10 +294,8 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
|
||||
ctx->Polygon.OffsetFill)
|
||||
ind |= SS_OFFSET_BIT;
|
||||
|
||||
/* Note: gl_FrontFacing lives in fragment input FOGC.Y at this time */
|
||||
if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
|
||||
(ctx->VertexProgram._Enabled && ctx->VertexProgram.TwoSideEnabled) ||
|
||||
(ctx->FragmentProgram._Current && ctx->FragmentProgram._Current->Base.InputsRead & (1 << FRAG_ATTRIB_FOGC)))
|
||||
(ctx->VertexProgram._Current && ctx->VertexProgram.TwoSideEnabled))
|
||||
ind |= SS_TWOSIDE_BIT;
|
||||
|
||||
/* We piggyback the two-sided stencil front/back determination on the
|
||||
|
@@ -242,6 +242,7 @@ void _vbo_DestroyContext( GLcontext *ctx )
|
||||
}
|
||||
|
||||
vbo_exec_destroy(ctx);
|
||||
vbo_save_destroy(ctx);
|
||||
FREE(vbo_context(ctx));
|
||||
ctx->swtnl_im = NULL;
|
||||
}
|
||||
|
@@ -69,6 +69,21 @@ void vbo_save_init( GLcontext *ctx )
|
||||
|
||||
void vbo_save_destroy( GLcontext *ctx )
|
||||
{
|
||||
struct vbo_context *vbo = vbo_context(ctx);
|
||||
struct vbo_save_context *save = &vbo->save;
|
||||
if (save->prim_store) {
|
||||
if ( --save->prim_store->refcount == 0 ) {
|
||||
FREE( save->prim_store );
|
||||
save->prim_store = NULL;
|
||||
}
|
||||
if ( --save->vertex_store->refcount == 0 ) {
|
||||
if (save->vertex_store->bufferobj)
|
||||
ctx->Driver.DeleteBuffer( ctx, save->vertex_store->bufferobj );
|
||||
|
||||
FREE( save->vertex_store );
|
||||
save->vertex_store = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user