docs: initial 9.3 release notes file

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
mesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ES

There is no GL_TEXTURE_CUBE_MAP_SEAMLESS in any version of OpenGL ES or
in any extension that applies to OpenGL ES.  The same error check
already occurs for glTexParameteri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Cc: Maxence Le Dore <maxence.ledore@gmail.com>
mesa: Always use seamless cubemap filtering in GLES3

Appendix F.2 of the OpenGL ES 3.0.0 spec says:

    "OpenGL ES 3.0 requires that all cube map filtering be
    seamless. OpenGL ES 2.0 specified that a single cube map face be
    selected and used for filtering."

Setting the field only in the context will work fine with sampler
objects (and drivers that support AMD_seamless_cubemap_per_texture)
because seamless filtering is used if *either* the context or the
sampler enable it:

    "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the
    value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is
    TRUE, seamless cube map sampling is enabled..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reported-by: Maxence Le Dore <maxence.ledore@gmail.com>
Thanked-by: Maxence Le Dore <maxence.ledore@gmail.com>
i965: Enable AMD_seamless_cubemap_per_texture

The change is very small.  Do seamless filtering if either the context
enable is set or the sampler enable is set.

The AMD_seamless_cubemap_per_texture says:

    "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the
    value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is
    TRUE, seamless cube map sampling is enabled..."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
vbo: Implement new gs prim types in vbo_count_tessellated_primitives.

Reviewed-by: Matt Turner <mattst88@gmail.com>
i965/vec4: Only zero out unused message components when there are any.

Otherwise, coordinates with four components would result in a MOV
with a destination writemask that has no channels enabled:

mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };

At best, this is stupid: we emit code that shouldn't do anything.
Worse, it apparently causes GPU hangs (observable with Chris's
textureGather test on CubeArrays.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Chris Forbes <chrisf@ijw.co.nz>
Cc: mesa-stable@lists.freedesktop.org
glsl: Store a predicate for whether a built-in signature is available.

For the upcoming built-in function rewrite, we'll need to be able to
answer "Is this built-in function signature available?".

This is actually a somewhat complex question, since it depends on the
language version, GLSL vs. GLSL ES, enabled extensions, and the current
shader stage.

Storing such a set of constraints in a structure would be painful, so
instead we store a function pointer.  When creating a signature, we
simply point to a predicate that inspects _mesa_glsl_parse_state and
answers whether the signature is available in the current shader.

Unfortunately, IR reader doesn't actually know when built-in functions
are available, so this patch makes it lie and say that they're always
present.  This allows us to hook up the new functionality; it just won't
be useful until real data is populated.  In the meantime, the existing
profile mechanism ensures built-ins are available in the right places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Convert ir_function_signature::is_builtin to a method.

A signature is a built-in if and only if builtin_info != NULL, so we
don't actually need a separate flag bit.  Making a boolean-valued
method allows existing code to ask the same question while not worrying
about the internal representation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Mark _mesa_glsl_parse_state::is_version() as const.

This promises the method won't modify the contents of the object.
This allows us to call it even with a const pointer to the state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add a method to tell whether a built-in is available.

We can simply call the stored predicate function.  If state is NULL,
just report that the function is available.

v2: Add a comment (requested by Paul Berry).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Pass _mesa_glsl_parse_state into matching_signature and such.

During compilation, we'll use this to determine built-in availability.
The plan is to have a single shader containing every built-in in every
version of the language, but filter out the ones that aren't actually
available to the shader being compiled.

At link time, we don't actually need this filtering capability: we've
already imported prototypes for every built-in that the shader actually
calls, and they're flagged as is_builtin().  The linker doesn't import
any additional prototypes, so it won't pull in any unavailable
built-ins.  When resolving prototypes to function definitions, the
linker ensures the values of is_builtin() match, which means that a
shader can't trick the linker into importing the body of an unavailable
built-in by defining a suspiciously similar prototype.

In other words, during linking, we can just pass in NULL.  It will work
out fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Skip unavailable built-ins when matching signatures.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Skip unavailable built-ins when printing out similar candidates.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Initialize lod_info in the ir_texture constructor.

This isn't strictly necessary, since creators of ir_texture objects
should set LOD when relevant.  However, it's nice to have a NULL pointer
in case they forget.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add missing type inference support for ARB_gpu_shader5 unops.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add an ir_expression triop constructor with type inference.

We already have ir_expression constructors for unary and binary
operations, which automatically infer the type based on the opcode and
operand types.

These are convenient and also required for ir_builder support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add IR builder support for triops.

Now that we have the ir_expression constructor that does type inference,
this is trivial to do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add IR builder support for conditional assignments.

This adds two new signatures:

   assign(lhs, rhs, condition, writemask);
   assign(lhs, rhs, condition);

All the other existing APIs still exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add IR builder support for generating return statements.

We use "ret" as the function name since "return" is a C++ keyword, and
"ir_return" is already a class name.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
glsl: Add a new ir_builder::dotlike() function.

dotlike() uses ir_binop_mul for scalars, and ir_binop_dot for vectors.

When generating built-in functions, we often want to use regular
multiply for scalar signatures, and dot() for vector signatures.
ir_binop_dot only works on vectors, so we have to switch opcodes,
even if the code is otherwise identical.  dotlike() makes this easy.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>