Commit Graph

53632 Commits

Author SHA1 Message Date
Michel Dänzer 7708a86464 radeonsi: Implement alpha testing in pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-12 15:45:42 +01:00
Michel Dänzer e44dfd4b3c 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>
2012-11-12 15:45:42 +01:00
Vincent Lejeune 557d4918ad 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>
2012-11-11 22:20:15 +01:00
Marek Olšák 05a2f66cde gallium/u_blitter: handle PIPE_TEXTURE_CUBE_ARRAY in is_box_inside_resource 2012-11-11 13:33:01 +01:00
Andreas Boll 5ecbc3a9e8 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>
2012-11-10 21:32:09 +01:00
Kenneth Graunke e639385064 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>
2012-11-10 12:14:23 -08:00
Ian Romanick 5581954c3a 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>
2012-11-09 18:38:19 -08:00
Ian Romanick 3ec3201f31 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>
2012-11-09 18:38:19 -08:00
Darren Salt d2a6dd9a95 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>
2012-11-09 16:56:35 -08:00
Brian Paul 2951a9dd51 Revert "mesa: assert that key->fragprog_inputs_read value isn't too large"
This reverts commit 0d61f879a1.

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.
2012-11-09 16:31:22 -07:00
Matt Turner c6f426c02d glcpp: wire up glcpp-test to make check
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner 68414bc868 glcpp/tests: Add tests for multiline #elif
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner 28e397660c glcpp/tests: Add test for multiline #if
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner b44423cf75 glcpp/tests: Add test for multiline #line
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner c3a15d9a35 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>
2012-11-09 14:33:08 -08:00
Fabian Bieler 9ad71c44fa 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>
2012-11-09 14:33:08 -08:00
Matt Turner 060e696799 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>
2012-11-09 14:33:08 -08:00
Dave Airlie afcaa03f7e 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>
2012-11-10 06:39:38 +10:00
Dave Airlie aafdc5bda4 softpipe: fix unused variable warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie add3a0709f gallium: fix unused cap warnings in drivers for cube map array cap.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie eb44c36df8 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>
2012-11-10 06:20:46 +10:00
Dave Airlie e9cf40142d u_blitter: fix cube array check
Pointed out by Marek on irc,

no committing after beer!

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:20:45 +10:00
José Fonseca 5dbc84ecb0 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>
2012-11-09 13:43:19 +00:00
José Fonseca c84dd7a940 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>
2012-11-09 13:43:19 +00:00
José Fonseca dc53e1b410 trace: Support geometry shaders.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca bbb48a4a55 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>
2012-11-09 13:43:19 +00:00
José Fonseca 49dff2cb05 galahad: Support geometry shader / stream-output methods.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca 658b73a246 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>
2012-11-09 13:43:19 +00:00
José Fonseca 48ce928900 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>
2012-11-09 13:43:19 +00:00
José Fonseca e5f0ae0bd8 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>
2012-11-09 13:43:19 +00:00
José Fonseca 7e112c604e util: Fix reduction of line adjacency primitives.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca b7283834dc 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>
2012-11-09 13:43:19 +00:00
José Fonseca 5d12c7b755 util/u_rect: Make it C++ safe.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:18 +00:00
Dave Airlie 1d9738dab3 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>
2012-11-09 20:34:23 +10:00
Mario Kleiner eabbe5c45f 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 f778174ea1

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>
2012-11-08 22:53:54 -08:00
Kenneth Graunke c299f44782 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]
2012-11-08 22:53:54 -08:00
Kenneth Graunke 6ccfa1c543 mesa: Fix typo in glDeleteQueriesARB debug message.
"Deleete" all the extra letters!
2012-11-08 22:53:39 -08:00
Vinson Lee 2aa783318d 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>
2012-11-08 21:28:15 -08:00
Dave Airlie 2c8f088132 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>
2012-11-09 10:58:49 +10:00
Dave Airlie 308a03f1ab 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>
2012-11-09 10:29:26 +10:00
Dave Airlie 309fda2fb2 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>
2012-11-09 10:29:26 +10:00
Dave Airlie 8c0ccce300 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>
2012-11-09 10:29:13 +10:00
Dave Airlie c4427ceff7 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>
2012-11-09 10:26:37 +10:00
Dave Airlie 5b115864d2 mesa: arb_texture_cube_map_array: fix attrib push/pop
fdo9833 piglit test caught this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:37 +10:00
Dave Airlie 4c8750015b 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>
2012-11-09 10:26:33 +10:00
Dave Airlie 2c52c0e1ce 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>
2012-11-09 09:24:41 +10:00
Dave Airlie e0e7e29554 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>
2012-11-09 09:24:41 +10:00
Dave Airlie 5a5a80e021 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>
2012-11-09 09:24:41 +10:00
Dave Airlie d078c4fb92 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>
2012-11-09 09:24:41 +10:00
Dave Airlie 037b4f8038 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>
2012-11-09 09:24:40 +10:00