Matt Turner [Fri, 23 Nov 2012 08:03:59 +0000 (00:03 -0800)]
mesa: Return 0 for XFB_VARYING_MAX_LENGTH if no varyings
v2: Perform this count the same way as elsewhere in this file, per
Brian Paul's review.
Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Wed, 21 Nov 2012 16:52:07 +0000 (17:52 +0100)]
gallium/tests/trivial: updates for transfer functions changes
Fixes build error with configure option --enable-gallium-tests
introduced in
369e46888904c6d379b8b477d9242cff1608e30e
Compile tested only.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Andreas Boll [Wed, 21 Nov 2012 14:37:58 +0000 (15:37 +0100)]
gallium/tests/trivial: updates for CSO interface changes
Fixes build error with configure option --enable-gallium-tests
introduced in
ea6f035ae90895bd4ee3247408eb179dfdf96d22
Cc: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Andreas Boll [Tue, 20 Nov 2012 20:04:25 +0000 (21:04 +0100)]
gallium/tests/trivial: updates for util_draw_vertex_buffer changes
Fixes build error with configure option --enable-gallium-tests
introduced in
e73bf3b805de78299f1a652668ba4e6eab9bac94
Reviewed-by: Marek Olšák <maraeo@gmail.com>
James Benton [Wed, 11 Jul 2012 14:31:21 +0000 (15:31 +0100)]
util: Modified u_rect to default to memcpy.
Previously this function would assert if the format didn't fit an expected 4 channel format size.
Now will work with any format type with any amount of channels.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
James Benton [Thu, 13 Sep 2012 15:05:37 +0000 (16:05 +0100)]
util/format: Fix bug in float to non-float conversion in u_format_pack.py.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
James Benton [Wed, 30 May 2012 13:36:44 +0000 (14:36 +0100)]
gallivm: Fix bug in lp_build_one which would incorrectly return a vector for length 1.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Kenneth Graunke [Tue, 20 Nov 2012 06:36:28 +0000 (22:36 -0800)]
glsl: Support unsigned integer constants in layout qualifiers.
Fixes es3conform's explicit_attrib_location_integer_constants.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Wed, 21 Nov 2012 03:26:52 +0000 (19:26 -0800)]
i965/fs: Move struct brw_compile (p) entirely inside fs_generator.
The brw_compile structure contains the brw_instruction store and the
brw_eu_emit.c state tracking fields. These are only useful for the
final assembly generation pass; the earlier compilation stages doesn't
need them.
This also means that the code generator for future hardware won't have
access to the brw_compile structure, which is extremely desirable
because it prevents accidental generation of Gen4-7 code.
v2: rzalloc p, as suggested by Eric.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Fri, 9 Nov 2012 09:05:47 +0000 (01:05 -0800)]
i965/fs: Split final assembly code generation out of fs_visitor.
Compiling shaders requires several main steps:
1. Generating FS IR from either GLSL IR or Mesa IR
2. Optimizing the IR
3. Register allocation
4. Generating assembly code
This patch splits out step 4 into a separate class named "fs_generator."
There are several reasons for doing so:
1. Future hardware has a different instruction encoding. Splitting
this out will allow us to replace fs_generator (which relies
heavily on the brw_eu_emit.c code and struct brw_instruction) with
a new code generator that writes the new format.
2. It reduces the size of the fs_visitor monolith. (Arguably, a lot
more should be split out, but that's left for "future work.")
3. Separate namespaces allow us to make helper functions for
generating instructions in both classes: ADD() can exist in
fs_visitor and create IR, while ADD() in fs_generator() can
create brw_instructions. (Patches for this upcoming.)
Furthermore, this patch changes the order of operations slightly.
Rather than doing steps 1-4 for SIMD8, then 1-4 for SIMD16, we now:
- Do steps 1-3 for SIMD8, then repeat 1-3 for SIMD16
- Generate final assembly code for both modes together
This is because the frontend work can be done independently, but final
assembly generation needs to pack both into a single program store to
feed the GPU.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 21 Nov 2012 01:02:23 +0000 (17:02 -0800)]
i965/fs: Abort on unsupported opcodes rather than failing.
Final code generation should never fail. This is a bug, and there
should be no user-triggerable cases where this could occur.
Also, we're not going to have a fail() method in a moment.
v2: Just abort() rather than assert, to cover the NDEBUG case
(suggested by Eric).
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 21 Nov 2012 01:30:46 +0000 (17:30 -0800)]
i965: Make it possible to create a cfg_t without a backend_visitor.
All we really need is a memory context and the instruction list; passing
a backend_visitor is just convenient at times.
This will be necessary two patches from now.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 21 Nov 2012 00:21:27 +0000 (16:21 -0800)]
i965/fs: Move uses of brw_compile from do_wm_prog to brw_wm_fs_emit.
The brw_compile structure is closely tied to the Gen4-7 hardware
encoding. However, do_wm_prog is very generic: it just calls out to
get a compiled program and then uploads it.
This isn't ultimately where we want it, but it's a step in the right
direction: it's now closer to the code generator.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 20 Nov 2012 22:46:56 +0000 (14:46 -0800)]
i965/fs: Pass the brw_context pointer into fs_visitor explicitly.
We used to steal it out of the brw_compile struct...but fs_visitor
isn't going to have one of those in the future.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 20 Nov 2012 22:41:21 +0000 (14:41 -0800)]
i965/fs: Move brw_wm_compile::fp to fs_visitor.
Also change it from a brw_fragment_program to a gl_fragment_program,
since that seems to be what everything wants anyway.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 20 Nov 2012 22:26:49 +0000 (14:26 -0800)]
i965/fs: Remove struct brw_shader * parameter to fs_visitor constructor.
We can easily recover it from prog, and this makes it clear that we
aren't passing additional information in.
v2: Use an if-statement rather than the ?: operator (suggested by Eric).
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 20 Nov 2012 21:50:52 +0000 (13:50 -0800)]
i965/fs: Move brw_wm_compile::dispatch_width into fs_visitor.
Also, rather than having brw_wm_fs_emit poke at it directly, make it a
parameter to the fs_visitor constructor.
All other changes generated by search and replace (with occasional
whitespace fixup).
v2: Make dispatch_width const (as suggested by Paul); fix doxygen
mistake (pointed out by Eric); update for rebase.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Mon, 19 Nov 2012 22:59:14 +0000 (14:59 -0800)]
i965/fs: Move brw_wm_lookup_iz() to fs_visitor::setup_payload_gen4().
This necessitates compiling brw_wm_iz.c as C++.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Wed, 14 Nov 2012 03:36:18 +0000 (19:36 -0800)]
i965/fs: Move brw_wm_payload_setup() to fs_visitor::setup_payload_gen6()
Now that we only have the one backend, there's no real point in keeping
this separate. Moving it should allow some future simplifications.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Kenneth Graunke [Tue, 20 Nov 2012 20:21:40 +0000 (12:21 -0800)]
i965/fs: Remove brw_wm_compile::computes_depth field.
Everybody determines this by checking if fp's OutputsWritten field
contains the FRAG_RESULT_DEPTH bit. Rather than having payload setup
check this and set the computes_depth flag, we can just do the check in
the only place that actually used it: emit_fb_writes().
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Roland Scheidegger [Tue, 27 Nov 2012 02:30:55 +0000 (03:30 +0100)]
gallivm: use the new mip per quad handling in texture fetch path
No longer have to split fetching into quads dynamically if mip levels
are not the same for all quads (aos sampling still always splits due
to performance reasons).
Instead handle multiple mip levels further down, minification etc. takes
this into account.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Roland Scheidegger [Tue, 27 Nov 2012 02:26:49 +0000 (03:26 +0100)]
gallivm,llvmpipe: handle TXF (texelFetch) instruction, including offsets
This also adds some code to handle per-quad lods for more than 4-wide fetches,
because otherwise I'd have to integrate the texelFetch function into
the splitting stuff... (but it is not used yet outside texelFetch).
passes piglit fs-texelFetch-2D, fails fs-texelFetchOffset-2D due to I believe
a test error (results are undefined for out-of-bounds fetches, we return
whatever is at offset 0, whereas the test expects [0,0,0,1]).
Texel offsets are only handled by texelFetch for now, though the interface
can handle it for everything.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Chris Forbes [Thu, 22 Nov 2012 03:23:25 +0000 (16:23 +1300)]
i965: Enable ARB_vertex_type_2_10_10_10_rev on Gen4+.
v2 (Kayden): Move the enable into an existing intel->gen >= 4 block
(as suggested by Ian).
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Thu, 22 Nov 2012 03:23:24 +0000 (16:23 +1300)]
i965: emit w/a for packed attribute formats in VS
Implements BGRA swizzle, sign recovery, and normalization
as required by ARB_vertex_type_10_10_10_2_rev.
V2: Ported to the new VS backend, since that's all that's left;
fixed normalization.
V3: Moved fixups out of the GLSL-only path, so it works for FF/VP too.
V4 (Kayden): Rework ES3 normalization, don't heap allocate registers;
tidy comments.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Thu, 22 Nov 2012 03:23:22 +0000 (16:23 +1300)]
i965: set attribute w/a bits for packed formats
Flag the need for various workarounds to be applied by
the vertex shader.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Thu, 22 Nov 2012 03:23:21 +0000 (16:23 +1300)]
i965: Generalize GL_FIXED VS w/a support
Next few patches build on this to add other workarounds
for packed formats.
V2: rename BRW_ATTRIB_WA_COMPONENTS to BRW_ATTRIB_WA_COMPONENT_MASK;
V3 (Kayden): remove separate bit for ES3 signed normalization
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Thu, 22 Nov 2012 03:23:20 +0000 (16:23 +1300)]
i965: support 2_10_10_10 formats in get_surface_type.
Always use R10G10B10A2_UINT; Most of the other formats we'd like
don't actually work on the hardware. Will emit w/a for scaling,
sign recovery and BGRA swizzle in the VS.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Thu, 22 Nov 2012 03:23:19 +0000 (16:23 +1300)]
i965: implement get_size for 2_10_10_10 formats
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Chris Forbes [Thu, 22 Nov 2012 03:23:23 +0000 (16:23 +1300)]
i965/vs: add support for emitting SHL, SHR, ASR
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Thu, 22 Nov 2012 08:06:03 +0000 (00:06 -0800)]
mesa: Use correct glGetTransformFeedbackVarying name in error msg
Reviewed-by: Brian Paul <brianp@vmware.com>
Andreas Boll [Fri, 16 Nov 2012 09:46:06 +0000 (10:46 +0100)]
build: use git ls-files for adding all Makefile.in into the release tarball
Until we have proper 'make dist' this is an improvement of the current
situation, because each time some old Makefiles got converted to automake
we had to update the tarballs target.
NOTE: This is a candidate for the 9.0 branch.
Cc: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
Eric Anholt [Wed, 14 Nov 2012 19:44:57 +0000 (11:44 -0800)]
i965: Fix hangs with FP KIL instructions pre-gen6.
We can't support IF statements in 16-wide on these. To get back to 16-wide
for these shaders, we need to support predicate on discard instructions in the
backend IR, which is something we've sort of got on the list to do anyway.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55828
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Fri, 16 Nov 2012 17:56:03 +0000 (09:56 -0800)]
i965/gen4: Fix memory leak each time compile_gs_prog() is called.
Commit
774fb90db3e83d5e7326b7a72e05ce805c306b24 introduced a ralloc context to
each user of struct brw_compile, but for this one a NULL context was used,
causing the later ralloc_free(mem_ctx) to not do anything.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55175
NOTE: This is a candidate for the stable branches.
Eric Anholt [Tue, 13 Nov 2012 23:54:41 +0000 (15:54 -0800)]
i965/gen4: Fix LOD bias texturing since my fixed reg classes change.
We have a special case where non-shadow comparison with LOD requires using a
SIMD16 vec4 in an 8-wide shader, which appears in the register allocator as a
size 8 vgrf.
Fixes assertions in various piglit tests and webgl conformance.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56521
Marek Olšák [Thu, 22 Nov 2012 23:38:44 +0000 (00:38 +0100)]
r600g: fix broken streamout if streamout_begin caused a context flush
This fixes graphics corruption in the case where the DISCARD_RANGE flag
is used to map a buffer.
NOTE: This is a candidate for the stable branches.
Marek Olšák [Thu, 22 Nov 2012 21:40:06 +0000 (22:40 +0100)]
r600g: fix ARB_map_buffer_alignment with unaligned offsets and staging buffers
Vinson Lee [Sat, 17 Nov 2012 07:35:42 +0000 (23:35 -0800)]
scons: Append x11 library path if linking x11 library.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Kenneth Graunke [Fri, 12 Oct 2012 19:46:44 +0000 (12:46 -0700)]
mesa/vbo: Fix scaling issue in 2-bit signed normalized packing.
Since a signed 2-bit integer can only represent -1, 0, or 1, it is
tempting to simply to convert it directly to a float. This maps it
onto the correct range of [-1.0, 1.0]. However, it gives different
values compared to the usual equation:
(2.0 * 1.0 + 1.0) * (1.0 / 3.0) = +1.0 (same)
(2.0 * 0.0 + 1.0) * (1.0 / 3.0) = +0.
33333333... (different)
(2.0 * -1.0 + 1.0) * (1.0 / 3.0) = -0.
33333333... (different)
According to the GL_ARB_vertex_type_2_10_10_10_rev extension, signed
normalization is performed using equation 2.2 from the GL 3.2
specification, which is:
f = (2c + 1)/(2^b - 1). (2.2)
Comments below that equation state: "In general, this representation is
used for signed normalized fixed-point parameters in GL commands, such
as vertex attribute values." Which is what we're doing here.
The 3.2 specification goes on to declare an alternate formula:
f = max{c/(2^(b-1) - 1), -1.0} (2.3)
which is closer to the existing code, and maps the end points to exactly
-1.0 and 1.0. Comments below the equation state: "In general, this
representation is used for signed normalized fixed-point texture or
framebuffer values." Which is *not* what we're doing here.
It then states: "Everywhere that signed normalized fixed-point
values are converted, the equation used is specified." This is the real
clincher: the extension explicitly specifies that we must use equation
2.2, not 2.3. So we need to do (2x + 1) / 3.
This matches the behavior expected by oglconform's packed-vertex test,
and is correct for desktop GL (pre-4.2). It's not correct for ES 3.0,
but a future patch will correct that.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
Kenneth Graunke [Fri, 12 Oct 2012 18:17:39 +0000 (11:17 -0700)]
mesa/vbo: Fix scaling issue in 10-bit signed normalized packing.
For the 10-bit components, the divisor was incorrect. A 10-bit signed
integer can represent -2^9 through 2^9 - 1, which leads to the following
ranges:
(float)value.x -> [ -512, 511]
2.0F * (float)value.x -> [-1024, 1022]
2.0F * (float)value.x + 1.0F -> [-1023, 1023]
So dividing by 511 would incorrectly scale it to approximately:
[-2.
001956947, 2.
001956947]. To correctly scale to [-1.0, 1.0], we need
to divide by 1023.
This correctly implements the desktop GL rules. ES 3.0 has different
rules, but those will be implemented in a separate patch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
Alex Deucher [Wed, 21 Nov 2012 23:48:18 +0000 (18:48 -0500)]
radeonsi: add a new SI pci id
Note: this is a candidate for the stable branch.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Vinson Lee [Wed, 14 Nov 2012 07:20:42 +0000 (23:20 -0800)]
i915: Fix wrong sizeof argument in i915_update_tex_unit.
The bug was found by Coverity.
NOTE: This is a candidate for the stable branches.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Andreas Boll [Sat, 17 Nov 2012 17:04:54 +0000 (18:04 +0100)]
Add .dirstamp to toplevel .gitignore
Andreas Boll [Wed, 21 Nov 2012 17:17:00 +0000 (18:17 +0100)]
gallium/tests: update .gitignore files
Eric Anholt [Fri, 9 Nov 2012 20:50:03 +0000 (12:50 -0800)]
i965/fs: Add helper functions for IF and CMP and use them.
v2: Rebase on gen6-if fix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Eric Anholt [Fri, 9 Nov 2012 20:01:05 +0000 (12:01 -0800)]
i965/fs: Add helper functions for generating ALU ops, like in the VS.
This gives us checking of our arguments (no more passing 1 operand to
BRW_OPCODE_MUL!), at the cost of a couple of extra parens.
v2: Rebase on gen6-if fix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Eric Anholt [Sun, 18 Nov 2012 21:18:03 +0000 (13:18 -0800)]
i965/gen4: Fix crash with fragment programs and texture rectangle.
This was a regression in the brw_fs_fp.cpp change. We just need to return
something good enough to get the IR generation to the end without crashing,
but ir->type isn't initialized and we wanted something of the coordinate's
type anyway.
Fixes around 30 piglit cases on my ilk system in drawpixels and framebuffer
blit.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Thu, 15 Nov 2012 20:00:33 +0000 (12:00 -0800)]
i965: Disable the GB clip test when a limited viewport is set.
The theory of the guardband is that you extend the clip volume to avoid
expensive clipping computation, and just let fragments outside the viewport
get clipped by the drawable's bounds. But if a smaller-than-window-size
viewport is set, and we don't also happen to have a scissor set, then
rendering could incorrectly extend outside of the viewport when it should have
been clipped to the viewport.
Fixes the new piglit triangle-guardband-viewport test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
Eric Anholt [Thu, 15 Nov 2012 19:55:36 +0000 (11:55 -0800)]
i965: Use fewer temporary variables in clip setup.
When you're comparing to the spec, you're trying to immediately see what
numbered dword of the packet your bit ends up in.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
Eric Anholt [Mon, 12 Nov 2012 21:16:02 +0000 (13:16 -0800)]
Revert "i965/fs: Fix conversions float->bool, int->bool"
This reverts commit
cf0bbb30f6bd9d3fa61b5207320e8f34c563a2c6. It
was just papering over the bug fixed in the previous commit.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Mon, 12 Nov 2012 21:13:55 +0000 (13:13 -0800)]
i965/fs: Fix the gen6-specific if handling for
80ecb8f15b9ad7d6edc
Fixes oglconform shad-compiler advanced.TestLessThani.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
NOTE: This is a candidate for the 9.0 branch.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Chad Versace [Mon, 19 Nov 2012 19:43:51 +0000 (11:43 -0800)]
intel: Use designated initializers for DRI extension structs
All Intel code is compiled with -std=c99. There is no excuse to not use
designated initializers.
As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep. I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Chad Versace [Mon, 19 Nov 2012 21:40:00 +0000 (13:40 -0800)]
dri: Use designated initializers for DRI extension structs
The dri directory is compiled with -std=c99. There is no excuse to not use
designated initializers.
As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep. I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Mon, 5 Nov 2012 17:53:31 +0000 (09:53 -0800)]
i965: Use the separate stencil buffer's offsets for stencil setup.
For a packed depth/stencil buffer on separate stencil hardware, the
separate depth miptree is set up with alignment of 4,4 and the separate
stencil miptree is setup with alignment of 8,8. We can't just use the
irb->draw_{x,y} offsets for stencil, since that is the offset in the
depth miptree.
Fixes 12 piglit depthstencil testcases on ivb.
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Sun, 4 Nov 2012 20:47:02 +0000 (12:47 -0800)]
i965: Move all the depth/stencil/hiz offset logic into the workaround.
Given that we have the mask information here (assuming the rebase is to
the same tiling, which is safe), we can just save a set of miptrees and
offsets and the global intra-tile offset in the context and cut out a
bunch of logic. This will also save emitting the next fix I need to do
twice.
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Sun, 4 Nov 2012 22:45:05 +0000 (14:45 -0800)]
i965: When rebasing depth or stencil, update x/y before deciding the other.
Fixes a theoretical problem where we had an aligned depth buffer and a
misaligned stencil buffer with a matching tile offset, so we would fail
to rebase depth even after the needed tile offset changed due to the
rebase of stencil.
It should also fix double-rebase of a misaligned packed depth/stencil
renderbuffer, which may have been a performance issue.
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Thu, 1 Nov 2012 00:00:21 +0000 (17:00 -0700)]
intel: Push face/level -> slice handling to the caller of get_image_offset().
We were always passing 0 for one of the two fields, and the code just used
whichever one wasn't 0.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Wed, 31 Oct 2012 23:57:51 +0000 (16:57 -0700)]
i965: Add some checks for array textures in unsupported paths.
I noticed these in the next patch where these paths were using the Face
of a teximage but didn't have array handling.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Wed, 31 Oct 2012 21:30:13 +0000 (14:30 -0700)]
i965: Add a little bit more debug info for validate blits.
The kind of data you're copying is definitely an interesting variable.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Mon, 5 Nov 2012 22:47:42 +0000 (14:47 -0800)]
intel: Remove dead function prototype.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Wed, 31 Oct 2012 23:25:02 +0000 (16:25 -0700)]
i965: Remove stale comment about wrapped_depth.
I removed that code almost a year ago.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Kenneth Graunke [Sun, 18 Nov 2012 04:51:42 +0000 (20:51 -0800)]
mesa: Mark GetBufferParameteri64v as implemented.
Apparently this was accidentally marked as unimplemented, and thus not
put in the dispatch table.
Fixes 7 es3conform tests:
- copy_buffer_parameters
- copy_buffer_data
- copy_buffer_usage
- pixel_buffer_object_bind
- pixel_buffer_object_parameteriv
- pixel_buffer_object_texture_read
- pixel_buffer_object_usage
v2: Also update the DispatchSanity test for this change.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Sun, 18 Nov 2012 02:45:00 +0000 (18:45 -0800)]
mesa: Require gen'd names in glBeginQuery on ES 3.0.
Only legacy OpenGL allows the use of non-gen'd names. Core profiles
and ES 3 both require the use of glGenQueries().
Note that BeginQuery doesn't exist in ES 1 or ES 2.
Fixes es3conform's occlusion_query_invalid_beginquery test.
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Sun, 18 Nov 2012 07:23:06 +0000 (23:23 -0800)]
mesa: Support EXT_framebuffer_blit targets in ES 3.0 as well.
GL_READ_FRAMEBUFFER and GL_DRAW_FRAMEBUFFER are valid targets in ES 3.
Fixes 23 es3conform framebuffer_blit tests. Two more go from fail to
crash, but that appears to be because they actually run now.
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Thu, 8 Nov 2012 10:24:08 +0000 (02:24 -0800)]
mesa: Fix error code for glTexParameteri of TEXTURE_MAX_LEVEL.
Calling glTexParameteri() with pname GL_TEXTURE_MAX_LEVEL and either a
target of GL_TEXTURE_RECTANGLE or a negative value previously generated
GL_INVALID_OPERATION. However, GL_INVALID_VALUE seems more appropriate.
Fixes oglconform's api-error/negative.glTexParameter and es3conform's
sgis_texture_lod_basic_error.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Kenneth Graunke [Mon, 19 Nov 2012 07:51:47 +0000 (23:51 -0800)]
i965/vs: Don't lose attribute type when converting ATTR to FIXED_HW_REG.
The new brw_reg always had type BRW_REGISTER_TYPE_F, rather than
inheriting the original type of the ATTR file register.
In the past, this hasn't been a problem since we only execute this code
when fixing up GL_FIXED attributes, which always have float types.
However, we'll soon be using it for ARB_vertex_type_10_10_10_2 support,
which uses D and UD types.
Reviewed-by: Eric Anholt <eric@anholt.net>
Chad Versace [Fri, 9 Nov 2012 22:06:41 +0000 (14:06 -0800)]
egl/dri2: Set error code when dri2CreateContextAttribs fails
When dri2CreateContextContextAttribs failed, eglCreateContext returned
NULL yet set the error code to EGL_SUCCESS! The problem was that
eglCreateContext ignored the error code returned by
driCreateContextAttribs.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56706
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Chad Versace [Fri, 9 Nov 2012 22:06:40 +0000 (14:06 -0800)]
i965: Validate requested GLES context version in brwCreateContext
For GLES1 and GLES2, brwCreateContext neglected to validate the requested
context version received from the DRI layer. If DRI requested an OpenGL
ES2 context with version 3.9, we provided it one.
Before this fix, the switch statement that validated the requested GL
context flavor was an ugly #ifdef copy-paste mess. Instead of reproducing
the copy-past-mess for GLES1 and GLES2, I first refactored it. Now the
switch statement is readable.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Maarten Lankhorst [Mon, 19 Nov 2012 08:43:29 +0000 (09:43 +0100)]
automake: strip LLVM_CXXFLAGS and LLVM_CPPFLAGS too
It seems that -NDEBUG and other flags might still be leaked through
those variables, so strip those off there as well.
NOTE: This is a candidate for the 9.0 branch.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Kenneth Graunke [Thu, 15 Nov 2012 04:50:05 +0000 (20:50 -0800)]
i965/fs: Properly patch special values during VGRF compaction.
In addition to registers used by instructions, fs_visitor maintains
direct references to certain "special" values used for inputs/outputs.
When I added VGRF compaction, I overlooked these, believing that these
direct references weren't used once instructions were generated. That
was wrong. For example, pixel_x/y are used in virtual_grf_interferes(),
which is called by optimization passes and register allocation.
This patch treats all of them as used and patches them after compacting.
While it's not strictly necessary to patch all of them (as some aren't
used after emitting code), it seems safer to simply fix them all.
Fixes oglconform's textureswizzle/advanced.shader.targets, piglit's
glsl-fs-lots-of-tex, and glean's texCombine on pre-Gen6 hardware.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56790
Reviewed-by: Eric Anholt <eric@anholt.net>
Eric Anholt [Wed, 14 Nov 2012 22:37:00 +0000 (14:37 -0800)]
i965/gen4: Respect the VERTEX_PROGRAM_TWO_SIDE vertex program/shader flag.
Fixes piglit "vertex-program-two-side enabled front back" and 4 others.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Eric Anholt [Tue, 13 Nov 2012 22:40:22 +0000 (14:40 -0800)]
mesa: Fix linker-assigned varying component counting since
8fb1e4a462
The goal of that change was to skip counting things that aren't actually
outputs from the VS to the FS. However, explicit_location isn't set in
the case of linker-assigned locations (the common case), so basically
varying component counting got disabled. At this stage of the linker,
we've already ensured that var->location is set, so we can just look at
it without worrying.
Fixes i965 assertion failure with the new
piglit glsl-max-varyings --exceed-limits.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51545
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Tue, 13 Nov 2012 21:39:37 +0000 (13:39 -0800)]
mesa: Fix segfault on reading from a missing color read buffer.
The diff looks funny, but it's moving the integer vs non-integer check
below the _mesa_source_buffer_exists() check that ensures
_ColorReadBuffer is non-null, so we get a GL_INVALID_OPERATION instead
of a segfault. This looks like it had regressed in the
_mesa_error_check_format_and_type() changes, which removed the first of
the two duplicated checks for the source buffer. Fixes segfault in the
new piglit ARB_framebuffer_object/negative-readpixels-no-rb.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45877
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Eric Anholt [Tue, 13 Nov 2012 20:45:35 +0000 (12:45 -0800)]
intel: Use core mesa support for determining lastLevel.
We had similar issues with using depth in determining the lastLevel of array
textures.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Tue, 13 Nov 2012 20:45:19 +0000 (12:45 -0800)]
mesa: Also handle GL_TEXTURE_EXTENRAL_OES in max num levels.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Eric Anholt [Thu, 8 Nov 2012 22:02:22 +0000 (14:02 -0800)]
i965/fs: Unify the param pointer allocation for FP/non-FP.
Now that we're using the new backend, we may actually put things into push
constants if you have too many uniform values uploaded. Also, correctly
account for texture rectangle params and drop the old special case for the
0.0/1.0 params from the old backend.
Maarten Lankhorst [Sat, 17 Nov 2012 12:22:39 +0000 (13:22 +0100)]
st/vdpau: Fix vlVdpVideoSurfaceSize for interlaced buffers
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Andreas Boll [Sat, 17 Nov 2012 07:57:00 +0000 (08:57 +0100)]
docs: import release notes for 9.0.1, add news item
Vinson Lee [Thu, 15 Nov 2012 06:25:05 +0000 (22:25 -0800)]
util: Only use open coded snprintf for MSVC.
MinGW has snprintf.
The patch fixes these warnings with the MinGW SCons build.
src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype for ‘util_vsnprintf’ [-Wmissing-prototypes]
src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype for ‘util_snprintf’ [-Wmissing-prototypes]
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Brian Paul <brianp@vmware.com>
Tom Stellard [Mon, 12 Nov 2012 16:04:03 +0000 (16:04 +0000)]
clover: Fix build with clang 3.2
Tom Stellard [Sun, 16 Sep 2012 03:25:34 +0000 (23:25 -0400)]
r300/compiler: Avoid generating MOV instructions for invalid IMM swizzles v2
If an instruction reads from a constant register that contains
immediates using an invalid swizzle, we can avoid generating MOV
instructions to fix up the swizzle by loading the immediates into a
different constant register that can be read using a valid swizzle.
This only affects r300 and r400 cards.
For example:
CONST[1] = { -3.5000 3.5000 2.5000 1.5000 }
MAD temp[4].xy, const[0].xy__, const[1].xz__, input[0].xy__;
========== Before this change would be lowered to: =========
CONST[1] = { -3.5000 3.5000 2.5000 1.5000 }
MOV temp[0].x, const[1].x___;
MOV temp[0].y, const[1]._z__;
MAD temp[4].xy, const[0].xy__, temp[0].xy__, input[0].xy__;
========== After this change is lowered to: ===============
CONST[1] = { -3.5000 3.5000 2.5000 1.5000 }
CONST[2] = { 0.0000 -3.5000 2.5000 0.0000 }
MAD temp[4].xy, const[0].xy__, const[2].yz__, input[0].xy__;
============================================================
This change reduces one of the Lightsmark shaders from 133 to 91
instructions.
v2:
- Fix crash caused by swizzles with only inline constants.
Alex Deucher [Fri, 16 Nov 2012 00:17:34 +0000 (19:17 -0500)]
radeonsi: clean up some magic numbers
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Alex Deucher [Fri, 16 Nov 2012 00:15:53 +0000 (19:15 -0500)]
radeonsi: emit PA_SC_RASTER_CONFIG
Use per asic golden values.
Programming this register doesn't seem to be strictly
necessary on SI, but programming it wrong leads to
rendering issues or reduced performance so just
go ahead and program the golden values explicitly
to avoid any potential problems down the road.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Maarten Lankhorst [Fri, 16 Nov 2012 17:50:57 +0000 (18:50 +0100)]
[PATCH] makefiles: use configured name for -ldrm* where possible
For precise lts support I had to do some magic with the library names, which works fine
as long as the libraries from pkg-config are used.
The parts with src/gallium/targets/va-*/Makefile will not apply on the master branch,
but do apply to the 9.0 branch.
NOTE: This is a candidate for the 9.0 branch.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Andreas Boll [Thu, 15 Nov 2012 10:09:38 +0000 (11:09 +0100)]
docs: add note about removal of OpenVMS support
Matt Turner [Thu, 23 Aug 2012 01:44:54 +0000 (18:44 -0700)]
Remove OpenVMS support
Not maintained since 2008. Doubtful that it's worked in quite a while.
Also see commit
32ac8cb05 which removed VMS stuff from Makefile in 2009.
Cc: Jouk Jansen <j.jansen@tudelft.nl>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Andreas Boll [Thu, 15 Nov 2012 09:11:51 +0000 (10:11 +0100)]
build: add missing Makefile.in files to tarballs target
Those are recently introduced on master.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Andreas Boll [Wed, 14 Nov 2012 22:38:16 +0000 (23:38 +0100)]
build: fix make tarballs target
fixes regression introduced in
907844107252260c646aca361191ef7f121f3d23
Targets for making lex.yy.c program_parse.tab.c and program_parse.tab.h
got moved into its own Makefile
Reviewed-by: Matt Turner <mattst88@gmail.com>
Matt Turner [Thu, 15 Nov 2012 19:56:22 +0000 (11:56 -0800)]
gles2: Update gl2ext.h to revision 19436
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Matt Turner [Thu, 15 Nov 2012 19:55:59 +0000 (11:55 -0800)]
gles2: Update gl2.h to revision 16803
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Matt Turner [Thu, 15 Nov 2012 19:55:16 +0000 (11:55 -0800)]
gles: Update glext.h to revision 19260
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Matt Turner [Thu, 15 Nov 2012 19:54:20 +0000 (11:54 -0800)]
egl: Update eglext.h to revision 19571
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Matt Turner [Tue, 13 Nov 2012 21:49:51 +0000 (13:49 -0800)]
mesa: return INVALID_VALUE from WaitSync if timeout != GL_TIMEOUT_IGNORED
This was added in version 22 of the GL_ARB_sync spec.
Fixes gles3conform's sync_error_waitsync_timeout test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 13 Nov 2012 21:26:11 +0000 (13:26 -0800)]
mesa: return INVALID_VALUE from WaitSync if flags != 0
Fixes gles3conform's sync_error_waitsync_flags test.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 13 Nov 2012 21:26:11 +0000 (13:26 -0800)]
mesa: return INVALID_VALUE from ClientWaitSync if flags contains an unsupported flag
Fixes gles3conform's sync_error_clientwaitsync_flags test.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 13 Nov 2012 21:05:03 +0000 (13:05 -0800)]
mesa: return INVALID_VALUE from VertexAttribDivisor if index out of range
All the other range checks on index already return the proper error,
INVALID_VALUE.
Fixes gles3conform's instanced_arrays_invalid test.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Matt Turner [Tue, 13 Nov 2012 00:45:43 +0000 (16:45 -0800)]
glcpp: Don't define macros for extensions that aren't in ES
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Alex Deucher [Thu, 15 Nov 2012 20:36:46 +0000 (15:36 -0500)]
radeonsi: remove new asserts and replace with warnings
Fixes piglit regressions.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Kenneth Graunke [Sat, 3 Nov 2012 04:24:05 +0000 (21:24 -0700)]
i965/fs: Don't calculate_live_intervals() in opt_algebraic().
There's no point: opt_algebraic() doesn't use any liveness information.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Wed, 14 Nov 2012 22:24:31 +0000 (14:24 -0800)]
i965: Remove duplicate brw_opcodes table in favor of opcode_descs.
brw_optimize.c's brw_opcodes table was a copy of brw_disasm.c's
opcode_descs table, but with an additional field: is_arith. Now that
I've deleted that, the two are identical. Keep the one in brw_disasm.c.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Sun, 11 Nov 2012 05:53:35 +0000 (21:53 -0800)]
i965/vs: Remove dead vec4_visitor::src_reg_for_float prototype.
No such function exists. src_reg's constructor does that.
Reviewed-by: Eric Anholt <eric@anholt.net>