mesa.git
9 years agoi965/state: Add compute pipeline with empty atom lists
Jordan Justen [Sun, 8 Mar 2015 08:08:18 +0000 (00:08 -0800)]
i965/state: Add compute pipeline with empty atom lists

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/state: Only upload render programs for render state uploads
Jordan Justen [Fri, 20 Mar 2015 19:36:21 +0000 (12:36 -0700)]
i965/state: Only upload render programs for render state uploads

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/state: Create separate dirty state bits for each pipeline
Jordan Justen [Sun, 8 Mar 2015 07:21:46 +0000 (23:21 -0800)]
i965/state: Create separate dirty state bits for each pipeline

When clearing the state for a pipeline, we will save changed state for
the other pipelines.

v3:
 * Adjust brw_upload_pipeline_state
   * Don't pull pipeline state bits into common state bits
   * Don't clear pipeline state bits
 * Adjust 'clear' phase
   * brw_clear_dirty_bits is now brw_render_state_finished
   * Move cross-pipeline state flagging to brw_pipeline_state_finished
   * Move pipeline clears to brw_pipeline_state_finished

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/state: Support multiple pipelines in brw->num_atoms
Jordan Justen [Sun, 8 Mar 2015 06:44:39 +0000 (22:44 -0800)]
i965/state: Support multiple pipelines in brw->num_atoms

brw->num_atoms is converted to an array, but currently just an array
of length 1.

Adds brw_copy_pipeline_atoms which copies the atoms for a pipeline,
and sets brw->num_atoms[p] for pipeline p.

v2:
 * Rename brw->atoms[] to render_atoms
 * Rename brw_add_pipeline_atoms to brw_copy_pipeline_atoms
 * Rename brw_pipeline_first_atom to brw_get_pipeline_atoms

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/state: Rename brw_clear_dirty_bits to brw_render_state_finished
Jordan Justen [Wed, 18 Mar 2015 22:43:34 +0000 (15:43 -0700)]
i965/state: Rename brw_clear_dirty_bits to brw_render_state_finished

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/state: Rename brw_upload_state to brw_upload_render_state
Jordan Justen [Sun, 8 Mar 2015 04:20:03 +0000 (20:20 -0800)]
i965/state: Rename brw_upload_state to brw_upload_render_state

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agogallivm: do some hack heuristic to disable texture functions
Roland Scheidegger [Tue, 31 Mar 2015 22:56:12 +0000 (00:56 +0200)]
gallivm: do some hack heuristic to disable texture functions

We've seen some cases where performance can hurt quite a bit.
Technically, the more simple the function the more overhead there is
for using a function for this (and the less benefits this provides).
Hence don't do this if we expect the generated code to be simple.
There's an even more important reason why this hurts performance,
which is shaders reusing the same unit with some of the same inputs,
as llvm cannot figure out the calculations are the same if they
are performned in the function (even just reusing the same unit without
any input being the same provides such optimization opportunities though
not very much). This is something which would need to be handled by IPO
passes however.

9 years agoi965/fs: Allow CSE to handle MULs with negated arguments.
Matt Turner [Wed, 28 Jan 2015 03:18:46 +0000 (19:18 -0800)]
i965/fs: Allow CSE to handle MULs with negated arguments.

mul x, -y is equivalent to mul -x, y; and mul x, y is the negation of
mul x, -y.

With NIR:
total instructions in shared programs: 6167779 -> 6161193 (-0.11%)
instructions in affected programs:     983511 -> 976925 (-0.67%)
helped:                                4106
HURT:                                  16
GAINED:                                18
LOST:                                  7

Without NIR:
total instructions in shared programs: 6192323 -> 6185299 (-0.11%)
instructions in affected programs:     987875 -> 980851 (-0.71%)
helped:                                4146
HURT:                                  16
GAINED:                                16
LOST:                                  0

9 years agoi965: Mark brw_inst_bits' brw_inst* parameter const.
Matt Turner [Sat, 28 Mar 2015 18:01:29 +0000 (11:01 -0700)]
i965: Mark brw_inst_bits' brw_inst* parameter const.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: Remove bogus Makefile dependency.
Matt Turner [Tue, 31 Mar 2015 21:06:56 +0000 (14:06 -0700)]
glsl: Remove bogus Makefile dependency.

9 years agoglsl: Reassociate multiplication of mat*mat*vec.
Matt Turner [Sat, 28 Mar 2015 00:13:51 +0000 (17:13 -0700)]
glsl: Reassociate multiplication of mat*mat*vec.

The typical case of mat4*mat4*vec4 is 80 scalar multiplications, but
mat4*(mat4*vec4) is only 32.

On HSW (with vec4 vertex shaders):
instructions in affected programs:     4420 -> 3194 (-27.74%)

On BDW (with scalar vertex shaders):
instructions in affected programs:     12756 -> 6726 (-47.27%)

Implementing a general matrix chain ordering is harder (or at least
tedious) because of having to walk the GLSL IR to create a list of
multiplicands. I'm guessing that this patch handles 90+% of cases, but
of course to tell definitively you'd have to implement the general
thing.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoglsl: Implement type inferencing of matrix types.
Matt Turner [Fri, 27 Mar 2015 17:45:07 +0000 (10:45 -0700)]
glsl: Implement type inferencing of matrix types.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agoglsl: Factor out a get_mul_type() function.
Matt Turner [Fri, 27 Mar 2015 17:43:05 +0000 (10:43 -0700)]
glsl: Factor out a get_mul_type() function.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agonouveau: synchronize "scratch runout" destruction with the command stream
Marcin Ślusarz [Tue, 31 Mar 2015 20:04:31 +0000 (22:04 +0200)]
nouveau: synchronize "scratch runout" destruction with the command stream

When nvc0_push_vbo calls nouveau_scratch_done it does not mean
scratch buffers can be freed immediately. It means "when hardware
advances to this place in the command stream the scratch buffers
can be freed".

To fix it, just postpone scratch runout destruction after current
fence is signalled.

The bug existed for a very long time. Nobody noticed, because
"scratch runout" code path is rarely executed.

Fixes hang at the very beginning of first mission in "Serious Sam 3"
on nve7/gk107. It manifested as:

nouveau E[   PFIFO][0000:01:00.0] read fault at 0x000a9e0000 [PTE] from GR/GPC0/PE_2 on channel 0x007f853000 [Sam3[17056]]

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agodocs: document Viewperf 12 issues
Brian Paul [Tue, 31 Mar 2015 17:30:32 +0000 (11:30 -0600)]
docs: document Viewperf 12 issues

Signed-off-by: Brian Paul <brianp@vmware.com>
9 years agoi965/skl: Avoid using the 1D stencil layout for stencil-only images
Neil Roberts [Tue, 31 Mar 2015 13:58:28 +0000 (14:58 +0100)]
i965/skl: Avoid using the 1D stencil layout for stencil-only images

Commit cf67ca9ffa9 made the layouting code pick a special layout for
1D images on Skylake. This should not be used for depth and stencil
buffers because these need to be treated as 2D tiled images. However
the patch was missing a check for images with a base format of
GL_STENCIL_INDEX. In practice I don't think it's currently possible to
hit this because Mesa doesn't support GL_ARB_texture_stencil8 and it's
not possible to create a 1D renderbuffer, but it'll be good to be
ready for when the extension is supported.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoclover: Return CL_BUILD_ERROR for CL_PROGRAM_BUILD_STATUS when compilation fails v2
Tom Stellard [Tue, 24 Mar 2015 17:17:22 +0000 (17:17 +0000)]
clover: Return CL_BUILD_ERROR for CL_PROGRAM_BUILD_STATUS when compilation fails v2

v2:
  - Don't use _errs map

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoradeonsi/compute: Default to the same PIPE_SHADER_CAP values as other shader types v2
Tom Stellard [Sat, 21 Mar 2015 00:27:16 +0000 (00:27 +0000)]
radeonsi/compute: Default to the same PIPE_SHADER_CAP values as other shader types v2

v2:
  - Fix typo

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeon/vce: implement video usability information support
Leo Liu [Mon, 30 Mar 2015 17:33:19 +0000 (13:33 -0400)]
radeon/vce: implement video usability information support

This will help encoding VUI into the bitstream

v2: make backward compatible

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agost/omx/enc: export framerate to vce driver
Leo Liu [Mon, 30 Mar 2015 17:25:15 +0000 (13:25 -0400)]
st/omx/enc: export framerate to vce driver

The framerate will be used for video usability info support by VCE driver

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agollvmpipe: enable ARB_texture_gather
Roland Scheidegger [Tue, 31 Mar 2015 15:23:17 +0000 (17:23 +0200)]
llvmpipe: enable ARB_texture_gather

Just announce support for 4 components.
While here also increase the max/min texel offsets (the limit is completely
artificial, was chosen because that's what other hardware did, however there's
other drivers using larger limits).
Over a thousand little piglits skip->pass.

v2: update docs/GL3.txt

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: implement TG4 for ARB_texture_gather
Roland Scheidegger [Sun, 29 Mar 2015 21:40:31 +0000 (23:40 +0200)]
gallivm: implement TG4 for ARB_texture_gather

This is quite trivial, essentially just follow all the same code you'd
use with linear min/mag (and no mip) filter, then just skip the filtering
after looking up the texels in favor of direct assignment of the right channel
to the result. (This is though not true for the multi-offset version if we'd
want to support it - for this would probably need to do something along the
lines of 4x nearest sampling due to the necessity of doing coord wrapping
individually per texel.)
Supports multi-channel formats.
From the SM5 gather cap bit, should support non-constant offsets, plus shadow
comparisons (the former untested), but not component selection (should be
easy to implement but all this stuff is not really exposable anyway for now).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: add gather support to sampler interface
Roland Scheidegger [Sun, 29 Mar 2015 21:21:56 +0000 (23:21 +0200)]
gallivm: add gather support to sampler interface

Luckily thanks to the revamped interface this is a lot less work now...

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: simplify sampler interface
Roland Scheidegger [Sat, 28 Mar 2015 19:51:23 +0000 (20:51 +0100)]
gallivm: simplify sampler interface

This has got a bit out of control with more and more parameters added.
Worse, whenever something in there changes all callees have to be updated
for that, even though they don't really do much with any parameter in there
except pass it on to the actual sampling function.
Hence simply put almost everything into a struct. Also instead of relying
on some arguments being NULL, be explicit and set this in a key (which is
just reused for function generation for simplicity). (The code still relies
on them being NULL in the end for now.)
Technically there is a minimal functional change here for shadow sampling:
if shadow sampling is done is now determined explicitly by the texture
function (either sample_c or the gl-style tex func inherit this from target)
instead of the static texture state. These two should always match, however.
Otherwise, it should generate all the same code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoutil/debug: Update MgwHelp link, drop BfdHelp link.
Jose Fonseca [Wed, 18 Mar 2015 22:06:44 +0000 (22:06 +0000)]
util/debug: Update MgwHelp link, drop BfdHelp link.

9 years agogallivm: Fix build against LLVM 3.7 SVN r233648
Michel Dänzer [Tue, 31 Mar 2015 06:05:01 +0000 (15:05 +0900)]
gallivm: Fix build against LLVM 3.7 SVN r233648

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agovc4: Drop integer multiplies with 0 to moves of 0.
Eric Anholt [Mon, 30 Mar 2015 17:44:28 +0000 (10:44 -0700)]
vc4: Drop integer multiplies with 0 to moves of 0.

This cleans up more instructions generated by uniform array indexing
multiplies.

total instructions in shared programs: 39989 -> 39961 (-0.07%)
instructions in affected programs:     896 -> 868 (-3.12%)

9 years agovc4: Add a constant folding pass.
Eric Anholt [Mon, 30 Mar 2015 17:38:21 +0000 (10:38 -0700)]
vc4: Add a constant folding pass.

This cleans up some pointless operations generated by the in-driver mul24
lowering (commonly generated by making a vec4 index for a matrix in a
uniform array).

I could fill in other operations, but pretty much anything else ought to
be getting handled at the NIR level, I think.

total uniforms in shared programs: 13423 -> 13421 (-0.01%)
uniforms in affected programs:     346 -> 344 (-0.58%)

9 years agoglsl: allow ForceGLSLVersion to override #version directives
Brian Paul [Fri, 27 Mar 2015 16:54:10 +0000 (10:54 -0600)]
glsl: allow ForceGLSLVersion to override #version directives

Previously, the ctx->Const.ForceGLSLVersion setting only worked if
the shader lacked a #version directive.  Now, the ForceGLSLVersion
setting will override the #version directive too.

This change should be safe since it should be rare to have an app
that has a mix of shader versions and we only wanted to override
the #version for shaders which lacked the #version directive.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agovc4: Don't bother masking out the low 24 bits for integer multiplies
Eric Anholt [Mon, 30 Mar 2015 04:26:16 +0000 (21:26 -0700)]
vc4: Don't bother masking out the low 24 bits for integer multiplies

The hardware just uses the low 24 lines, saving us an AND to drop the high
bits.

total uniforms in shared programs: 13433 -> 13423 (-0.07%)
uniforms in affected programs:     356 -> 346 (-2.81%)
total instructions in shared programs: 40003 -> 39989 (-0.03%)
instructions in affected programs:     910 -> 896 (-1.54%)

9 years agovc4: Make integer multiply use 24 bits for the low parts.
Eric Anholt [Mon, 30 Mar 2015 04:21:10 +0000 (21:21 -0700)]
vc4: Make integer multiply use 24 bits for the low parts.

The hardware uses the low 24 bits in integer multiplies, so we can have
fewer high bits (and so probably drop them more frequently).

9 years agoglsl: fail when a shader's input var has not an equivalent out var in previous
Samuel Iglesias Gonsalvez [Fri, 28 Nov 2014 10:23:20 +0000 (11:23 +0100)]
glsl: fail when a shader's input var has not an equivalent out var in previous

GLSL ES 3.00 spec, 4.3.10 (Linking of Vertex Outputs and Fragment Inputs),
page 45 says the following:

"The type of vertex outputs and fragment input with the same name must match,
otherwise the link command will fail. The precision does not need to match.
Only those fragment inputs statically used (i.e. read) in the fragment shader
must be declared as outputs in the vertex shader; declaring superfluous vertex
shader outputs is permissible."
[...]
"The term static use means that after preprocessing the shader includes at
least one statement that accesses the input or output, even if that statement
is never actually executed."

And it includes a table with all the possibilities.

Similar table or content is present in other GLSL specs: GLSL 4.40, GLSL 1.50,
etc but for more stages (vertex and geometry shaders, etc).

This patch detects that case and returns a link error. It fixes the following
dEQP test:

  dEQP-GLES3.functional.shaders.linkage.varying.rules.illegal_usage_1

However, it adds a new regression in piglit because the test hasn't a
vertex shader and it checks the link status.

bin/glslparsertest \
tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom pass \
1.50 --check-link

This piglit test is wrong according to the spec wording above, so if this patch
is merged it should be updated.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
9 years agoradeonsi: Cache LLVMTargetMachineRef in context instead of in screen
Michel Dänzer [Thu, 26 Mar 2015 02:32:59 +0000 (11:32 +0900)]
radeonsi: Cache LLVMTargetMachineRef in context instead of in screen

Fixes a crash in genymotion with several threads compiling shaders
concurrently.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89746

Cc: 10.5 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agoglsl: fix unreachable(!"") to unreachable("")
Tapani Pälli [Mon, 30 Mar 2015 04:59:53 +0000 (07:59 +0300)]
glsl: fix unreachable(!"") to unreachable("")

Correct error with commit 151fb1e where assert was renamed
to unreachable without removing ! from string argument.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agodocs: add news item and link release notes for mesa 10.5.2
Emil Velikov [Sat, 28 Mar 2015 19:01:15 +0000 (19:01 +0000)]
docs: add news item and link release notes for mesa 10.5.2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add sha256 sums for the 10.5.2 release
Emil Velikov [Sat, 28 Mar 2015 18:50:31 +0000 (18:50 +0000)]
docs: Add sha256 sums for the 10.5.2 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit ff87ae1e003be7104d3550250af3343c01cea882)

9 years agoAdd release notes for the 10.5.2 release
Emil Velikov [Sat, 28 Mar 2015 18:42:51 +0000 (18:42 +0000)]
Add release notes for the 10.5.2 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 5e59f895c468c1ac497ad925b8bddd7f227c89a2)

9 years agofreedreno/a3xx: add support for point sprite coordinate replacement
Ilia Mirkin [Tue, 17 Mar 2015 05:34:33 +0000 (01:34 -0400)]
freedreno/a3xx: add support for point sprite coordinate replacement

This does not (yet) support different coordinate origins, so the tests
still fail due to fbo flipping.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agofreedreno/a3xx: make vs-set point size work
Ilia Mirkin [Tue, 17 Mar 2015 05:02:32 +0000 (01:02 -0400)]
freedreno/a3xx: make vs-set point size work

This appears to need the A2XX version of the point list, so select it at
draw time if necessary.

Experimentally, always using the A2XX version causes hangs when PSIZE
isn't actually emitted.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agofreedreno/a3xx: point size should not be divided by 2
Ilia Mirkin [Tue, 17 Mar 2015 05:00:38 +0000 (01:00 -0400)]
freedreno/a3xx: point size should not be divided by 2

The division is probably a holdover from the days when the fixed point
inline functions generated by headergen were broken.

Also reduce the maximum point size to 4092 (vs 4096), which is what the
blob does.

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agofreedreno/a3xx: fix 3d texture layout
Ilia Mirkin [Sun, 15 Mar 2015 20:38:42 +0000 (16:38 -0400)]
freedreno/a3xx: fix 3d texture layout

The SZ2 field contains the layer size of a lower miplevel. It only
contains 4 bits, which limits the maximum layer size it can describe. In
situations where the next miplevel would be too big, the hardware
appears to keep minifying the size until it hits one of that size.
Unfortunately the hardware's ideas about sizes can differ from
freedreno's which can still lead to issues. Minimize those by stopping
to minify as soon as possible.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
9 years agofreedreno/a3xx: LAYERSZ2 appears to have no effect on arrays
Ilia Mirkin [Fri, 13 Mar 2015 22:01:11 +0000 (18:01 -0400)]
freedreno/a3xx: LAYERSZ2 appears to have no effect on arrays

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonir: Fix copy and pasted error message in nir_validate.
Kenneth Graunke [Sat, 28 Mar 2015 01:22:20 +0000 (18:22 -0700)]
nir: Fix copy and pasted error message in nir_validate.

These are nir_cf_nodes, not ALU instructions.
Also, use unreachable() to preempt said review feedback.

v2: Do it right (thanks Ilia).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir: Use NIR for ARB_vertex_program support on Gen8+.
Kenneth Graunke [Wed, 25 Mar 2015 22:16:30 +0000 (15:16 -0700)]
i965/nir: Use NIR for ARB_vertex_program support on Gen8+.

Everything is already in place; we simply have to take the scalar code
generation path.  This gives us SIMD8 VS programs, instead of SIMD4x2.

v2: Rebase on the patch that drops brw->gen >= 8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965: Move env_var_as_boolean to intel_debug.c.
Kenneth Graunke [Fri, 27 Mar 2015 20:48:44 +0000 (13:48 -0700)]
i965: Move env_var_as_boolean to intel_debug.c.

I need to use this in brw_vec4.cpp, so it can't be static anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Add ARB_fragment_program support to the NIR backend.
Kenneth Graunke [Fri, 30 Jan 2015 09:16:49 +0000 (01:16 -0800)]
i965/fs: Add ARB_fragment_program support to the NIR backend.

Use prog_to_nir where we would normally call glsl_to_nir, handle program
parameter lists, and skip a few things that don't exist.

Using NIR generates much better shader code than Mesa IR, since we get
real optimizations, as opposed to prog_optimize:

total instructions in shared programs: 314007 -> 279892 (-10.86%)
instructions in affected programs:     285173 -> 251058 (-11.96%)
helped:                                2001
HURT:                                  67
GAINED:                                4
LOST:                                  7

v2: Change early return in nir_setup_uniforms to if/else (Jordan).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Lower subtraction to add with negation when !lower_negate.
Kenneth Graunke [Wed, 25 Mar 2015 22:22:12 +0000 (15:22 -0700)]
nir: Lower subtraction to add with negation when !lower_negate.

prog->nir will generate fsub opcodes, but i965 doesn't implement them.
We may as well lower them at the NIR level, since it's trivial to do.

Suggested by Connor Abbott.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agonir: Implement a Mesa IR -> NIR translator.
Kenneth Graunke [Fri, 30 Jan 2015 07:22:08 +0000 (23:22 -0800)]
nir: Implement a Mesa IR -> NIR translator.

Shamelessly ripped off from Eric Anholt's tgsi_to_nir pass.

This is not built on SCons, like the rest of NIR.

v2:
- Delete redundant c->s, c->impl, and c->cf_node_list pointers (Ken)
- Use nir_builder directly instead of ptn_compile in more places (Ken)
- Drop 'struct' keyword in front of nir_builder (ken)
- Add a file level Doxygen comment (Ken)
- Use scalar constants instead of splatting (Eric)
- Use nir_builder helpers for constants, moves, and swizzles (Connor)

v3: Minor indentation improvements.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agonir: Add builder helpers for MOVs with ALU sources and swizzling MOVs.
Kenneth Graunke [Wed, 25 Mar 2015 21:51:02 +0000 (14:51 -0700)]
nir: Add builder helpers for MOVs with ALU sources and swizzling MOVs.

These will be useful for prog->nir and tgsi->nir.

v2: Don't forget to mark nir_swizzle as inline (Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agonir: Add nir_builder helpers for creating load_const intrinsics.
Kenneth Graunke [Wed, 25 Mar 2015 09:11:52 +0000 (02:11 -0700)]
nir: Add nir_builder helpers for creating load_const intrinsics.

Both prog->nir and tgsi->nir will want to use these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoi965/skl: Don't use the PMA depth stall workaround
Ben Widawsky [Wed, 25 Mar 2015 23:52:46 +0000 (16:52 -0700)]
i965/skl: Don't use the PMA depth stall workaround

The PMA depth stall must be enabled (optimization turned off) under certain
circumstances on gen8. This was supposedly fixed for Gen9, which means we do not
need to check, or toggle the state. The hardware is supposed to enable the
hardware optimization by default, unlike BDW, so we also don't need to set it at
init. For whatever reason this improves stability on ETQW with the bug mentioned
below.

References: https://bugs.freedesktop.org/show_bug.cgi?id=89039 (doesn't fix)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Anuj Phogat <anuj.phogat@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/skl: Disable partial resolve in VC
Ben Widawsky [Fri, 27 Feb 2015 02:14:17 +0000 (18:14 -0800)]
i965/skl: Disable partial resolve in VC

Recomendation [sic] is to set this field to 1 always. Programming it to default
value of 0, may have -ve impact on performance for MSAA WLs.

Another don't suck bit which needs to get set.

The patch wasn't as well tested as I would have liked, primarily I don't have
perf numbers for it, but it's getting to a point where it is in danger of being
lost.

v2: v1 was a mix of two patches. Since 0x7004 is masked, we only need to set it
once at initialization and make sure the pma workaround doesn't set the mask bit
(which it doesn't).
Move LRI to init gpu state (Ken)
Add a comment.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agollvmpipe: simplify address calculation for 4x4 blocks
Roland Scheidegger [Fri, 27 Mar 2015 15:49:54 +0000 (16:49 +0100)]
llvmpipe: simplify address calculation for 4x4 blocks

These functions looked quite complicated, even though what they actually did
was trivial (ever since we dropped swizzled rendering). Also drop lookup of
format block per bytes done for each block, and do it once per scene instead.
This improves everybody's favorite "benchmark" by 3% or so, though
lp_rast_shade_quads_all() which calls this shows up still quite high for a
function which does little more than call the jit function.
(This would most likely be much better handled by the jit function itself,
the strides are passed through anyway already, though for being able to
handle layers it would definitely add some complexity.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: fix texture function name (key) when using txf/ld
Roland Scheidegger [Sat, 28 Mar 2015 01:57:13 +0000 (02:57 +0100)]
gallivm: fix texture function name (key) when using txf/ld

When using the texel fetch functions rather than ordinary texturing,
the arguments are all int vecs instead of float vecs, not to mention
the actual function would look completely different. Hence this must
be included in the texture function name (which serves as the key)
otherwise things crash badly when a shader accesses the same texture
and sampler unit with both txf/ld and ordinary texturing instructions
with otherwise matching keys.

9 years agoglsl: mark uniform and input interface blocks as read only
Timothy Arceri [Fri, 27 Mar 2015 12:03:40 +0000 (23:03 +1100)]
glsl: mark uniform and input interface blocks as read only

Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agonv50/ir/gk110: fix offset flag position for TXD opcode
Ilia Mirkin [Fri, 27 Mar 2015 22:38:24 +0000 (18:38 -0400)]
nv50/ir/gk110: fix offset flag position for TXD opcode

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonv50/ir: take postFactor into account when doing peephole optimizations
Ilia Mirkin [Wed, 25 Mar 2015 22:00:00 +0000 (18:00 -0400)]
nv50/ir: take postFactor into account when doing peephole optimizations

Multiply operations can have a post-factor on them, which other ops
don't support. Only perform the peephole optimizations when there is no
post-factor involved.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89758
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agogallivm: Fix build since llvm r233411
Jan Vesely [Fri, 27 Mar 2015 22:45:23 +0000 (18:45 -0400)]
gallivm: Fix build since llvm r233411

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agonir: Add optional lowering of flrp.
Eric Anholt [Wed, 18 Feb 2015 20:24:38 +0000 (12:24 -0800)]
nir: Add optional lowering of flrp.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agogallivm: use llvm function calls for texturing instead of inlining
Roland Scheidegger [Fri, 27 Mar 2015 01:39:59 +0000 (02:39 +0100)]
gallivm: use llvm function calls for texturing instead of inlining

There are issues with inlining everything, most notably llvm will use much
more memory (and be slower) when compiling. Ideally we'd probably use
functions for shader functions too but texture sampling usually is responsible
for quite some IR (it can easily reach 80% of total IR instructions) so this
seems like a good start.
This still generates a different function for all different combinations just
like before, however it is possible llvm is missing some optimization
opportunities - it is believed though such opportunities should be somewhat
rare, but at least for now it can still be switched off (at compile time only).
It should probably make compiled code also smaller because the same function
should be used for different variants in the same module (so for the
opaque/partial or linear/elts variants).
No piglit change (though it does indeed speed up unrealistic tests like
fp-indirections2 by a factor of 30 or so).
Has a small negative performance impact in openarena - I suspect this could
be fixed by running some IPO passes (despite the private linkage, llvm right
now does NO optimization at all wrt anything going past the call, even if
there's just one caller - so things like values stored before the call and then
always written by the function etc. will not be optimized away, nor will dead
arguments (which we mostly shouldn't have) be eliminated, always constant
arguments promoted etc.).

v2: use proper return values instead of pointer function arguments.
llvm supports aggregate return values, which do wonders here eliminating
unnecessary stack variables - everything in fact will be returned in registers
even without any IPO optimizations. It makes the code simpler too.
With this I could not measure a peformance impact in openarena any longer
(though since there's still no constant value propagation etc. into the tex
functions this does not mean it couldn't have a negative impact elsewhere).

v3: fix some minor issues suggested by Jose, and do disassembly (and the
profiling) without hacks.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: pass jit_context pointer through to sampling
Roland Scheidegger [Wed, 25 Mar 2015 02:10:10 +0000 (03:10 +0100)]
gallivm: pass jit_context pointer through to sampling

The callbacks used for getting the dynamic texture/sampler state were using
the jit_context from the generated jit function. This works just fine, however
that way it's impossible to generate separate functions for texture sampling,
as will be done in the next commit. Hence, pass this pointer through all
interfaces so it can be passed to a separate function (technically, it would
probably be possible to extract this pointer from the current function instead,
but this feels hacky and would probably require some more hacks if we'd use
real functions instead of inlining all shader functions at some point).
There should be no difference in the generated code for now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallium/vl: partially revert "Use util_cpu_to_le{16,32} in many more places."
Christian König [Thu, 26 Mar 2015 13:49:18 +0000 (14:49 +0100)]
gallium/vl: partially revert "Use util_cpu_to_le{16,32} in many more places."

The data in memory is in big endian format and needs to be converted
into CPU byte order. So the patch actually reversed what needs to be done.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agotgsi: fix out-of-bounds access for cube arrays
Ilia Mirkin [Thu, 26 Mar 2015 23:06:37 +0000 (19:06 -0400)]
tgsi: fix out-of-bounds access for cube arrays

The CUBE_ARRAY case uses r[4]. Make sure that the stack variable is
there.

Noticed by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agost/mesa: initialize have_fma in constructor
Ilia Mirkin [Thu, 26 Mar 2015 23:33:01 +0000 (19:33 -0400)]
st/mesa: initialize have_fma in constructor

Spotted by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium/util: remove u_linkage
Ilia Mirkin [Thu, 26 Mar 2015 23:26:38 +0000 (19:26 -0400)]
gallium/util: remove u_linkage

Does not appear to be used in tree. Coverity spotted some errors in the
bitmask stuff, but the whole thing appears to be unused.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium/hud: avoid overflowing hud graph name size
Ilia Mirkin [Thu, 26 Mar 2015 23:37:50 +0000 (19:37 -0400)]
gallium/hud: avoid overflowing hud graph name size

Spotted by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agost/mesa: update arrays when the current attrib has been updated
Ilia Mirkin [Thu, 26 Mar 2015 19:14:22 +0000 (15:14 -0400)]
st/mesa: update arrays when the current attrib has been updated

Fixes the recently-sent gl-2.0-vertex-const-attr piglit test. Makes sure
to revalidate arrays when only the current attribute has been updated
via glVertexAttrib*.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89754
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
9 years agost_glsl_to_tgsi: only do mov copy propagation on temps (v2)
Dave Airlie [Wed, 25 Mar 2015 23:17:39 +0000 (09:17 +1000)]
st_glsl_to_tgsi: only do mov copy propagation on temps (v2)

Don't propagate ARRAYs

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=89759

v2: just specify arrays so we get input propagation
Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agoi965: Drop unnecessary brw->gen >= 8 check from scalar VS code.
Kenneth Graunke [Wed, 25 Mar 2015 22:15:43 +0000 (15:15 -0700)]
i965: Drop unnecessary brw->gen >= 8 check from scalar VS code.

brw->scalar_vs already implies that brw->gen >= 8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/fs: Implement texture projection support.
Kenneth Graunke [Sun, 1 Feb 2015 07:36:52 +0000 (23:36 -0800)]
i965/fs: Implement texture projection support.

Our fragment program backend implements support for TXP directly, and
there's no NIR lowering pass to remove the projection.  When we switch
fragment program support over to NIR, we need to support it somehow.

It's easy enough to support directly.

v2: Split out offset/tex_offset rename (requested by Jordan).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/fs: Rename offset to tex_offset to avoid shadowing offset().
Kenneth Graunke [Wed, 25 Mar 2015 20:12:20 +0000 (13:12 -0700)]
i965/fs: Rename offset to tex_offset to avoid shadowing offset().

fs_visitor::nir_emit_texture() created an fs_reg variable called offset,
which shadowed the offset() helper function in brw_ir_fs.h.

Rename the variable to tex_offset so we can still call offset().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agonir: Add glsl_float_type() wrapper.
Kenneth Graunke [Tue, 24 Feb 2015 03:56:00 +0000 (19:56 -0800)]
nir: Add glsl_float_type() wrapper.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Use INFINITY instead of std::numeric_limits<float>::infinity().
Matt Turner [Tue, 13 Jan 2015 06:35:53 +0000 (22:35 -0800)]
glsl: Use INFINITY instead of std::numeric_limits<float>::infinity().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoautomake: add missing egl files to the tarball
Emil Velikov [Sat, 21 Mar 2015 20:45:22 +0000 (20:45 +0000)]
automake: add missing egl files to the tarball

Namely the Haiku EGL driver backend and the SConscript for the dri2 EGL
driver backend.

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglsl: Constify ir_instruction::equals
Ian Romanick [Thu, 19 Mar 2015 02:00:48 +0000 (19:00 -0700)]
glsl: Constify ir_instruction::equals

v2: Don't be lazy.  Constify the as_foo functions and use those instead
of ugly casts.  Suggested by Curro.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: Constify the as_foo functions
Ian Romanick [Tue, 24 Mar 2015 16:14:35 +0000 (09:14 -0700)]
glsl: Constify the as_foo functions

Now that they're all implemented using macros, this is trivial.

v2: Remove redundant parenthesis.  Suggested by Curro.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: Implement remaining as_foo functions with macros
Ian Romanick [Tue, 24 Mar 2015 16:02:24 +0000 (09:02 -0700)]
glsl: Implement remaining as_foo functions with macros

The downcast functions for non-leaf classes were previously implemented
"by hand."  Now they are implemented using macros based on the is_foo
functions added in the previous patch.

v2: Remove redundant parenthesis.  Suggested by Curro (on the next
patch).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: Add is_rvalue, is_dereference, and is_jump methods
Ian Romanick [Tue, 24 Mar 2015 15:55:15 +0000 (08:55 -0700)]
glsl: Add is_rvalue, is_dereference, and is_jump methods

These functions deteremine when an IR node is one of the non-leaf
classes.

v2: Adjust indentation to line up.  Suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoutil/u_atomic: Ignore warnings interlocked accesses.
Jose Fonseca [Tue, 24 Mar 2015 19:56:21 +0000 (19:56 +0000)]
util/u_atomic: Ignore warnings interlocked accesses.

These are due how we implemented the atomic tests, not the atomic
implementation itself.  It's also difficult to refactor the code to
avoid the warnings due to the use of macros -- the code would be quite
hairy.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Disable MSVC warnings about inconsistent function annotation.
Jose Fonseca [Tue, 24 Mar 2015 19:50:48 +0000 (19:50 +0000)]
scons: Disable MSVC warnings about inconsistent function annotation.

Somehow, merely including any of the *intrin.h headers causes dozens of
this warnings (when compiling pretty much every source file).  MSVC does
not always complain the same -- so it's possible we're doing something
weird --, but silence these warnings in the meanwhile.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Avoid MSVC C6334 warning in /analyze mode.
Jose Fonseca [Tue, 24 Mar 2015 19:01:46 +0000 (19:01 +0000)]
mesa: Avoid MSVC C6334 warning in /analyze mode.

MSVC's implementation of signbit(x) uses sizeof(x) with expressions to
dispatch to an internal function based on the argument's type (float,
double, etc), but that raises a flag with MSVC's own static analyzer,
and because this is an inline function in a header it causes substantial
warning spam.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoc99_math: Don't reimplement lrint and friends on MSVC 2013.
Jose Fonseca [Tue, 24 Mar 2015 13:16:24 +0000 (13:16 +0000)]
c99_math: Don't reimplement lrint and friends on MSVC 2013.

MSVC 2013 declares these functions, both for C and C++ source files.

This was caught with MSVC in analyze mode.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Don't build osmesa.
Jose Fonseca [Tue, 24 Mar 2015 20:30:03 +0000 (20:30 +0000)]
scons: Don't build osmesa.

There doesn't seem much interest on osmesa on Windows, particularly classic osmesa.

If there is indeed interest in osmesa on Windows, we should instead
integrate src/gallium/targets/osmesa into SCons.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Don't build loader on Windows.
Jose Fonseca [Tue, 24 Mar 2015 20:26:21 +0000 (20:26 +0000)]
scons: Don't build loader on Windows.

EGL was the last user.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Don't build egl on Windows.
Jose Fonseca [Tue, 24 Mar 2015 20:11:36 +0000 (20:11 +0000)]
scons: Don't build egl on Windows.

Useless, as there are no drivers for it.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Fix git_sha1.h generation fallback.
Jose Fonseca [Mon, 23 Mar 2015 10:48:31 +0000 (10:48 +0000)]
scons: Fix git_sha1.h generation fallback.

I didn't meant to remove the 'if not os.path.exists(filename)' statement.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agodocs: Update progress on ARB_direct_state_access.
Martin Peres [Thu, 19 Mar 2015 17:44:56 +0000 (19:44 +0200)]
docs: Update progress on ARB_direct_state_access.

v2:
- Fix the state of the Program pipelines and Query objects (Laura)

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry points for NamedRenderbufferStorage/Multisample
Martin Peres [Fri, 13 Feb 2015 13:35:48 +0000 (15:35 +0200)]
main: Added entry points for NamedRenderbufferStorage/Multisample

v2: Review from Laura Ekstrand
- get rid of a change that should not have happened in this patch
- improve the error messages
- fix alignments
- fix a capitalization in a function name in an error message

v3: Review from Laura Ekstrand
- move the test for the validity of the renderbuffer to less generic
  functions
- get rid of some changes that accidentally landed in the wrong commit
- revert some alignment fixes

v3: Review from Laura Ekstrand
- check that the lookup returns a valid renderbuffer
- cosmetic changes to some error messages

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetNamedRenderbufferParameteriv
Martin Peres [Fri, 13 Feb 2015 13:46:55 +0000 (15:46 +0200)]
main: Added entry point for glGetNamedRenderbufferParameteriv

v2:
- improve an error message

v3:
- move a test to less generic functions
- fix an alignment

v4:
- take the caller as a parameter instead of bool dsa
- check that the lookup returns a valid renderbuffer

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateRenderbuffers
Martin Peres [Thu, 12 Feb 2015 16:52:10 +0000 (18:52 +0200)]
main: Added entry point for glCreateRenderbuffers

v2:
- refactor bindRenderBuffer and create_render_buffers to fix an assertion

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateSamplers
Martin Peres [Thu, 12 Feb 2015 11:12:19 +0000 (13:12 +0200)]
main: Added entry point for glCreateSamplers

Because of the current way the code is architectured, there is no
functional difference between the DSA and the non-DSA path.

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateProgramPipelines
Martin Peres [Wed, 11 Feb 2015 16:12:21 +0000 (18:12 +0200)]
main: Added entry point for glCreateProgramPipelines

v2:
- add spaces in an error message (Laura)

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry points for glGetQueryBufferObject*
Martin Peres [Mon, 16 Feb 2015 10:20:19 +0000 (12:20 +0200)]
main: Added entry points for glGetQueryBufferObject*

These entry points will be fleshed out when the GL_ARB_query_buffer_object
extension gets implemented. In the meantime, return GL_INVALID_OPERATION as
suggested by Ian.

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateQueries
Martin Peres [Tue, 10 Feb 2015 15:13:06 +0000 (17:13 +0200)]
main: Added entry point for glCreateQueries

v2:
- display the name of the target instead of its id (Laura)

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetTransformFeedbacki64_v
Martin Peres [Thu, 22 Jan 2015 14:55:29 +0000 (16:55 +0200)]
main: Added entry point for glGetTransformFeedbacki64_v

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

v4: Review from Laura Ekstrand
- fix some alignement problems

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetTransformFeedbacki_v
Martin Peres [Mon, 16 Feb 2015 14:13:59 +0000 (16:13 +0200)]
main: Added entry point for glGetTransformFeedbacki_v

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetTransformFeedbackiv
Martin Peres [Mon, 16 Feb 2015 14:13:58 +0000 (16:13 +0200)]
main: Added entry point for glGetTransformFeedbackiv

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glTransformFeedbackBufferRange
Martin Peres [Wed, 21 Jan 2015 10:22:11 +0000 (12:22 +0200)]
main: Added entry point for glTransformFeedbackBufferRange

v2: review from Laura Ekstrand
- use the refactored code to lookup the objects
- improve some error messages
- factor out the gl method name computation
- better handle the spec differences between the DSA and non-DSA cases
- quote the spec a little more

v3: review from Laura Ekstrand
- use the new name of _mesa_lookup_bufferobj_err
- swap the comments around the offset and size checks

v4: review from Laura Ekstrand
- add more spec quotes
- properly fix the comments around the offset and size checks

v5: review from Laura Ekstrand
- add quotes on the spec citations
- revert some changes in the printf format

v6: review from Laura Ekstrand
- remove a redondant "gl" in a method name

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
9 years agomain: Added entry point for glTransformFeedbackBufferBase
Martin Peres [Tue, 20 Jan 2015 14:30:32 +0000 (16:30 +0200)]
main: Added entry point for glTransformFeedbackBufferBase

v2: Review from Laura Ekstrand
- give more helpful error messages
- factor the lookup code for the xfb and objBuf
- replace some already-existing tabs with spaces
- add comments to explain the cases where xfb == 0 or buffer == 0
- fix the condition for binding the transform buffer or not

v3: Review from Laura Ekstrand
- rename _mesa_lookup_bufferobj_err to
  _mesa_lookup_transform_feedback_bufferobj_err and make it static to avoid a
  future conflict
- make _mesa_lookup_transform_feedback_object_err static

v4: Review from Laura Ekstrand
- add the pdf page number when quoting the spec
- rename some of the symbols to follow the public/private conventions

v5: Review from Laura Ekstrand
- properly rename some of the symbols to follow the public/private conventions
- fix some alignments
- add quotes around a spec citation
- add back a newline I accidentally deleted
- add spaces around the ternary operator usages

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
9 years agomain: Added entry point for glCreateTransformFeedbacks
Martin Peres [Wed, 14 Jan 2015 16:17:21 +0000 (18:17 +0200)]
main: Added entry point for glCreateTransformFeedbacks

v2: Review from Laura Ekstrand
- generate the name of the gl method once
- shorten some lines to stay in the 78 chars limit

v3: Review from Fredrik Höglund <fredrik@kde.org>
- rename gl_mthd_name to func
- set EverBound in _mesa_create_transform_feedbacks in the dsa case

v4:
- rename _mesa_create_transform_feedbacks to create_transform_feedbacks and
  make it static

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>