Roland Scheidegger [Mon, 25 Feb 2013 19:37:46 +0000 (20:37 +0100)]
llvmpipe: (trivial) get rid of old function prototypes.
llvmpipe_init_screen/context_texture_funcs have long been replaced
with the respective "resource" funcs.
Roland Scheidegger [Sat, 23 Feb 2013 00:16:54 +0000 (01:16 +0100)]
draw: make sure pipeline is revalidated when sampler views or samplers change.
Since with llvm execution parts of sampler view and sampler state is baked into
the shader, we need to revalidate otherwise the wrong shader might get used.
(Not completely sure but I think this would not be required for non-llvm case,
along with everything else in these functions.)
This caused bugs in piglit arb_texture_buffer_object-formats, because we never
noticed that the view format changed.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Mon, 25 Feb 2013 19:23:18 +0000 (20:23 +0100)]
llvmpipe: support GL_ARB_texture_buffer_object/GL_ARB_texture_buffer_range
This also fixes not honoring first/last_layer view parameters for array
textures, plus not honoring last_level view parameter for all textures
(neither is really used by OpenGL).
This mostly passes piglit arb_texture_buffer_object tests (it needs, however,
glsl 140 version override, plus GL 3.1 override, the latter only because
mesa does not allow ARB_tbo in non-core contexts).
Most arb_texture_buffer_object tests pass, with the exception of
arb_texture_buffer_object-formats. With "arb" parameter it passes most weirdo
formats before it segfaults in the state tracker, this looks to be some issue
with using legacy formats in core context (fails the same in softpipe).
With "core" parameter it passes with "fs", however fails with "vs" (for most
formats). This will be fixed later (debugging shows we're completely missing
the shader recompile depending on format).
v2: based on Jose's feedback, fix comments, variable/function names.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Eric Anholt [Wed, 20 Feb 2013 22:00:47 +0000 (14:00 -0800)]
i965: Fix the W value of deprecated pointcoords on pre-gen6.
When you didn't have a texcoord array bound (or a non-1 current w
attrib), we were telling the fragment shader that it could just use "1"
instead of doing expensive pre-gen6 math to invert it. If you drew the
point with a non-1 W value, then you'd get the right size (since all the
vertex computations worked), but we'd mis-interpolate the coordinate
across the face.
Fixes the mesa pointsprite demo on GM45.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30232
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Note: This is a candidate for the stable branches.
Tapani Pälli [Wed, 20 Feb 2013 11:00:08 +0000 (13:00 +0200)]
mesa/es: NULL check in EGLImageTargetTexture2DOES
check that pointer passed is valid and return error if not.
Note: This is a candidate for the stable branches.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Tapani Pälli [Wed, 20 Feb 2013 11:00:07 +0000 (13:00 +0200)]
mesa: add missing case in _mesa_GetTexParameterfv()
missing case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES is required
by OES_EGL_image_external extension.
Note: This is a candidate for the stable branches.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Andreas Boll [Mon, 25 Feb 2013 10:31:01 +0000 (11:31 +0100)]
docs: add news item for mesa-demos 8.1.0 release
Andreas Boll [Mon, 25 Feb 2013 09:47:02 +0000 (10:47 +0100)]
docs: import release notes for 9.1, add news item
Jordan Justen [Wed, 13 Feb 2013 00:12:31 +0000 (16:12 -0800)]
glsl: Remove VS output varyings which are optimized out of the FS
Previously when an input varying was optimized out of the
FS we would still retain it as an output of the VS.
We now build a hash of live FS input varyings rather
than looking in the FS symbol table. (The FS symbol table
will still contain the optimized out varyings.)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Vinson Lee [Sat, 23 Feb 2013 04:33:54 +0000 (20:33 -0800)]
vl: Fix off-by-one error in device_name_length allocation.
Fixes out-of-bounds write reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
John Kåre Alsaker [Wed, 12 Dec 2012 20:00:58 +0000 (21:00 +0100)]
llvmpipe: Fix creation of shared and scanout textures.
NOTE: This is a candidate for the stable branches.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
José Fonseca [Sat, 23 Feb 2013 13:49:00 +0000 (13:49 +0000)]
util/u_blitter: Set pipe_sampler_state::normalized_coords correctly.
We might want to revisit the normalized_coords semantics, but this is
the current expected behavior.
Fixes fdo bug 61091.
Reviewed-by: Brian Paul <brianp@vmware.com>
Brian Paul [Tue, 5 Feb 2013 00:26:45 +0000 (17:26 -0700)]
svga: remove some extraneous whitespace
Brian Paul [Mon, 4 Feb 2013 22:53:07 +0000 (15:53 -0700)]
st/mesa: fix debug_printf() format string warning
Use %td for ptrdiff_t (aka GLsizeiptrARB).
José Fonseca [Sat, 23 Feb 2013 10:50:14 +0000 (10:50 +0000)]
util/dump: Use static assertion to detect string table size mismatches.
Suggested by Brian Paul.
Could probably be extended to other enums.
Reviewed-by: Brian Paul <brianp@vmware.com>
Vinson Lee [Fri, 22 Feb 2013 06:00:44 +0000 (22:00 -0800)]
st/xvmc/tests: Ensure colorkey is initialized.
Fixes uninitialized scalar variable defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Vinson Lee [Fri, 22 Feb 2013 06:15:13 +0000 (22:15 -0800)]
st/vdpau: Fix memory leak in vlVdpBitmapSurfaceCreate.
Fixes resource leak defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Vinson Lee [Fri, 22 Feb 2013 06:13:06 +0000 (22:13 -0800)]
st/vdpau: Fix memory leak in vlVdpOutputSurfaceCreate.
Fixes resource leak defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tapani Pälli [Thu, 21 Feb 2013 07:51:40 +0000 (09:51 +0200)]
glapi: mark static_dispatch false for DiscardFramebufferEXT
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61199
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Brad King <brad.king@kitware.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Brian Paul [Thu, 21 Feb 2013 15:29:56 +0000 (08:29 -0700)]
llvmpipe: rename polygon offset fields to something more specific
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Thu, 21 Feb 2013 15:22:10 +0000 (08:22 -0700)]
llvmpipe: add missing checks for polygon offset point/line modes
The llvm pipeline handles regular filled triangle offsets, but it
doesn't handle offsets for triangles drawn in point or line mode.
Fixes failures found with new piglit polygon-mode-offset test.
Note: This is a candidate for the stable branches.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Thu, 21 Feb 2013 15:18:02 +0000 (08:18 -0700)]
draw: fix broken polygon offset stage
There were several issues. We weren't handling different front/back
polygon fill modes. We weren't checking whether the offset applied to
fill mode vs. line mode vs. point mode.
Fixes problems found with the Visualization Toolkit (VTK) test suite.
Note: This is a candidate for the stable branches.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Thu, 21 Feb 2013 15:16:16 +0000 (08:16 -0700)]
st/mesa: fix polygon offset state translation logic
The old logic was kind of twisted, but seemed to work in practice.
Note: This is a candidate for the stable branches.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Brian Paul [Wed, 20 Feb 2013 14:39:04 +0000 (07:39 -0700)]
st/mesa: check for dummy programs in destroy_program_variants()
When we destroy an ARB vp/fp whose ID was gen'd but not otherwise used we
get a pointer to the dummy/placeholder program. We can't destroy that one
so just skip it. This only failed during context tear-down because
glDeleteProgramsARB() was already aware of dummy programs.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38086
Note: This is a candidate for the stable branches.
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Brian Paul [Tue, 19 Feb 2013 19:24:32 +0000 (12:24 -0700)]
st/mesa: fix trimming of GL_QUAD_STRIP
We sometimes convert GL_QUAD_STRIP prims into GL_TRIANGLE_STRIP, but
that changes the results of the u_trim_pipe_prim() call. We need to
pass the original primitive type to the trim function.
Note that OpenGL's GL_x prim type values match Gallium's PIPE_PRIM_x values.
Fixes a failure in the new piglit degenerate-prims test.
Note: This is a candidate for the stable branches.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Alex Deucher [Fri, 22 Feb 2013 23:42:33 +0000 (18:42 -0500)]
r600g: fixup PS_PARTIAL_FLUSH flag handling for cayman
So we don't emit it twice if we ever use the flag on
cayman.
Note: this is a candidate for the 9.1 branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Deucher [Fri, 22 Feb 2013 22:04:43 +0000 (17:04 -0500)]
r600g: r6xx deadlock workaround (v6)
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=50655
https://bugs.freedesktop.org/show_bug.cgi?id=47116
v2: flush along with workaround.
v3: just need a flush
v4: try WAIT_UNTIL
v5: switch to PS partial flush
v6: rework patch
Note: this is a candidate for the 9.1 branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Alex Deucher [Fri, 22 Feb 2013 22:02:54 +0000 (17:02 -0500)]
r600g: add PS_PARTIAL_FLUSH flag
PS_PARTIAL flushes seems to be required in certain
cases to prevent hangs, especially on r6xx.
Note: this is a candidate for the 9.1 branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Ian Romanick [Fri, 22 Feb 2013 21:55:44 +0000 (13:55 -0800)]
i965: Enable OpenGL ES 3.0 on Sandy Bridge
Regardless of what we put in the screen structure, all of the extensions
that compute_version_es2 checks are present and 3.0 will be exposed
anyway.
NOTE: This is a candidate for the 9.1 branch.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Lauri Kasanen [Fri, 22 Feb 2013 20:25:58 +0000 (22:25 +0200)]
configure: Fix build with automake < 1.11
Commit
86d30dea3c13d29ef8d39bc18db63a0441051975 broke building with older
automake versions with this error:
Makefile:769: *** Recursive variable am__v_YACC_ references itself (eventually). Stop.
This patch fixes it. Fix stolen from xorg-macros.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Anuj Phogat [Fri, 15 Feb 2013 19:03:08 +0000 (11:03 -0800)]
meta: Allocate texture before initializing texture coordinates
tex->Sright and tex->Ttop are initialized during texture allocation.
This fixes depth buffer blitting failures in khronos conformance tests
when run on desktop GL 3.0.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59495
Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Wed, 20 Feb 2013 20:58:47 +0000 (12:58 -0800)]
mesa: Fix setup of ctx->Point.PointSprite for GLES2.
The recent change for GL core broke the older setup, which broke
gl_PointCoord on pre-gen6 (where gl_PointCoord is undefined if point
sprites are disabled). Fixes the new piglit GLES-2.0/glsl-fs-pointcoord
test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32429
Note: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 21 Feb 2013 02:00:47 +0000 (18:00 -0800)]
i965/fs: Fix broken math on values loaded from uniform buffers on gen6.
In a debug build this led to assertion failures, but on a non-debug
build the hardware would just reference the whole vec8 instead of the
same channel 8 times.
Fixes the new piglit glsl-1.40/uniform-buffer/fs-exp2.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57121
Note: This is a candidate for the stable branches
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
José Fonseca [Fri, 22 Feb 2013 15:34:30 +0000 (15:34 +0000)]
tgsi: Improve execution debugging.
- zero temps/outputs instead of copying (otherwise we won't be able to see
the temps/outputs assignments for small shaders where nothing changes
across big areas
- also show the inputs (as it's often impossible to infer from the rest)
Reviewed-by: Brian Paul <brianp@vmware.com>
José Fonseca [Fri, 22 Feb 2013 12:17:30 +0000 (12:17 +0000)]
util/u_dump: Update texture target strings.
Sergey Matyukevich [Fri, 22 Feb 2013 11:00:31 +0000 (11:00 +0000)]
util/debug: Always use __builtin_frame_address on gcc.
Should workaround fdo bug 57563.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Michel Dänzer [Fri, 22 Feb 2013 12:04:32 +0000 (13:04 +0100)]
radeon/llvm: Remove stale comment about radeon_llvm_emit_prepare_cube_coords
Marek Olšák [Thu, 21 Feb 2013 15:53:32 +0000 (16:53 +0100)]
r600g: fix random corruption with CP DMA in TF2
NOTE: This is a candidate for the 9.1 branch.
Michel Dänzer [Mon, 18 Feb 2013 15:39:28 +0000 (16:39 +0100)]
radeonsi: Don't pretend there is any R8G8B8 support
The hardware can't do it.
Andreas Boll [Thu, 21 Feb 2013 18:31:40 +0000 (19:31 +0100)]
llvmpipe/build: add DLOPEN_LIBS and PTHREAD_LIBS to the lp_test_* targets
Fixes undefined symbols.
NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61052
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Andreas Boll [Thu, 21 Feb 2013 08:17:56 +0000 (09:17 +0100)]
targets/xa-vmwgfx: Force c++ linker to fix undefined symbols
NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61200
Reviewed-by: Matt Turner <mattst88@gmail.com>
Roland Scheidegger [Fri, 22 Feb 2013 08:53:22 +0000 (08:53 +0000)]
llvmpipe: Fix rendering into PIPE_FORMAT_X8*_UNORM.
Mesa state tracker recently started using PIPE_FORMAT_X8B8G8R8_UNORM,
causing segfaults in texture-packed-formats, because swizze[chan] was
0xff for padding channel (X).
Signed-off-by: José Fonseca <jfonseca@vmware.com>
José Fonseca [Fri, 22 Feb 2013 08:45:07 +0000 (08:45 +0000)]
trace: Never close stdout/stderr.
This could happen, when a trace screen was destroyed and then recreated.
José Fonseca [Thu, 21 Feb 2013 19:54:55 +0000 (19:54 +0000)]
trace: Fix set_constant_buffer dumping.
We were dumping the trace driver pointer, instead of the pointer from the
underlying pipe driver.
Vinson Lee [Thu, 21 Feb 2013 07:32:20 +0000 (23:32 -0800)]
r600g: Fix memory leak in r600_shader_select.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reported-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Roland Scheidegger [Thu, 21 Feb 2013 16:13:34 +0000 (17:13 +0100)]
llvmpipe: simplify buffer allocation logic.
Now with buffer formats clarification don't need all that logic any longer.
(Note that it never would have worked in any case, because blockwidth and
blockheight were swapped any allocation with multi-byte format would have
had zero size.)
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Thu, 21 Feb 2013 16:08:34 +0000 (17:08 +0100)]
gallium/docs: improve text about resources a bit.
This clarifies some things and gets rid of some old stuff.
The most significant one is probably that buffers cannot have formats
(nearly all drivers completely ignored format and used width0 as byte size
already in any case). There seems to be no use case for "structured" buffers.
(Note while d3d11 has new Structured Buffers, these still aren't associated
with a format, rather a byte stride, which we can't do yet either way.)
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 19 Feb 2013 18:47:08 +0000 (19:47 +0100)]
draw: make sure key size is calculated consistently.
Some parts calculated key size by using shader information, others by using
the pipe_vertex_element information. Since it is perfectly valid to have more
vertex_elements set than the vertex shader is using those may not be the same,
so we weren't copying over all vertex_element state - this caused the tgsi dump
to assert (iterates over all vertex elements). More importantly in this
situation it would also break vertex texturing completely (since the sampler
state derived from the key is at a different position than expected).
Fix thix by deriving key->nr_vertex_elements from the shader information
instead of the pipe_vertex_element state (unlike dx10, we can't have "holes"
in pipe_vertex_element state, so this should be safe).
(Note that actual llvm shader generation does not use the pipe_vertex_element
state from the key itself in any case (althogh I guess it could) but uses
the one from draw.pt (which should be the same though contains all elements)
instead.)
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tom Stellard [Sun, 10 Feb 2013 05:15:12 +0000 (00:15 -0500)]
r300g/compiler: Fix bug in OMOD folding
The OMOD value was only being folded to one instruction in cases where
the MUL instruction was reading a value written by more than one
instruction.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tom Stellard [Sun, 10 Feb 2013 05:15:11 +0000 (00:15 -0500)]
r300g/tests: Add helper functions for creating a full program
Now you can convert assembly strings into a full struct radeon_compiler
object and use it to test individual compiler pases.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tom Stellard [Sun, 10 Feb 2013 05:15:10 +0000 (00:15 -0500)]
r300g/tests: Exit test runner with a valid status code
This way make check can report whether or not the tests pass.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tom Stellard [Sun, 10 Feb 2013 05:15:09 +0000 (00:15 -0500)]
r300g/complier: Make r300_vertprog_swizzle_caps visible in other files
This will be used by the test suite in later commits.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tom Stellard [Sun, 10 Feb 2013 05:15:08 +0000 (00:15 -0500)]
r300g/compiler: Fix typo in comment
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tom Stellard [Sun, 10 Feb 2013 05:15:07 +0000 (00:15 -0500)]
r300g/compiler: Add missing license headers
These are all files that I authored, but forgot to add the license
headers.
NOTE: This is a candidate for the stable branches.
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Carl Worth [Wed, 20 Feb 2013 00:27:16 +0000 (16:27 -0800)]
i965: Avoid segfault in gen6_upload_state
This fixes a bug introduced in commit
258453716f001eab1288d99765213 and
triggered whenever "rb" is NULL.
Fixes at least one cause bug #59445:
[SNB/IVB/HSW Bisected]Oglc draw-buffers2(advanced.blending.none) segfault
https://bugs.freedesktop.org/show_bug.cgi?id=59445
(Though segfaults are still possible in that test case, but they have been
present since before commit
258453716f which is what's being fixed here.)
Reviewed-by: Eric Anholt <eric@anholt.net>
Alex Deucher [Wed, 20 Feb 2013 21:11:52 +0000 (16:11 -0500)]
r600g: don't enable ReZ mode on evergreen
Can cause lockups in certain cases when
zfunc/zenable/zwrite change without a flush
in between.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=60969
and lockups on Civ4 with wine.
This is a candidate for the 9.1 branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Andreas Boll [Thu, 21 Feb 2013 16:31:42 +0000 (17:31 +0100)]
docs: import release notes for 9.0.3, add news item
Michel Dänzer [Wed, 13 Feb 2013 15:07:15 +0000 (16:07 +0100)]
radeonsi: Don't match TGSI_SEMANTIC_POSITION fs inputs to vs outputs
Michel Dänzer [Wed, 13 Feb 2013 14:57:23 +0000 (15:57 +0100)]
radeonsi: Fix w component of TGSI_SEMANTIC_POSITION fragment shader inputs.
It's the reciprocal of the register value.
Fixes piglit fragcoord_w and glsl-fs-fragcoord-zw-perspective.
NOTE: This is a candidate for the 9.1 branch.
Michel Dänzer [Wed, 13 Feb 2013 11:54:13 +0000 (12:54 +0100)]
radeonsi: Fix up and enable flat shading.
Requires corresponding LLVM R600 backend fix to work correctly, but even
without that it doesn't hang anymore.
13 more little piglits.
Depends on LLVM: r175193, r175733
NOTE: This is a candidate for the 9.1 branch.
Vinson Lee [Wed, 20 Feb 2013 07:16:14 +0000 (23:16 -0800)]
radeonsi: Fix memory leak in si_shader_select.
Fixes resource leak defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Paul Berry [Sat, 16 Feb 2013 13:59:34 +0000 (05:59 -0800)]
i965: Consign COORD_REPLACE VS hacks to Pre-Gen6.
Pre-Gen6, the SF thread requires exact matching between VS output
slots (aka VUE slots) and FS input slots, even when the corresponding
VS output slot is unused due to being overwritten by point coordinate
replacement (glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE)).
As a result, we have a special hack in the VS to ensure when any
texture coordinate is subject to point coordinate replacement, it is
always allocated space in the VUE, even if it isn't written to by the
VS.
This hack isn't needed from Gen6 onwards, since SF (Gen7: SBE)
swizzling has the ability to insert the point coordinate into
gl_TexCoord[] without needing a corresponding unused VUE slot.
Note that no modification of SF setup code is required for this
patch--get_attr_override() already does the right thing. However, we
make a slight comment change to clarify why this works.
In addition to eliminating unnecessary VS recompiles and saving
precious URB space on Gen6+, this will save us the trouble of having
to adjust this hack when we implement geometry shaders.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Ian Romanick [Tue, 19 Feb 2013 23:23:57 +0000 (15:23 -0800)]
mesa: Don't install glEvalMesh in the beginend dispatch table
NOTE: This is a candidate for the 9.1 branch.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59740
Reviewed-by: Eric Anholt <eric@anholt.net>
Roland Scheidegger [Tue, 19 Feb 2013 20:28:25 +0000 (21:28 +0100)]
gallivm: fix indirect src register fetches requiring bitcast
For constant and temporary register fetches, the bitcasts weren't done
correctly for the indirect case, leading to crashes due to type mismatches.
Simply do the bitcasts after fetching (much simpler than fixing up the load
pointer for the various cases).
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=61036
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 19 Feb 2013 20:18:29 +0000 (21:18 +0100)]
llvmpipe: lp_resource_copy cleanup
We don't need to flush resources for each layer, and since we don't actually
care about layer at all in the flush function just drop the parameter.
Also we can use util_copy_box instead of repeated util_copy_rect.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 19 Feb 2013 03:19:07 +0000 (04:19 +0100)]
llvmpipe: fix lp_resource_copy using more than one 3d slice
These used to be illegal a very long time ago, then for some more time
nothing really emitted these so this code path wasn't hit.
Just trivially iterate over box->depth.
(Might be worth refactoring at some point since nowadays all the code
doesn't really do much except for depth textures.)
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=61093
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tapani Pälli [Mon, 18 Feb 2013 07:12:27 +0000 (09:12 +0200)]
gles2: a stub implementation for GL_EXT_discard_framebuffer
This patch implements a stub for GL_EXT_discard_framebuffer with
required checks listed by the extension specification. This extension
is required by GLBenchmark 2.5 when compiled with OpenGL ES 2.0
as the rendering backend.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
Michel Dänzer [Wed, 20 Feb 2013 12:06:18 +0000 (13:06 +0100)]
r600g/Cayman: Fix blending using destination alpha factor but non-alpha dest
Only compile tested, but should fix at least some piglit fbo-blending tests.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Michel Dänzer [Mon, 18 Feb 2013 10:29:18 +0000 (11:29 +0100)]
radeonsi: Fix blending using destination alpha factor but non-alpha destination
11 more little piglits.
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Marek Olšák [Tue, 19 Feb 2013 16:36:59 +0000 (17:36 +0100)]
radeonsi: implement 3D transfers
That means we can map and read multiple slices with one transfer_map call.
[ Cherry-picked from r600g commit
1aebb6911e9aa1bd8900868b58d1750ca83a20c7 ]
11 more little piglits on master, 1 more on the 9.1 branch (Marek's
glTex(Sub)Image improvements on master broke the other 10).
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Tue, 19 Feb 2013 16:43:08 +0000 (17:43 +0100)]
radeonsi: add assertions to prevent creation of invalid surfaces
[ Cherry-picked from r600g commit
ef11ed61a0414d0405c3faf7f48fa3f1d083f82e ]
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Marek Olšák [Tue, 19 Feb 2013 16:22:17 +0000 (17:22 +0100)]
radeonsi: use u_box_origin_2d helper function
[ Cherry-picked from r600g commit
b278aba42310e8fa30f2408b9dcd58dbb4901724 ]
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Vinson Lee [Tue, 19 Feb 2013 08:52:40 +0000 (00:52 -0800)]
configure.ac: Do not check for clock_gettime on MinGW.
MinGW does not have clock_gettime.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Zack Rusin [Fri, 15 Feb 2013 04:39:36 +0000 (20:39 -0800)]
DRI2: Don't disable GLX_INTEL_swap_event unconditionally
GLX_INTEL_swap_event is broken on the server side, where it's
currently unconditionally enabled. This completely breaks
systems running on drivers which don't support that extension.
There's no way to test for its presence on this side, so instead
of disabling it uncondtionally, just disable it for drivers
which are known to not support it. It makes sense because
most drivers do support it right now.
We'll be able to remove this once Xserver properly advertises
GLX_INTEL_swap_event.
Note: This is a candidate for stable branch branches.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60052
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Eric Anholt [Sat, 16 Feb 2013 03:49:32 +0000 (19:49 -0800)]
i965/fs: Enable CSE on uniform pull constant loads.
Improves on a major performance regression for the dolphin wii emulator
from its move to using UBOs. Performance in the UBO codepath (as
replayed through apitrace) is up 21.1% +/- 2.3% (n=26/29).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Sat, 16 Feb 2013 05:55:30 +0000 (21:55 -0800)]
i965/fs: Only do CSE when the dst types match.
We could potentially do some CSE even when the dst types aren't the same
on gen6 where there is no implicit dst type conversion iirc, or in the
case of uniform pull constant loads where the dst type doesn't impact
what's stored. But it's not worth worrying about.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.
Eric Anholt [Sat, 16 Feb 2013 03:26:48 +0000 (19:26 -0800)]
i965/fs: Delay setup of uniform loads until after pre-regalloc scheduling.
This should fix the register allocation explosion on the GLES 3.0 test
on gen6. It also gives us an instruction that will fit our CSE handling.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.
Eric Anholt [Sat, 16 Feb 2013 05:10:06 +0000 (21:10 -0800)]
i965/fs: Fix copy propagation with smearing.
We were correctly relaying the smear from MOV's src, but if the MOV
didn't do a smear, we don't want to smash the smear value from the
instruction being propagated into. Prevents a regression in the
upcoming UBO change.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.
Eric Anholt [Sat, 16 Feb 2013 03:55:46 +0000 (19:55 -0800)]
i965/fs: Add a bit more instruction dumping useful for upcoming work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tom Stellard [Wed, 13 Feb 2013 20:59:41 +0000 (20:59 +0000)]
radeon/llvm: Fix build with LLVM 3.3
Tom Stellard [Wed, 13 Feb 2013 20:57:25 +0000 (20:57 +0000)]
r600g: Add $(DEFINES) to AM_CXXFLAGS
This way llvm_wrapper.cpp is compiled with -DHAVE_LLVM=0x....
Paul Berry [Sat, 16 Feb 2013 18:32:50 +0000 (10:32 -0800)]
i965: Remove unused userclip flags.
brw_vs_prog_data::userclip hasn't been used since commit
f0cecd4
(i965: Move VUE map computation to once at VS compile time).
brw_gs_prog_key::userclip_active hasn't been used since commit
9f3d321
(i965: Make the userclip flag for the VUE map come from VS prog data).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Mon, 18 Feb 2013 17:11:54 +0000 (10:11 -0700)]
llvmpipe: fix handling of 0 x 0 framebuffer size
Bump up the size to 1 x 1. This fixes a number of potential failure
points in the code.
See also http://bugs.freedesktop.org/show_bug.cgi?id=61012
Brian Paul [Mon, 18 Feb 2013 18:17:07 +0000 (11:17 -0700)]
st/xlib: initialize the drawable size in create_xmesa_buffer()
Otherwise, the PBuffer's size was never set. This also initializes
the buffer size for windows, pixmaps, etc.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61012
Note: This is a candidate for the stable branches.
Stefan Brüns [Tue, 5 Feb 2013 16:29:20 +0000 (17:29 +0100)]
glx: fix glGetTexLevelParameteriv for indirect rendering
A single element in a GLX reply is contained in the header itself.
The number of elements is denoted in the "n" field of the reply.
If "n" is 1, the length of additional data is 0.
The XXX_data_length() function of xcb does not return the length of
the (optional, n>1) data but the number of elements.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=59876
Note: This is a candidate for the stable branches.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Brian Paul [Mon, 18 Feb 2013 15:36:35 +0000 (08:36 -0700)]
st/mesa: implement glBitmap unpacking from a PBO, for the cache path
We weren't mapping the PBO when using the bitmap cache (but we had
the PBO code for the non-cache path.)
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61026
Note: This is a candidate for the stable branches.
Brian Paul [Sat, 16 Feb 2013 18:54:22 +0000 (11:54 -0700)]
draw: fix non-perspective interpolation in interp()
This fixes a regression from
ab74fee5e1a3fc3323b7238278637b232c2d0d95.
When we use the clip coordinate to compute the screen-space interpolation
factor, we need to first apply the divide-by-W step to the clip
coordinate.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60938
Note: This is a candidate for the 9.1 branch.
Marek Olšák [Thu, 14 Feb 2013 13:30:59 +0000 (14:30 +0100)]
st/mesa: remove what is left from u_blit
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Feb 2013 11:08:33 +0000 (12:08 +0100)]
st/mesa: simplify and improve CopyTexSubImage
It has become a bit messy.
Changes:
- finally correct checking for transfer ops depending on the base format
- making sure the base internal format and the texture format match
(we were ignoring it, but it's important for correctness)
- the way-too-strict rule that both src and dst base formats must be the same
was dropped; ensuring the simpler and more permissive rule mentioned above
is enough
- stop using util_blit_pixels; pipe->blit is flexible enough, and now that we
have RGBX and red-alpha formats, pipe->blit can be used for more cases
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Feb 2013 11:48:12 +0000 (12:48 +0100)]
st/mesa: don't do sRGB conversion in CopyTexSubImage
Assuming I understand EXT_texture_sRGB correctly.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Thu, 14 Feb 2013 00:03:55 +0000 (01:03 +0100)]
st/mesa: implement blit-based TexImage and TexSubImage
A temporary texture is created such that it matches the format and type
combination and pixels are copied to it using memcpy. Then the blit is used to
copy the temporary texture to the texture image being modified by TexImage or
TexSubImage. The blit takes care of the format and type conversion and
swizzling. The result is a very fast texture upload involving as little CPU
as possible.
This improves performance in apps which upload textures during rendering.
An example is the Wine OpenGL backend for DirectDraw, which I used to test
the game StarCraft. Profiling had shown that TexSubImage was taking 50% of
CPU time without this patch, which was the main motivation for this work, and
now TexSubImage only takes 14% of CPU time. I had to underclock my CPU to see
any difference in the game and this patch does make the game a lot faster
if the CPU is slow (or using the powersave cpufreq profile).
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 13 Feb 2013 21:32:03 +0000 (22:32 +0100)]
st/mesa: fix blit-based GetTexImage for 1D array textures
This is not easy to hit, because we have 3 code paths now
(tried in this order):
- memcpy-based (skips the blit) -> _mesa_tex_getimage
- blit-based
- slow pixel packing -> _mesa_tex_getimage
The main difference later in the code is the parameters of
_mesa_image_address3d.
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 13 Feb 2013 21:23:37 +0000 (22:23 +0100)]
st/mesa: fix blit-based GetTexImage for depth/stencil formats
BTW, we have 0 tests for glGetTexImage(format=GL_DEPTH*).
Reviewed-by: Brian Paul <brianp@vmware.com>
Marek Olšák [Wed, 13 Feb 2013 21:15:55 +0000 (22:15 +0100)]
st/mesa: factor out code for determining blit.mask from CopyTexSubImage
I'll need this later.
Reviewed-by: Brian Paul <brianp@vmware.com>
Michel Dänzer [Fri, 15 Feb 2013 14:54:28 +0000 (15:54 +0100)]
radeonsi: Fix PIPE_FORMAT_X32_S8X24_UINT sampler hardware format
4 more little piglits.
NOTE: This is a candidate for the 9.1 branch.
Michel Dänzer [Fri, 15 Feb 2013 10:30:50 +0000 (11:30 +0100)]
radeonsi: Use stencil surface level information for stencil texturing
7 more little dwarves^W piglits.
NOTE: This is a candidate for the 9.1 branch.
Michel Dänzer [Fri, 15 Feb 2013 10:11:22 +0000 (11:11 +0100)]
radeonsi: properly implement S8Z24 depth-stencil format
Based on r600g commit
2b9659c9e627ad03160899b8be04f96307d098eb .
Fixes crashes with 4 piglit tests which are now hitting these formats.
NOTE: This is a candidate for the 9.1 branch.
Vincent Lejeune [Thu, 14 Feb 2013 16:26:30 +0000 (17:26 +0100)]
r600g/llvm: Support for TBO
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Wed, 13 Feb 2013 19:20:04 +0000 (20:20 +0100)]
r600g/llvm: Set Inputs/Outputs count to 32 (api reported value)
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Wed, 13 Feb 2013 17:49:30 +0000 (18:49 +0100)]
r600g/llvm: Fix alpha_to_one piglit tests
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>