Michel Dänzer [Fri, 2 Nov 2012 14:57:30 +0000 (15:57 +0100)]
radeonsi: Implement alpha testing in pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Michel Dänzer [Wed, 7 Nov 2012 16:33:08 +0000 (17:33 +0100)]
radeonsi: Initialize uses_kill boolean from TGSI info.
Fixes discarded pixels incorrectly updating the depth buffer.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Vincent Lejeune [Sun, 4 Nov 2012 22:04:30 +0000 (23:04 +0100)]
glsl: store read vector in a temp in vec_index_to_cond
Vector indexing on matrixes generates several copy of the
constant matrix, for instance vec=mat4[i][j] generates :
vec=mat4[i].x;
vec=(j==1)?mat4[i].y;
vec=(j==2)?mat4[i].z;
vec=(j==3)?mat4[i].w;
In the case of constant matrixes, the mat4[i] expression generates
copy of the 16 elements of the matrix 4 times ; indirect addressing
also prevents some conservative CSE algorithms (like the one in LLVM)
from factoring the mat4[i] expression.
This patch will make the vec_index_to_cond pass generates :
temp = mat4[i];
vec=temp.x;
vec=(j==1)?temp.y;
vec=(j==2)?temp.z;
vec=(j==3)?temp.w;
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Marek Olšák [Sun, 11 Nov 2012 12:33:01 +0000 (13:33 +0100)]
gallium/u_blitter: handle PIPE_TEXTURE_CUBE_ARRAY in is_box_inside_resource
Andreas Boll [Sat, 10 Nov 2012 16:58:49 +0000 (17:58 +0100)]
build: fix enable/disable language in ./configure --help
Based on patch from Brian Paul.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Kenneth Graunke [Thu, 8 Nov 2012 12:13:26 +0000 (04:13 -0800)]
i965: Fix AA Line Distance Mode in 3DSTATE_SF on Ivybridge.
We were accidentally setting bit 14 in DWord 2 (which is Reserved/MBZ)
rather than bit 14 in DWord 3 (which is AA Line Distance Mode).
There's also no reason to ever set it to legacy mode; the bit is only
used when drawing antialiased lines anyway. Set it unconditionally.
NOTE: This is a candidate for stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Tue, 30 Oct 2012 23:55:37 +0000 (16:55 -0700)]
dri_util: Fix prologue comment for driCreateConfigs
The parameters and operation of this function changed, but I didn't
bother to change the prologue comment.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Ian Romanick [Tue, 30 Oct 2012 17:38:54 +0000 (10:38 -0700)]
swrast: swrastFillInModes doesn't do 8-bit modes, so don't try
Support for 8-bit modes was removed in commits
0398a26 and
bda208a4.
However, I didn't notice code in dri_init_screen that explicitly tries
to create this modes. This is structurally different from other drivers
(that only create modes that match the display color depth).
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56555
Cc: Vinson Lee <vlee@freedesktop.org>
Darren Salt [Mon, 5 Nov 2012 21:26:47 +0000 (21:26 +0000)]
Fix use of glsl_parser.{cc,h} where source dir != build dir.
Fixes a regression caused by commit
9948a3365.
https://bugs.freedesktop.org/show_bug.cgi?id=56787
https://bugs.freedesktop.org/show_bug.cgi?id=56685
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Fri, 9 Nov 2012 21:35:07 +0000 (14:35 -0700)]
Revert "mesa: assert that key->fragprog_inputs_read value isn't too large"
This reverts commit
0d61f879a1f2e6bb37368731a29d5267e1c25195.
Assigning the FS inputs to the 12 bit field is fine since we don't care
about the higher FS inputs. Maybe I'll revisit silencing the compiler
warning another day.
Matt Turner [Wed, 7 Nov 2012 21:58:14 +0000 (13:58 -0800)]
glcpp: wire up glcpp-test to make check
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 7 Nov 2012 00:24:32 +0000 (16:24 -0800)]
glcpp/tests: Add tests for multiline #elif
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 7 Nov 2012 00:24:10 +0000 (16:24 -0800)]
glcpp/tests: Add test for multiline #if
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Wed, 7 Nov 2012 00:16:02 +0000 (16:16 -0800)]
glcpp/tests: Add test for multiline #line
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 6 Nov 2012 23:36:15 +0000 (15:36 -0800)]
glcpp/tests: Add test to check #line followed by code
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51802
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fabian Bieler [Tue, 24 Jul 2012 13:36:46 +0000 (15:36 +0200)]
glcpp: don't push #line directives into next line
By moving the HASH_LINE rule out of control_line: and into line:, we avoid
adding control_line's additional \n (as seen in the first hunk).
mattst88: Carl and I determined independently of Fabian that the 091
test needed to be modified identically to this, and our patch to fix the
test was more complicated.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 6 Nov 2012 18:59:30 +0000 (10:59 -0800)]
glcpp: Reject garbage after #else and #endif tokens
Previously we were accepting garbage after #else and #endif tokens when
the previous preprocessor conditional evaluated to false (eg, #if 0).
When the preprocessor hits a false conditional, it switches the lexer
into the SKIP state, in which it ignores non-control tokens. The parser
pops the SKIP state off the stack when it reaches the associated #elif,
#else, or #endif. Unfortunately, that meant that it only left the SKIP
state after the lexing the entire line containing the #token and thus
would accept garbage after the #token.
To fix this we use a mid-rule, which is executed immediately after the
#token is parsed.
NOTE: This is a candidate for the stable branch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56442
Fixes: preprocess17_frag.test from oglconform
Reviewed-by: Carl Worth <cworth@cworth.org> (glcpp-parse.y)
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Dave Airlie [Fri, 9 Nov 2012 20:38:57 +0000 (06:38 +1000)]
r600g: fix printk warnings
Brian reported seeing:
r600_texture.c: In function ‘r600_texture_create_object’:
r600_texture.c:468:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
r600_texture.c:468:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’
r600_texture.c:485:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
r600_texture.c:485:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’
this should wrap over them fine.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 9 Nov 2012 20:36:10 +0000 (06:36 +1000)]
softpipe: fix unused variable warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 9 Nov 2012 20:34:14 +0000 (06:34 +1000)]
gallium: fix unused cap warnings in drivers for cube map array cap.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:53:33 +0000 (20:53 +1000)]
r600g: add initial cube map array support (v2)
This contains the evergreen support.
Support is possible on rv670 upwards and the code in here
should work, but it doesn't and I haven't debugged it to
figure out why.
Beyond just adding support for the cube map array sampling,
r600 resinfo isn't conformant with the GL specification,
which states the number of layers should be returned for
the textureSize, so we have to track in an external
constant buffer the layers for each sampler if we need
them in the shader.
v2: only update the sampler constants if the sampler views have changed,
as suggested by Marek.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Fri, 9 Nov 2012 20:19:19 +0000 (06:19 +1000)]
u_blitter: fix cube array check
Pointed out by Marek on irc,
no committing after beer!
Signed-off-by: Dave Airlie <airlied@redhat.com>
José Fonseca [Wed, 7 Nov 2012 15:21:36 +0000 (15:21 +0000)]
util/u_surface: Support 3D/array textures in util_resource_copy_region().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Wed, 7 Nov 2012 14:19:55 +0000 (14:19 +0000)]
draw: Remove redundant draw_geometry_shader_delete().
draw_delete_geometry_shader() seems to be the real one.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Wed, 7 Nov 2012 14:19:25 +0000 (14:19 +0000)]
trace: Support geometry shaders.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Wed, 7 Nov 2012 12:57:15 +0000 (12:57 +0000)]
util/u_surface: Fix util_clear_depth_stencil for Z32_FLOAT_S8X24_UINT.
util_pack_z_stencil was being unconditionally invoked for all formats,
causing an assertion failure for Z32_FLOAT_S8X24_UINT.
NOTE: Candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Wed, 7 Nov 2012 11:45:45 +0000 (11:45 +0000)]
galahad: Support geometry shader / stream-output methods.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Tue, 6 Nov 2012 17:20:09 +0000 (17:20 +0000)]
softpipe,util: Fix blending of R and RG formats.
Alpha is also 1 for formats like R32G32_FLOAT.
NOTE: Candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Tue, 6 Nov 2012 15:59:41 +0000 (15:59 +0000)]
softpipe: Fix rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE.
We must multiply the factor against the destination, not the source.
NOTE: Candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Tue, 6 Nov 2012 11:38:12 +0000 (11:38 +0000)]
tgsi: Lift the requirement of indirection being done by ADDR register.
For drivers with native integer / SM4 support this is just an hindrance.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Tue, 6 Nov 2012 11:36:09 +0000 (11:36 +0000)]
util: Fix reduction of line adjacency primitives.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Tue, 6 Nov 2012 11:35:31 +0000 (11:35 +0000)]
softpipe: Handle adjacency primitives.
Not fully tested.
Based on diagrams from
http://msdn.microsoft.com/en-us/library/windows/desktop/
bb205124.aspx#Primitive_Adjacency
v2: Fix based on Brian's feedback.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
José Fonseca [Mon, 5 Nov 2012 15:45:48 +0000 (15:45 +0000)]
util/u_rect: Make it C++ safe.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Dave Airlie [Fri, 9 Nov 2012 10:31:00 +0000 (20:31 +1000)]
u_blitter: don't create fragment program for cube maps unless supported.
should fix http://bugs.freedesktop.org/56906
Signed-off-by: Dave Airlie <airlied@redhat.com>
Mario Kleiner [Sun, 7 Oct 2012 01:44:14 +0000 (03:44 +0200)]
mesa: Don't glPopAttrib() GL_POINT_SPRITE_COORD_ORIGIN on < OpenGL-2.0
The GL_POINT_BIT state attribute GL_POINT_SPRITE_COORD_ORIGIN
is only supported on OpenGL-2.0 or later. Prevent glPopAttrib()
from trying to restore it on OpenGL-1.4 implementations which
support GL_ARB_POINT_SPRITE, as otherwise the sequence...
glPushAttrib(GL_POINT_BIT);
glPopAttrib();
throws an GL_INVALID_ENUM error in glPopAttrib().
See also commit
f778174ea1e431a7113f12c12beb4aba9e825a9f
NOTE: This is a candidate for the 9.0 branch.
Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Kenneth Graunke [Thu, 8 Nov 2012 04:29:40 +0000 (20:29 -0800)]
mesa: Fix glGetVertexAttribI[u]iv now that we have real integer attribs.
Since
cf438f5375e242, we store actual integers for the attribute data.
We just need to reinterpret the GLfloat array as a GLint/GLuint array
so we can read the proper data.
Fixes oglconform's glsl-vertex-attrib/basic.VertexAttribI[1234][u]i
subtests (after fixing an unrelated bug in those test cases).
v2: Use the COPY_4V macro to be concise.
NOTE: This is a candidate for the stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com> [v1]
Kenneth Graunke [Thu, 8 Nov 2012 02:54:40 +0000 (18:54 -0800)]
mesa: Fix typo in glDeleteQueriesARB debug message.
"Deleete" all the extra letters!
Vinson Lee [Thu, 8 Nov 2012 07:13:38 +0000 (23:13 -0800)]
svga: Fix memory leak in svga_buffer_transfer_map.
Fixes resource leak defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Dave Airlie [Fri, 9 Nov 2012 00:57:04 +0000 (10:57 +1000)]
docs: update with ARB_texture_cube_map_array support
just mention softpipe is done, r600g will come soon.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:52:49 +0000 (20:52 +1000)]
u_blitter: add cube map array support.
This adds cube array support to the blitter.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:51:45 +0000 (20:51 +1000)]
softpipe: add ARB_texture_cube_map_array support (v1.1)
This adds support to the softpipe texture sampler and tgsi exec.
In order to handle the extra input to the texture sampling,
I've had to expand the interfaces to take a c1 value for storing
the texture compare value for the TEX2 case.
v1.1: add comments (Brian)
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:49:35 +0000 (20:49 +1000)]
st/mesa: add support for ARB_texture_cube_map_array (v2)
This adds mesa state tracker support for the new extension,
along with glsl->tgsi conversion to use the new opcodes
where appropriate.
v2: fix assert found running textureSize tests.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:44:06 +0000 (20:44 +1000)]
gallium: add defines/shader opcode for texture cube map array
This just adds the texture target and capability along
with 3 new opcodes required to support this extension.
As this extension requires some texture opcodes with samp + 5 args,
we need to use another src register, this is only required
for TEX, TXL and TXB opcodes to implement this spec.
TEX2 is required for shadow cube map arrays
TXL2 is required for cube map array sampler + explicit lod
TXB2 is required for cube map array sampler + lod bias
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Wed, 7 Nov 2012 02:51:35 +0000 (12:51 +1000)]
mesa: arb_texture_cube_map_array: fix attrib push/pop
fdo9833 piglit test caught this.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:43:17 +0000 (20:43 +1000)]
glsl: add ARB_texture_cube_map_array support (v2)
This adds all the new builtins + the new sampler types,
and hooks them up if the extension is supported.
v2: fix missing signatures for grad/lod
fix missing textureSize clarifications
fix compare vs starts with usage
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:41:55 +0000 (20:41 +1000)]
mesa: add get support for TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:41:08 +0000 (20:41 +1000)]
mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)
This adds the mesa core + texture + fbo support for the
texture cube map array extension.
v2:
add comment to _mesa_num_tex_faces related to cube map arrays (Brian)
drop wrong comment cut-n-paste (Brian)
fix / 6 maximum check issue (Kenneth)
coalsece some array case statements (Kenneth)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:38:32 +0000 (20:38 +1000)]
mesa: add ARB_texture_cube_map_array extension bits
This just adds the bit + extension name.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 3 Nov 2012 10:36:21 +0000 (20:36 +1000)]
glapi: add ARB_texture_cube_map_array.
This adds the ARB_texture_cube_map_array enums.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 6 Nov 2012 21:51:56 +0000 (07:51 +1000)]
r600g: fix lod bias/explicit lod with cube maps.
While developing cube map array support I found that we didn't
support this properly, also piglit didn't test for it at all.
I've submitted a test to piglit to check for this, and this
fixes explicit lod and lod bias with cube maps.
NOTE: This is a candidate for the 9.0 branch.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 6 Nov 2012 05:31:41 +0000 (15:31 +1000)]
r600g: clarify const buffer numbering and handling
For cube map arrays I'll need another driver private constant
buffer, and looking forward to UBOs. So clean up with some
defines, that can be modified when adding cube map array and ubos
later.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Eric Anholt [Tue, 6 Nov 2012 17:48:51 +0000 (09:48 -0800)]
i965: Fix slow leak of brw->wm.compile_data->store
We were successfully freeing our compile data at context destroy, but until
then we were allocating a new store every compile without freeing it.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56019
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Tue, 30 Oct 2012 18:09:59 +0000 (11:09 -0700)]
i965/fs: Add support for global copy propagation.
It is common for complicated shaders, particularly code-generated ones, to
have a big array of uniforms or attributes, and a prologue in the shader that
dereferences from the big array to more informatively-named local variables.
Then there will be some small control flow operation (like a ? : statement),
and then use of those informatively-named variables. We were emitting extra
MOVs in these cases, because copy propagation couldn't reach across control
flow.
Instead, implement dataflow analysis on the output of the first copy
propagation pass and re-run it to propagate those extra MOVs out.
On one future Steam release, reduces VS+FS instruction count from 42837 to
41437. No statistically significant performance difference (n=48), though, at
least at the low resolution I'm running it at.
shader-db results:
total instructions in shared programs: 722170 -> 702545 (-2.72%)
instructions in affected programs: 260618 -> 240993 (-7.53%)
Some shaders do get hurt by up to 2 instructions, because a choice to copy
propagate instead of coalesce or something like that results in a dead write
sticking around. Given that we already have instances of those instructions
in the affected programs (particularly unigine), we should just improve dead
code elimination to fix the problem.
Dave Airlie [Sat, 1 Sep 2012 03:55:38 +0000 (13:55 +1000)]
glsl_to_tgsi: fix dst register for texturing fetches.
I've no idea why there isn't a piglit that triggers this behaviour,
but while enabling TBOs for softpipe and r600g, I noticed all the
integer tests failed. I tracked it back to the TXF returning a float
when it should be returning an int. This fixed it and I haven't
seen any regressions in a full piglit run on softpipe.
http://bugs.freedesktop.org/55010
NOTE: This is a candidate for the 9.0 branch.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Vincent Lejeune [Wed, 7 Nov 2012 16:17:58 +0000 (17:17 +0100)]
r600g: fix pre eg export with llvm
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Vinson Lee [Wed, 7 Nov 2012 07:37:20 +0000 (23:37 -0800)]
i965: Fix assertion in brw_alu3.
Fixes side effect in assertion defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jonas Ådahl [Sat, 27 Oct 2012 22:50:12 +0000 (00:50 +0200)]
wayland: Destroy frame callback when destroying surface
If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.
This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().
Note: This is a candidate for stable branches.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Alex Deucher [Wed, 7 Nov 2012 16:30:45 +0000 (11:30 -0500)]
r600g/compute: fix call to r600_bytecode_init
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Kenneth Graunke [Tue, 16 Oct 2012 18:45:00 +0000 (11:45 -0700)]
mesa: Remove PROG_EMIT_VERTEX and PROG_END_PRIMITIVE opcodes.
These were only used for geometry shader support back in the days before
the new GLSL compiler. Future geometry shader support will not use
these.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Vinson Lee [Tue, 6 Nov 2012 06:27:41 +0000 (22:27 -0800)]
svga: Ensure vb_transfer in svga_swtnl_draw_vbo in initialized.
Fixes a uninitialized pointer read defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Vinson Lee [Wed, 7 Nov 2012 07:16:29 +0000 (23:16 -0800)]
scons: Build src/mesa/main/es1_conversion.c for all builds.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Fredrik Höglund [Tue, 6 Nov 2012 16:36:34 +0000 (17:36 +0100)]
egl_dri2/x11: Fix eglPostSubBufferNV()
This got broken in commit
0a523a8820e8a2549ac1c7887eb1892b228af44b.
NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
Paul Berry [Wed, 31 Oct 2012 21:13:16 +0000 (14:13 -0700)]
dispatch: Delete unused init_dispatch functions.
The new code-generated version of _mesa_create_exec_table() populates
the entire dispatch table (except for dynamic functions) by itself; it
no longer calls separate functions to initialize parts of the dispatch
table. This patch removes those no-longer-needed functions.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Wed, 31 Oct 2012 17:42:08 +0000 (10:42 -0700)]
dispatch: Code generate api_exec.c.
This patch adjusts makefiles to cause src/mesa/main/api_exec.c to be
generated using src/mapi/glapi/gen/gl_genexec.py. There should be no
functional change.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 23:21:18 +0000 (16:21 -0700)]
glapi/gen: Add code generation script for _mesa_create_exec_table().
This script generates the file api_exec.c, which contains just the
function _mesa_create_exec_table(), based on the XML files in
src/mapi/glapi/gen.
The following XML attributes, in particular, are used:
- "es1" indicates functions that should be available in ES1 contexts.
- "es2" indicates functions that should be available in ES2/ES3
contexts.
- "exec" indicates which Mesa function should be dispatched to. E.g.
if the GL function is glFoo(), then:
- exec="mesa" (the default) dispatches to _mesa_Foo().
- exec="check" dispatches to _check_Foo().
- exec="es" dispatches to _es_Foo().
- exec="loopback" dispatches to loopback_Foo().
- exec="skip" or exec="dynamic" causes this function to be skipped;
either it is not yet supported ("skip"), or its dispatch table
entry will be dynamically populated based on GL state ("dynamic").
- "desktop" indicates functions that should be available in desktop GL
(non-ES) contexts.
- "deprecated" indicates functions that should not be available in
core contexts.
- "mesa_name" indicates functions whose implementation in Mesa has a
different suffix than the corresponding GL function name.
The generated code looks roughly like this (showing just a single
statement in each block for brevity):
struct _glapi_table *
_mesa_create_exec_table(struct gl_context *ctx)
{
struct _glapi_table *exec;
exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
if (exec == NULL)
return NULL;
if (_mesa_is_desktop_gl(ctx)) {
SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_BeginQueryARB(exec, _mesa_BeginQueryARB);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES) {
SET_GetPointerv(exec, _mesa_GetPointerv);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2) {
SET_AttachShader(exec, _mesa_AttachShader);
/* other functions not shown */
}
if (ctx->API == API_OPENGL) {
SET_Accum(exec, _mesa_Accum);
/* other functions not shown */
}
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
SET_AlphaFunc(exec, _mesa_AlphaFunc);
/* other functions not shown */
}
if (ctx->API == API_OPENGLES) {
SET_AlphaFuncxOES(exec, _es_AlphaFuncx);
/* other functions not shown */
}
return exec;
}
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 23:21:18 +0000 (16:21 -0700)]
glapi/gen: handle new XML attributes.
This patch updates gl_XML.py to parse the new XML attributes "exec",
"desktop", "deprecated", and "mesa_name", which will be needed to code
generate _mesa_create_exec_table().
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 23:21:18 +0000 (16:21 -0700)]
glapi/gen: Gather API version info across aliased functions.
gl_XML.py's gl_function class keeps track of an entry_point_api_map
property that tracks, for each set of aliased functions, which ES1 or
ES2 version the given function name first appeared in.
This patch aggregates that information together across aliased
functions, into an easier-to-use api_map property.
Future patches will use this information when code generating
_mesa_create_exec_table(), to determine which set of dispatch table
entries should be populated based on the API.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Wed, 31 Oct 2012 17:20:58 +0000 (10:20 -0700)]
glapi/gen: Comment fix.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 16:47:11 +0000 (09:47 -0700)]
dispatch: Make all API functions non-static.
Some of the functions that we store in the dispatch table are declared
as non-static in their .c files and are inserted into the dispatch
table directly by _mesa_create_exec_table(). Other functions are
declared as static, and are inserted into the dispatch table by a
dedicated function that lives in the same .c file
(e.g. _mesa_loopback_init_api_table() in api_loopback.c).
This patch makes all of these functions non-static, and creates
appropriate prototypes for them, so that in future patches we can
populate the entire dispatch table using a single code-generated
function.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 05:12:18 +0000 (22:12 -0700)]
glapi: Annotate XML with function name suffix anomalies.
When the XML lists one or more GL api functions as aliases for another
GL function, the mesa function that implements the functionality is
usually named after the canonical version of the function (the one
that is the target of the aliases). For example, FogCoordd is listed
as an alias of FogCoorddEXT, and the Mesa function implementing the
functionality is called loopback_FogCoorddEXT.
However, there are exceptions. For example, Enablei is listed as an
alias of EnableIndexedEXT, but the Mesa function implementing the
functionality is called _mesa_EnableIndexed.
To account for these anomalies, this patch annotates the XML with
"mesa_name" attributes, which describe how to adjust the function name
to find the corresponding Mesa function.
For example:
<function name="EnableIndexedEXT" mesa_name="-EXT">...</function>
<function name="IsProgramNV" mesa_name="-NV+ARB">...</function>
means that EnableIndexedEXT is implemented by a Mesa function called
_mesa_EnableIndexed, and IsProgramNV is implemented by a Mesa function
called _mesa_IsProgramARB.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine the name of the Mesa function
that should be stored in each dispatch table entry.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 04:00:25 +0000 (21:00 -0700)]
glapi: Annotate XML with desktop="false" for GLES-only functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped when the API is desktop GL.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Mon, 22 Oct 2012 23:49:24 +0000 (16:49 -0700)]
glapi: Annotate XML with exec="{es,check}" for special GLES1 functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to ES-specific implementations. exec="es" indicates that
the ES-specific implementation has a name beginning with "_es_"
(e.g. _es_QueryMatrixxOES), and exec="check" indicates that the
ES-specific implementation has a name beginning with "_check_"
(e.g. _check_GetTexGenxvOES).
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 05:13:14 +0000 (22:13 -0700)]
glapi: Annotate XML with exec="loopback" for loopback functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to functions in api_loopback.c.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 03:58:29 +0000 (20:58 -0700)]
glapi: Annotate XML with exec="dynamic" for dynamic functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because Mesa dispatches them differently depending on GL
state.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 03:53:11 +0000 (20:53 -0700)]
glapi: Annotate XML with exec="skip" for unimplemented functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because they aren't implemented by Mesa.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Mon, 15 Oct 2012 17:52:13 +0000 (10:52 -0700)]
glapi: Annotate XML with deprecated="3.1" for deprecated functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped in core contexts.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 04:00:50 +0000 (21:00 -0700)]
glapi: Mark GLX extensions as window_system="glX".
We were already doing this for some GLX extensions, but not others.
This patch makes our use of window_system="glX" consistent.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Wed, 17 Oct 2012 20:24:37 +0000 (13:24 -0700)]
glapi: Use GL_ or GLX_ prefix for all category names.
This patch standardizes the category names used in the glapi XML files
to begin each extension name with the prefix "GL_" or "GLX_". There
is no functional change, because these category names are not used in
the generated code.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 21:03:28 +0000 (14:03 -0700)]
dispatch: Remove a few FEATURE_ES1 conditionals.
This allows the GLES1.1 dispatch sanity test to be run on all builds,
even builds that do not include GLES1 support.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: assert that key->fragprog_inputs_read value isn't too large
fragprog_inputs_read is a 12-bit bitfield so check the assigned value.
MSVC warns on the assignment. Not easy to fix but let's do a sanity check.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix MSVC signed/unsigned warnings in context.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix MSVC signed/unsigned warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
swrast: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
tnl: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: silence MSVC signed/unsigned warning in texgetmage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: silence MSVC signed/unsigned warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
vbo: use GLuint for numInstances to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix signed/unsigned MSVC warnings in fbobject.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: s/GLint/GLuint/ in matrix.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: s/int/GLuint/ in get.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix assorted MSVC conversion warnings in format_pack.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
st/mesa: change glsl_to_tgsi_visitor from class to struct
To match the declaration in the .h file and silence an MSVC warning.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
st/mesa: add int cast to silence warning
MSVC warns that negating an unsigned value yields an unsigned value.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: fix signed/unsigned comparision warnings on MSVC
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: remove incorrect 'struct' keyword
ir_variable is a class, not a struct. Fixes an MSVC warning.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: add 'f' suffix to floats to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: change int->unsigned to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Vinson Lee [Tue, 6 Nov 2012 06:00:01 +0000 (22:00 -0800)]
scons: Require libdrm_radeon 2.4.40.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Marek Olšák [Tue, 2 Oct 2012 20:02:54 +0000 (22:02 +0200)]
r600g: add in-place DB decompression and texturing with DB tiling
The decompression is done in-place and only the compressed tiles are
decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F.
The texture unit is programmed to use non-displayable tiling and depth
ordering of samples, so that it can fetch the texture in the native DB format.
The latest version of the libdrm surface allocator is required for stencil
texturing to work. The old one didn't create the mipmap tree correctly.
We need a separate mipmap tree for stencil, because the stencil mipmap
offsets are not really depth offsets/4.
There are still some known bugs, but this should save some memory and it also
improves performance a little bit in Lightsmark (especially with low
resolutions; tested with Radeon HD 5000).
The DB->CB copy is still used for transfers.
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Marek Olšák [Tue, 6 Nov 2012 01:35:35 +0000 (02:35 +0100)]
configure.ac: require libdrm_radeon 2.4.40