Merge branch 'mesa_7_5_branch'

Conflicts:

	Makefile
	src/gallium/drivers/softpipe/sp_screen.c
	src/mesa/main/version.h
This commit is contained in:
Brian Paul 2009-06-26 17:07:07 -06:00
commit a18e209edb
24 changed files with 1485 additions and 323 deletions

View File

@ -123,48 +123,46 @@ These are the instructions for making a new Mesa release.
<H3>Get latest source files</H3>
<p>
Use "cvs update -dAP " to get the latest Mesa files from CVS.
Use git to get the latest Mesa files from the git repository, from whatever
branch is relevant.
</p>
<H3>Verify and update version info</H3>
<p>
Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
Update the docs/VERSIONS file too.
Create/edit the docs/relnotes-x.y.html file to document what's new in the release.
Add the new relnotes-x.y.html file to <a href="relnotes.html">relnotes.html</a>.
</p>
<p>
Edit the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
Update the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
configs/default.
Also update the VERSION line in the top-level Makefile.
</p>
<p>
Make sure the values in src/mesa/main/version.h are correct.
</p>
<p>
Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
DEMO_NAME are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
</p>
<p>
Check in all updates to CVS.
Check in all updates to git.
</p>
<p>
Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
Tag the files with the release name (in the form <b>mesa_X_Y</b>)
with: <code>git tag -a mesa_X_Y</code>
Then: <code>git push origin mesa_X_Y</code>
</p>
<H3>Make the tarballs</H3>
<p>
Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
ln -s Mesa Mesa-6.3
<code>ln -s Mesa Mesa-7.5</code>
This is needed in order to make a correct tar file in the next step.
</p>
@ -177,7 +175,7 @@ Make the distribution files. From inside the Mesa directory:
<p>
After the tarballs are created, the md5 checksums for the files will
be computed.
Add them to the docs/news.html file.
Add them to the docs/relnotes-X.Y.html file.
</p>
<p>
@ -191,9 +189,21 @@ Follow the directions on SourceForge for creating a new "release" and
uploading the tarballs.
</p>
<p>
Basically, to upload the tarball files with:
<br>
<code>
rsync -avP ssh Mesa*-X.Y.* USERNAME@frs.sourceforge.net:uploads/
</code>
</p>
<p>
Update the web site by copying the docs/ directory's files to
/home/users/b/br/brianp/mesa-www/htdocs/
/home/users/b/br/brianp/mesa-www/htdocs/ with:
<br>
<code>
sftp USERNAME,mesa3d@web.sourceforge.net
</code>
</p>
<p>

View File

@ -11,6 +11,21 @@
<H1>News</H1>
<h2>June 23, 2009</h2>
<p>
<a href="relnotes-7.4.4.html">Mesa 7.4.4</a> is released.
This is a stable release that fixes a regression in the i915/i965 drivers
that slipped into the 7.4.3 release.
</p>
<h2>June 19, 2009</h2>
<p>
<a href="relnotes-7.4.3.html">Mesa 7.4.3</a> is released.
This is a stable release fixing bugs since the 7.4.2 release.
</p>
<h2>May 15, 2009</h2>
<p>
<a href="relnotes-7.4.2.html">Mesa 7.4.2</a> is released.

79
docs/relnotes-7.4.3.html Normal file
View File

@ -0,0 +1,79 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.4.3 Release Notes / 19 June 2009</H1>
<p>
Mesa 7.4.3 is a stable development release fixing bugs since the 7.4.2 release.
</p>
<p>
Mesa 7.4.3 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
34c5a6c47ed51f31c4fa36e269831352 MesaLib-7.4.3.tar.gz
70a983ba3deaa8bd63b18bbab283f698 MesaLib-7.4.3.tar.bz2
34f21b3205b271d575030aa98a2dda51 MesaLib-7.4.3.zip
56752b7adede212e6097afb10d0c0d59 MesaDemos-7.4.3.tar.gz
8ffa51c4833b1e298300a005e2d7ca2a MesaDemos-7.4.3.tar.bz2
0037d24d41400d6fb9800ae55b8c863f MesaDemos-7.4.3.zip
20e24f6692c0c90e7e3b220f79c4108d MesaGLUT-7.4.3.tar.gz
03a4beeef74fc5ef0b1d6d04710e5a8a MesaGLUT-7.4.3.tar.bz2
273788230adbdb9d57371309adedcf5f MesaGLUT-7.4.3.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Fixed texture object reference counting bug (bug 21756)
<li>Allow depth/stencil textures to be attached to GL_STENCIL_ATTACHMENT point
(SF bug 2793846)
<li>Added missing glGet case for GL_VERTEX_ARRAY_BINDING_APPLE
<li>Fixed some OSMesa build issues
<li>Fixed a vertex buffer object crash
<li>Fixed broken glTexImage3D() when image type = GL_BITMAP
<li>Fixed some GLSL preprocessor bugs
<li>Fixed framebuffer mem leak in i945/i965 DRI drivers
<li>Fixed texture coordinate repeat bug in swrast (bug 21872)
<li>Fixed incorrect viewport clamping (lower bound is zero, not one)
<li>GLX fix for glean's makeCurrent test case
</ul>
<h2>Driver Status</h2>
<pre>
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 2.1
OSMesa (off-screen) implements OpenGL 2.1
Windows/Win32 implements OpenGL 2.1
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA unsupported
Wind River UGL unsupported
DJGPP unsupported
GGI unsupported
BeOS unsupported
Allegro unsupported
D3D unsupported
</pre>
</body>
</html>

68
docs/relnotes-7.4.4.html Normal file
View File

@ -0,0 +1,68 @@
<HTML>
<TITLE>Mesa Release Notes</TITLE>
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
<BODY>
<body bgcolor="#eeeeee">
<H1>Mesa 7.4.4 Release Notes / 23 June 2009</H1>
<p>
Mesa 7.4.4 is a stable development release fixing bugs since the 7.4.3 release.
</p>
<p>
Mesa 7.4.4 implements the OpenGL 2.1 API, but the version reported by
glGetString(GL_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 2.1.
</p>
<p>
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
for DRI hardware acceleration.
</p>
<h2>MD5 checksums</h2>
<pre>
0b56fe5a88ab0c3c5b2da5068f63f416 MesaLib-7.4.4.tar.gz
b66528d314c574dccbe0ed963cac5e93 MesaLib-7.4.4.tar.bz2
2818076f3ba23fa87fdfe4602a637a18 MesaLib-7.4.4.zip
3e77b208386c47b18165bce5ae317e2c MesaDemos-7.4.4.tar.gz
628142ec9a54cd28cc027e6ce26cff47 MesaDemos-7.4.4.tar.bz2
d08a30d30ab7174859aa709cba6c726d MesaDemos-7.4.4.zip
e6e91ba16e274d40cf3a97ad3218af01 MesaGLUT-7.4.4.tar.gz
e14bbb52517e8121b31f1387515365ab MesaGLUT-7.4.4.tar.bz2
f10ed20469753c2b3d68c99854f80fd4 MesaGLUT-7.4.4.zip
</pre>
<h2>Bug fixes</h2>
<ul>
<li>Fixed i965/i915 segfault in screen destruction (bug 22408)
</ul>
<h2>Driver Status</h2>
<pre>
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 2.1
OSMesa (off-screen) implements OpenGL 2.1
Windows/Win32 implements OpenGL 2.1
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA unsupported
Wind River UGL unsupported
DJGPP unsupported
GGI unsupported
BeOS unsupported
Allegro unsupported
D3D unsupported
</pre>
</body>
</html>

View File

@ -68,6 +68,8 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
<li>GL_EXT_texture_swizzle extension (software drivers, i965 driver)
<li>Updated SPARC assembly optimizations (David S. Miller)
<li>Initial support for separate compilation units in GLSL compiler.
<li>Increased max number of generic GLSL varying variables to 16 (formerly 8).
<li>GLSL linker now detects when too many varying variables are used.
</ul>
@ -75,6 +77,7 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
<ul>
<li>Lots of i965 driver bug fixes
<li>Fixed some GLSL preprocessor bugs
<li>GLSL: continue inside of a for-loop didn't work
</ul>

View File

@ -8,13 +8,6 @@
<H1>Release Notes</H1>
<p>
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.5) designate new developmental releases.
Even numbered versions (such as 6.4) designate stable releases.
</p>
<p>
The release notes summarize what's new or changed in each Mesa release.
</p>
@ -22,6 +15,8 @@ The release notes summarize what's new or changed in each Mesa release.
<UL>
<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
<LI><A HREF="relnotes-7.4.4.html">7.4.4 release notes</A>
<LI><A HREF="relnotes-7.4.3.html">7.4.3 release notes</A>
<LI><A HREF="relnotes-7.4.2.html">7.4.2 release notes</A>
<LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A>
<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>

View File

@ -583,10 +583,14 @@ ParseOptions(int argc, char *argv[])
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-fs") == 0) {
FragProgFile = argv[i+1];
FragProgFile = argv[++i];
}
else if (strcmp(argv[i], "-vs") == 0) {
VertProgFile = argv[i+1];
VertProgFile = argv[++i];
}
else {
fprintf(stderr, "unknown option %s\n", argv[i]);
break;
}
}
}

66
scons/dxsdk.py Normal file
View File

@ -0,0 +1,66 @@
"""dxsdk
Tool-specific initialization for Microsoft DirectX SDK
"""
#
# Copyright (c) 2009 VMware, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
import os
import os.path
import SCons.Errors
import SCons.Util
def get_dxsdk_root(env):
try:
return os.environ['DXSDK_DIR']
except KeyError:
return None
def get_dxsdk_paths(env):
dxsdk_root = get_dxsdk_root(env)
if dxsdk_root is None:
raise SCons.Errors.InternalError, "DirectX SDK not found"
if env['machine'] in ('generic', 'x86'):
target_cpu = 'x86'
elif env['machine'] == 'x86_64':
target_cpu = 'x64'
else:
raise SCons.Errors.InternalError, "Unsupported target machine"
include_dir = 'Include'
env.Append(CPPDEFINES = [('HAVE_DXSDK', '1')])
env.Prepend(CPPPATH = [os.path.join(dxsdk_root, 'Include')])
env.Prepend(LIBPATH = [os.path.join(dxsdk_root, 'Lib', target_cpu)])
def generate(env):
get_dxsdk_paths(env)
def exists(env):
return get_dxsdk_root(env) is not None
# vim:set ts=4 sw=4 et:

View File

@ -319,74 +319,78 @@ def generate(env):
env.Append(CPPDEFINES = cppdefines)
# C compiler options
cflags = []
cflags = [] # C
cxxflags = [] # C++
ccflags = [] # C & C++
if gcc:
if debug:
cflags += ['-O0', '-g3']
ccflags += ['-O0', '-g3']
elif env['toolchain'] == 'crossmingw':
cflags += ['-O0', '-g3'] # mingw 4.2.1 optimizer is broken
ccflags += ['-O0', '-g3'] # mingw 4.2.1 optimizer is broken
else:
cflags += ['-O3', '-g3']
ccflags += ['-O3', '-g3']
if env['profile']:
cflags += ['-pg']
ccflags += ['-pg']
if env['machine'] == 'x86':
cflags += [
ccflags += [
'-m32',
#'-march=pentium4',
'-mmmx', '-msse', '-msse2', # enable SIMD intrinsics
#'-mfpmath=sse',
]
if env['machine'] == 'x86_64':
cflags += ['-m64']
ccflags += ['-m64']
# See also:
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
cflags += [
'-Werror=declaration-after-statement',
ccflags += [
'-Wall',
'-Wmissing-prototypes',
'-Wmissing-field-initializers',
'-Wpointer-arith',
'-Wno-long-long',
'-ffast-math',
'-std=gnu99',
'-fmessage-length=0', # be nice to Eclipse
]
cflags += [
'-Werror=declaration-after-statement',
'-Wmissing-prototypes',
'-std=gnu99',
]
if msvc:
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx
# - cl /?
if debug:
cflags += [
ccflags += [
'/Od', # disable optimizations
'/Oi', # enable intrinsic functions
'/Oy-', # disable frame pointer omission
'/GL-', # disable whole program optimization
]
else:
cflags += [
ccflags += [
'/O2', # optimize for speed
#'/fp:fast', # fast floating point
]
if env['profile']:
cflags += [
ccflags += [
'/Gh', # enable _penter hook function
'/GH', # enable _pexit hook function
]
cflags += [
ccflags += [
'/W3', # warning level
#'/Wp64', # enable 64 bit porting warnings
]
if env['machine'] == 'x86':
cflags += [
ccflags += [
#'/QIfist', # Suppress _ftol
#'/arch:SSE2', # use the SSE2 instructions
]
if platform == 'windows':
cflags += [
ccflags += [
# TODO
]
if platform == 'winddk':
cflags += [
ccflags += [
'/Zl', # omit default library name in .OBJ
'/Zp8', # 8bytes struct member alignment
'/Gy', # separate functions for linker
@ -405,7 +409,7 @@ def generate(env):
]
if platform == 'wince':
# See also C:\WINCE600\public\common\oak\misc\makefile.def
cflags += [
ccflags += [
'/Zl', # omit default library name in .OBJ
'/GF', # enable read-only string pooling
'/GR-', # disable C++ RTTI
@ -422,8 +426,9 @@ def generate(env):
# See http://scons.tigris.org/issues/show_bug.cgi?id=1656
env.EnsureSConsVersion(0, 98, 0)
env['PDB'] = '${TARGET.base}.pdb'
env.Append(CCFLAGS = ccflags)
env.Append(CFLAGS = cflags)
env.Append(CXXFLAGS = cflags)
env.Append(CXXFLAGS = cxxflags)
if env['platform'] == 'windows' and msvc:
# Choose the appropriate MSVC CRT

View File

@ -416,16 +416,18 @@ def generate(env):
# See also:
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
ccflags += [
'-Werror=declaration-after-statement',
'-Wall',
'-Wmissing-prototypes',
'-Wmissing-field-initializers',
'-Wpointer-arith',
'-Wno-long-long',
'-ffast-math',
'-std=gnu99',
'-fmessage-length=0', # be nice to Eclipse
]
cflags += [
'-Werror=declaration-after-statement',
'-Wmissing-prototypes',
'-std=gnu99',
]
if msvc:
# See also:
# - http://msdn.microsoft.com/en-us/library/19z1t1wy.aspx

View File

@ -86,6 +86,8 @@ cell_get_param(struct pipe_screen *screen, int param)
return 1; /* XXX not really true */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
return 0; /* XXX to do */
case PIPE_CAP_TGSI_CONT_SUPPORTED:
return 1;
default:
return 0;
}

View File

@ -87,6 +87,8 @@ softpipe_get_param(struct pipe_screen *screen, int param)
return 8; /* max 128x128x128 */
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return 13; /* max 4Kx4K */
case PIPE_CAP_TGSI_CONT_SUPPORTED:
return 1;
default:
return 0;
}

View File

@ -302,6 +302,7 @@ enum pipe_transfer_usage {
#define PIPE_CAP_TEXTURE_MIRROR_CLAMP 24
#define PIPE_CAP_TEXTURE_MIRROR_REPEAT 25
#define PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS 26
#define PIPE_CAP_TGSI_CONT_SUPPORTED 27
/**

View File

@ -71,6 +71,8 @@ int INTEL_DEBUG = (0);
#define DRIVER_DATE_GEM "GEM " DRIVER_DATE
static void intel_flush(GLcontext *ctx, GLboolean needs_mi_flush);
static const GLubyte *
intelGetString(GLcontext * ctx, GLenum name)
{
@ -397,6 +399,15 @@ intel_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
return;
if (!intel->internal_viewport_call && ctx->DrawBuffer->Name == 0) {
/* If we're rendering to the fake front buffer, make sure all the pending
* drawing has landed on the real front buffer. Otherwise when we
* eventually get to DRI2GetBuffersWithFormat the stale real front
* buffer contents will get copied to the new fake front buffer.
*/
if (intel->is_front_buffer_rendering) {
intel_flush(ctx, GL_FALSE);
}
intel_update_renderbuffers(driContext, driContext->driDrawablePriv);
if (driContext->driDrawablePriv != driContext->driReadablePriv)
intel_update_renderbuffers(driContext, driContext->driReadablePriv);

View File

@ -2049,6 +2049,7 @@ struct gl_shader_state
struct gl_shader_program *CurrentProgram; /**< The user-bound program */
/** Driver-selectable options: */
GLboolean EmitHighLevelInstructions; /**< IF/ELSE/ENDIF vs. BRA, etc. */
GLboolean EmitContReturn; /**< Emit CONT/RET opcodes? */
GLboolean EmitCondCodes; /**< Use condition codes? */
GLboolean EmitComments; /**< Annotated instructions */
void *MemPool;

View File

@ -402,6 +402,7 @@ _mesa_init_shader_state(GLcontext * ctx)
* are generated by the GLSL compiler.
*/
ctx->Shader.EmitHighLevelInstructions = GL_TRUE;
ctx->Shader.EmitContReturn = GL_TRUE;
ctx->Shader.EmitCondCodes = GL_FALSE;
ctx->Shader.EmitComments = GL_FALSE;
ctx->Shader.Flags = get_shader_flags();

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,9 @@
#include "slang_compile.h"
#define MAX_LOOP_DEPTH 30
typedef struct slang_assemble_ctx_
{
slang_atom_pool *atoms;
@ -39,11 +42,19 @@ typedef struct slang_assemble_ctx_
struct gl_sl_pragmas *pragmas;
slang_var_table *vartable;
slang_info_log *log;
struct slang_label_ *curFuncEndLabel;
struct slang_ir_node_ *CurLoop;
/* current loop stack */
const slang_operation *LoopOperStack[MAX_LOOP_DEPTH];
struct slang_ir_node_ *LoopIRStack[MAX_LOOP_DEPTH];
GLuint LoopDepth;
/* current function */
struct slang_function_ *CurFunction;
GLuint UnrollLoop;
struct slang_label_ *curFuncEndLabel;
GLboolean UseReturnFlag;
GLboolean UnresolvedRefs;
GLboolean EmitContReturn;
} slang_assemble_ctx;

View File

@ -1953,6 +1953,7 @@ static int
parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
const slang_fully_specified_type * type)
{
GET_CURRENT_CONTEXT(ctx); /* a hack */
slang_variable *var;
slang_atom a_name;
@ -2066,6 +2067,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
A.vartable = O->vartable;
A.log = C->L;
A.curFuncEndLabel = NULL;
A.EmitContReturn = ctx->Shader.EmitContReturn;
if (!_slang_codegen_global_variable(&A, var, C->type))
RETURN0;
}
@ -2430,6 +2432,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
A.program = o.program;
A.pragmas = &shader->Pragmas;
A.vartable = o.vartable;
A.EmitContReturn = ctx->Shader.EmitContReturn;
A.log = C->L;
/* main() takes no parameters */

View File

@ -119,11 +119,13 @@ slang_operation_copy(slang_operation * x, const slang_operation * y)
if (!slang_operation_construct(&z))
return GL_FALSE;
z.type = y->type;
z.children = (slang_operation *)
_slang_alloc(y->num_children * sizeof(slang_operation));
if (z.children == NULL) {
slang_operation_destruct(&z);
return GL_FALSE;
if (y->num_children > 0) {
z.children = (slang_operation *)
_slang_alloc(y->num_children * sizeof(slang_operation));
if (z.children == NULL) {
slang_operation_destruct(&z);
return GL_FALSE;
}
}
for (z.num_children = 0; z.num_children < y->num_children;
z.num_children++) {
@ -152,6 +154,15 @@ slang_operation_copy(slang_operation * x, const slang_operation * y)
return GL_FALSE;
}
}
/* update scoping for children */
for (i = 0; i < y->num_children; i++) {
if (y->children[i].locals &&
y->children[i].locals->outer_scope == y->locals) {
z.children[i].locals->outer_scope = z.locals;
}
}
#if 0
z.var = y->var;
z.fun = y->fun;
@ -198,6 +209,20 @@ slang_operation_delete(slang_operation *oper)
}
void
slang_operation_free_children(slang_operation *oper)
{
GLuint i;
for (i = 0; i < slang_oper_num_children(oper); i++) {
slang_operation *child = slang_oper_child(oper, i);
slang_operation_destruct(child);
}
_slang_free(oper->children);
oper->children = NULL;
oper->num_children = 0;
}
slang_operation *
slang_operation_grow(GLuint *numChildren, slang_operation **children)
{
@ -263,6 +288,26 @@ slang_operation_insert(GLuint *numElements, slang_operation **array,
}
/**
* Add/insert new child into given node at given position.
* \return pointer to the new child node
*/
slang_operation *
slang_operation_insert_child(slang_operation *oper, GLuint pos)
{
slang_operation *newOp;
newOp = slang_operation_insert(&oper->num_children,
&oper->children,
pos);
if (newOp) {
newOp->locals->outer_scope = oper->locals;
}
return newOp;
}
void
_slang_operation_swap(slang_operation *oper0, slang_operation *oper1)
{
@ -272,3 +317,16 @@ _slang_operation_swap(slang_operation *oper0, slang_operation *oper1)
}
void
slang_operation_add_children(slang_operation *oper, GLuint num_children)
{
GLuint i;
assert(oper->num_children == 0);
assert(oper->children == NULL);
oper->num_children = num_children;
oper->children = slang_operation_new(num_children);
for (i = 0; i < num_children; i++) {
oper->children[i].locals = _slang_variable_scope_new(oper->locals);
}
}

View File

@ -42,6 +42,7 @@ typedef enum slang_operation_type_
SLANG_OPER_CONTINUE, /* "continue" statement */
SLANG_OPER_DISCARD, /* "discard" (kill fragment) statement */
SLANG_OPER_RETURN, /* "return" [expr] */
SLANG_OPER_RETURN_INLINED, /* "return" [expr] from inlined function */
SLANG_OPER_LABEL, /* a jump target */
SLANG_OPER_EXPRESSION, /* [expr] */
SLANG_OPER_IF, /* "if" [0] then [1] else [2] */
@ -150,6 +151,9 @@ slang_operation_new(GLuint count);
extern void
slang_operation_delete(slang_operation *oper);
extern void
slang_operation_free_children(slang_operation *oper);
extern slang_operation *
slang_operation_grow(GLuint *numChildren, slang_operation **children);
@ -157,8 +161,66 @@ extern slang_operation *
slang_operation_insert(GLuint *numChildren, slang_operation **children,
GLuint pos);
extern slang_operation *
slang_operation_insert_child(slang_operation *oper, GLuint pos);
extern void
_slang_operation_swap(slang_operation *oper0, slang_operation *oper1);
extern void
slang_operation_add_children(slang_operation *oper, GLuint num_children);
/** Return number of children of given node */
static INLINE GLuint
slang_oper_num_children(const slang_operation *oper)
{
return oper->num_children;
}
/** Return child of given operation node */
static INLINE slang_operation *
slang_oper_child(slang_operation *oper, GLuint child)
{
assert(child < oper->num_children);
return &oper->children[child];
}
/** Return child of given operation node, const version */
static INLINE const slang_operation *
slang_oper_child_const(const slang_operation *oper, GLuint child)
{
assert(child < oper->num_children);
return &oper->children[child];
}
/** Init oper to a boolean literal. */
static INLINE void
slang_operation_literal_bool(slang_operation *oper, GLboolean value)
{
oper->type = SLANG_OPER_LITERAL_BOOL;
oper->literal[0] =
oper->literal[1] =
oper->literal[2] =
oper->literal[3] = (float) value;
oper->literal_size = 1;
}
/** Init oper to an int literal. */
static INLINE void
slang_operation_literal_int(slang_operation *oper, GLint value)
{
oper->type = SLANG_OPER_LITERAL_INT;
oper->literal[0] =
oper->literal[1] =
oper->literal[2] =
oper->literal[3] = (float) value;
oper->literal_size = 1;
}
#endif /* SLANG_COMPILE_OPERATION_H */

View File

@ -39,6 +39,7 @@ typedef struct slang_variable_
GLuint array_len; /**< only if type == SLANG_SPEC_ARRAy */
struct slang_operation_ *initializer; /**< Optional initializer code */
GLuint size; /**< Variable's size in bytes */
GLboolean is_global;
GLboolean isTemp; /**< a named temporary (__resultTmp) */
GLboolean declared; /**< for debug */
struct slang_ir_storage_ *store; /**< Storage for this var */

View File

@ -261,6 +261,7 @@ slang_print_tree(const slang_operation *op, int indent)
break;
case SLANG_OPER_BLOCK_NEW_SCOPE:
case SLANG_OPER_NON_INLINED_CALL:
spaces(indent);
printf("{{ // new scope locals=%p outer=%p: ",
(void *) op->locals,
@ -348,6 +349,13 @@ slang_print_tree(const slang_operation *op, int indent)
slang_print_tree(&op->children[0], indent + 3);
break;
case SLANG_OPER_RETURN_INLINED:
spaces(indent);
printf("RETURN_INLINED\n");
if (op->num_children > 0)
slang_print_tree(&op->children[0], indent + 3);
break;
case SLANG_OPER_LABEL:
spaces(indent);
printf("LABEL %s\n", (char *) op->a_id);
@ -478,7 +486,7 @@ slang_print_tree(const slang_operation *op, int indent)
(void *) scope,
(void *) op->locals,
(void *) op->locals->outer_scope);
assert(scope);
/*assert(scope);*/
}
}
break;

View File

@ -120,6 +120,11 @@ void st_init_limits(struct st_context *st)
c->MaxDrawBuffers
= CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
1, MAX_DRAW_BUFFERS);
/* Is TGSI_OPCODE_CONT supported? */
/* XXX separate query for early function return? */
st->ctx->Shader.EmitContReturn =
screen->get_param(screen, PIPE_CAP_TGSI_CONT_SUPPORTED);
}