Commit graph

38709 commits

Author SHA1 Message Date
Eric Anholt
5ecd9c70ce glsl: Add info about talloc and optimization passes to the README. 2010-09-08 18:09:05 -07:00
Eric Anholt
e04f90712d glsl: Update README talking about multi-instruction operations.
The previous thing taking multiple instructions ended up being handled
at the IR level, as we suggested would be the common result.  Pick a
new one.
2010-09-08 18:05:22 -07:00
Kristian Høgsberg
d8ab9aac54 glx: Destroy pixmap after destroying glx and dri drawables
Now that we suppress BadDrawable from DRI2DestroyDrawable, this doesn't
matter, but we would get that error before when destroying pbuffers.
2010-09-08 20:55:24 -04:00
Kristian Høgsberg
7b34fcc487 configure: Enable -fvisibility=hidden for g++ as well 2010-09-08 20:45:07 -04:00
Kenneth Graunke
7fc882643c glsl/builtins: Set the API in the fake context.
Otherwise it gets used uninitialized.
2010-09-08 17:38:42 -07:00
Ian Romanick
f69a6647fb glsl2: Clear out profile pointers in _mesa_glsl_release_functions
Otherwise builtin_profiles contains dangling pointers the next time
_mesa_read_profile is called.  I suspect this may fix bugzilla #29847,
but I was never able to reproduce it.
2010-09-08 17:16:49 -07:00
Ian Romanick
de1ffd2f62 mesa: Refactor parameter processing in set_combiner_(operand|source)
The enum values were chosen to have sequential values for a reason.
Use that to compact and simplify the code.
2010-09-08 16:26:15 -07:00
Ian Romanick
1a2d498b41 mesa: Fix handling of texenv operands for EXT vs ARB version
GL_EXT_texture_env_combine has slightly more restrictive limits on the
valid sources for some operands.  This wasn't caught before because
almost every driver in Mesa that supports the EXT version also
supports the ARB version.

Inspired by a patch posted the the mesa-dev mailing list by Andrew
Randrianasulu.
2010-09-08 16:26:07 -07:00
Kristian Høgsberg
f24ec6367b glx: Ignore DRI2 event for drawables we've destroyed
Since we now actually destroy GLX drawables, we get into situations where
we get events for drawables that no longer exist.  Just ignore the
event in that case.
2010-09-08 18:54:48 -04:00
Kristian Høgsberg
659dab6be6 glx: Fix use after free problem 2010-09-08 18:54:48 -04:00
Kenneth Graunke
fc1daab2a2 glsl: Fix for scalar float built-in definitions.
These need abs, and we need more tests.
2010-09-08 15:38:09 -07:00
Eric Anholt
c3db43df04 glsl: regenerate builtins 2010-09-08 15:01:02 -07:00
Eric Anholt
aa973d3533 glsl: Fix typo in builtin step() using a wrong channel. 2010-09-08 14:54:08 -07:00
Kenneth Graunke
368dc76f04 ir_validate: Ensure ir_binop_dot is only used on vector types. 2010-09-08 12:09:42 -07:00
Kenneth Graunke
4b2ffa0a42 glsl: Refresh automatically generated file builtin_function.cpp. 2010-09-08 12:09:42 -07:00
Kenneth Graunke
1f7e6e1e72 glsl/builtins: Don't use ir_binop_dot on floating point values.
ir_binop_dot is only defined for vector types.  Use ir_binop_mul.
2010-09-08 12:09:41 -07:00
Kenneth Graunke
84160a0454 glsl/builtins: Simplify degenerate scalar float cases.
The code being generated was just stupid, considering that:
- normalize(x) = 1.0
- length(x) = x
- distance(x, y) = x - y
2010-09-08 12:09:41 -07:00
Ian Romanick
961f42c9bd glsl2: Make sure _mesa_glsl_parse_state constructor gets a context
Fix an major regression in dc754586.  Too bad that change was
obviously never tested.
2010-09-08 11:34:22 -07:00
Kristian Høgsberg
16887d042a glx: Drop broken drawable garbage collection
Doesn't work for pixmaps, was looking up the GLX XID and was never thread
safe.  Instead, just destroy the client side structures when the
drawable is no long current for a context.
2010-09-08 09:20:42 -04:00
Kristian Høgsberg
b4bb668020 dri: Unset current context and dispatch table when unbinding
Otherwise, when we switch to an indirect glx context and then back, it looks
like we're still current.

https://bugs.freedesktop.org/show_bug.cgi?id=29977#c7
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-09-08 09:01:43 -04:00
Chia-I Wu
1a5b32ca01 glsl: Support GLSL ES in the standalone compile.
GLSL ES mode is enabled when --glsl-es is passed to glsl_compiler.
2010-09-08 04:08:29 -07:00
Chia-I Wu
dc754586ca glsl: Require a context in _mesa_glsl_parse_state.
Create a dummy context in the standalone compiler and pass it to
_mesa_glsl_parse_state.
2010-09-08 04:08:24 -07:00
Chia-I Wu
7e03e2b2c7 st/dri: Call dri_init_extensions only for API_OPENGL.
libmesagallium.a that this state tracker will be linked to expects
OpenGL's _glapi_table.  That is, it expects libGL.so instead of
libGLESv1_CM.so or libGLESv2.so.  As there is no clean way to know the
shared library the app links to, use the api as a simple check.  It
might be as well to simply remove this function call though.
2010-09-08 18:21:19 +08:00
Chia-I Wu
444d8408e7 st/dri: Use enum st_api_type internally. 2010-09-08 18:20:44 +08:00
nobled
8e3b658b7f st/dri: Add multi-api support
Make st/dri screens capable of creating OpenGL ES and
OpenGL ES2 contexts.

TODO: Figure out the "get_current" problem with multiple
st_api's for real.

(s/API_OPENGLES1/API_OPENGLES/ by Chia-I Wu)
2010-09-08 17:25:01 +08:00
nobled
ecd7ec9d62 st/dri: Make clear which API's are supported
If the caller requests a GLES context, don't silently create
a desktop GL context in its place.
2010-09-08 12:55:26 +08:00
Dave Airlie
bf346f065c r600g: add initial bank swizzle support.
this is ported from r600c mostly, bank swizzling is real messy and I don't think
I got enough sleep last night to fully understand it.
2010-09-08 14:12:21 +10:00
Kenneth Graunke
48e789d71e glcpp: Fix build on non-GCC compilers. 2010-09-07 18:01:33 -07:00
Kenneth Graunke
10eaa8bcbc ast_to_hir: Mark arrays as lvalues in GLSL ES, but prohibit assignment.
This allows them to be passed as out/inout parameters, but still
prevents them from being used as the target of an assignment.  This is
per section 5.8 of the GLSL ES 1.00 specification.
2010-09-07 17:30:39 -07:00
Kenneth Graunke
a98d5a5ac8 glsl: Allow overloading of built-ins without hiding in GLSL ES.
The rules are explicitly different from desktop GLSL.
2010-09-07 17:30:39 -07:00
Kenneth Graunke
f412fac5b4 glsl: Move is_builtin flag back to ir_function_signature.
This effectively reverts b6f15869b3.

In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.

However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
c98deb18d5 ast_to_hir: Reject embedded structure definitions in GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
d8e34e29eb ast_to_hir: Reject unsized array declarations in GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
b4ec3f268c ast_to_hir: Allow matrix-from-matrix constructors in GLSL ES.
Everything but 1.10 supports this, so just change the check to ==.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
883ac22810 i965: Enable EXT_framebuffer_blit internally.
Otherwise, ES2's BindFramebuffer entrypoint hits this assertion:
main/fbobject.c:1323: _mesa_BindFramebufferEXT: Assertion
`ctx->Extensions.EXT_framebuffer_blit' failed.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
67da41c10c mesa: Enable GL_MAX_VERTEX_ATTRIBS in ES2.
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-07 17:30:38 -07:00
Kenneth Graunke
5a81d057db linker: Fix assertion and cross-version checks for version 100.
Fixes an assert (min_version >= 110) which was no longer correct, and
also prohibits linking ES2 shaders with non-ES2 shaders.  I'm not
positive this is correct, but the specification doesn't seem to say.
2010-09-07 17:30:38 -07:00
Kenneth Graunke
116dc670e9 glsl: Add built-in function profiles for GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
b4fe4d52b6 glsl: Add built-in variables for GLSL ES 1.00. 2010-09-07 17:30:38 -07:00
Kenneth Graunke
76deef138e glsl: Split out types that are in 1.10 but not GLSL ES 1.00. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
c5e74871d9 glsl: Recognize GLSL ES 1.00 keywords. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
7dcfc44b72 glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.
Also define it if #version 100 is encountered.
2010-09-07 17:30:37 -07:00
Kenneth Graunke
719caa403e glsl: Accept language version 100 and make it the default on ES2. 2010-09-07 17:30:37 -07:00
Kenneth Graunke
814c89abdb glsl: Set default language version in mesa_glsl_parse_state constructor.
This should make it easier to change the default version based on the
API (say, version 1.00 for OpenGL ES).

Also, synchronize the symbol table's version with the parse state's
version just before doing AST-to-HIR.  This way, it will be set when
it matters, but the main initialization code doesn't have to care about
the symbol table.
2010-09-07 17:30:37 -07:00
Eric Anholt
4a867be143 ir_to_mesa: Add support for gl_NormalScale.
Bug #30040.
2010-09-07 16:43:35 -07:00
Kenneth Graunke
a09a8ec12d glsl: Make sure shader source isn't NULL.
This should only occur if glCompileShader is called without a prior call
to glShaderSource.  An empty source program should be the empty string.
2010-09-07 16:25:53 -07:00
Tilman Sauerbeck
1e28dd4ebe r600g: Added missing r600_bc_add_literal() calls to XPD implementation.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:10:46 +10:00
Tilman Sauerbeck
460c5304ab r600g: Added preliminary support for the LOG opcode.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:10:07 +10:00
Tilman Sauerbeck
42c966bc49 r600g: Added missing abs-ification to RSQ.
This makes the 'fp1-RSQ test 2' piglit test work.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-09-08 09:07:02 +10:00
Dave Airlie
a3a94554f5 r600g: split opcodes out and add wrapper around usage.
This splits the r600 opcodes out of the sq file and adds a wrapper
so we can convert to evergreen opcodes later without touching these functions
too much.
2010-09-08 08:49:00 +10:00