Commit Graph

59020 Commits

Author SHA1 Message Date
Chia-I Wu 44f0777f17 i965: make BRW_COMPRESSION_2NDHALF valid for brw_SAMPLE
SIMD8 sampler messages are allowed in SIMD16 mode, and they could not work
without BRW_COMPRESSION_2NDHALF.  Later PRMs (gen5 and later) do not
explicitly state whether BRW_COMPRESSION_2NDHALF is allowed, but they do have
examples using send with SecHalf.  It should be safe to assume SecHalf is
valid.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-09 14:49:11 +08:00
Vinson Lee 1176a3aac6 i965: Initialize brw_blorp_const_color_program::prog_data.
Fixes "Uninitialized scalar field" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-08 22:10:46 -07:00
Eric Anholt 8c197d4aae i965: Fix a compiler warning about conservative depth enums.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-10-08 14:34:35 -07:00
Paul Berry d14fcd7db7 i965/gs: Fixup gl_PointSize on entry to geometry shaders.
gl_PointSize is stored in the w component of VARYING_SLOT_PSIZ, but
the geometry shader infrastructure assumes that it should look for all
geometry shader inputs of type float in the x component.  So when
compiling a geomtery shader that uses a gl_PointSize input, fix it up
during the shader prolog by moving the w component to the x component.

This is similar to how we emit fixups and workarounds for vertex
shader attributes.

Fixes piglit test spec/glsl-1.50/execution/geometry/core-inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-08 12:44:24 -07:00
Bryan Cain 8f758b0b92 glsl/gs: handle gl_ClipDistance geometry input in lower_clip_distance.
This corresponds to the lowering of gl_ClipDistance to
gl_ClipDistanceMESA for vertex and geometry shader outputs.  Since
this lowering pass occurs after lower_named_interface blocks, it deals
with 2D arrays (gl_ClipDistance[vertex][clip_plane]) rather than 1D
arrays in an interface block
(gl_in[vertex].gl_ClipDistance[clip_plane]).

v2 (Paul Berry <stereotype441@gmail.com>): Fix indexing order for
gl_ClipDistance input lowering.  Properly lower bulk assignment of
gl_ClipDistance inputs.  Rework for GLSL 1.50 style geometry shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

v3 (Paul Berry <stereotype441@gmail.com>): Add comments and assertions
to clarify that the 2D version of clip distance is only used for
geometry shader inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-08 12:44:21 -07:00
Paul Berry c09adcb21b glsl/gs: add gl_in support to builtin_variables.cpp.
Previously, builtin_variables.cpp was written assuming that we
supported ARB_geometry_shader4 style geometry shader inputs, meaning
that each built-in varying input to a geometry was supplied via an
array variable whose name ended in "In", e.g. gl_PositionIn or
gl_PointSizeIn.

However, in GLSL 1.50 style geometry shaders, things work
differently--built-in inputs are supplied to geometry shaders via a
built-in interface block called gl_in, which contains all the built-in
inputs using their usual names (e.g. the gl_Position input is supplied
to the geometry shader as gl_in[i].gl_Position).

This patch adds the necessary logic to builtin_variables.cpp to create
the gl_in interface block and populate it accordingly for geometry
shader inputs.  The old ARB_geometry_shader4 style varyings are
removed, though they can easily be added back in the future if we
decide to support ARB_geometry_shader4.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-08 12:44:19 -07:00
Paul Berry 378ff1dbac glsl: Keep track of location for interface block fields.
This patch adds a "location" element to struct glsl_struct_field, so
that we can keep track of the gl_varying_slot associated with each
built-in geometry shader input.

In lower_named_interface_blocks, we use this value to populate the
"location" field in the ir_variable that stores each geometry shader
input.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-10-08 12:44:01 -07:00
Adam Jackson e166a58c43 glx: Generate fewer errors in MakeContextCurrent
For a few reasons.

1: In the (current) common case, these conditionals are never true. All
we're doing by checking them is slowing down MakeCurrent.  The server
does these checks already anyway.

2: GLX >= 3.0 contexts may legally be made current without a bound
framebuffer.

This does not fix piglit/glx-create-context-current-no-framebuffer, but
is a prerequisite for fixing it.

Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Adam Jackson d101204c23 glx: Propagate failures from SendMakeCurrentRequest where possible
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Adam Jackson 68412d5006 glx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequest
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-08 13:24:20 -04:00
Marek Olšák 15a201c610 st/dri: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák 085e5adede gallium/swrast: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák c787a9767c gallium/radeon: don't export any private symbols
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák 790c8a2405 configure.ac: report an error if LLVM shared libs are disabled and CL is enabled
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-10-08 16:23:52 +02:00
Marek Olšák e9c9d28203 st/mesa: improve format selection for GLES
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2013-10-08 16:23:04 +02:00
Stéphane Marchesin 20bf508a42 i915g: Rename sampler to fragment_sampler
Otherwise it is fairly confusing.
2013-10-07 20:53:55 -07:00
Stéphane Marchesin 8c6594074e i915g: Fix the sampler bind function
The new sampler bind sends us NULL samplers, so we need to count
the number of valid samplers ourselves. This fixes ~500 piglit
regressions from the sampler rework.

While we're at it, let's also support start.
2013-10-07 20:51:53 -07:00
Chad Versace 6cd1da8377 gen7: Use logical, not physical, dims in 3DSTATE_DEPTH_BUFFER (v2)
In 3DSTATE_DEPTH_BUFFER, we set Width and Height to the miptree slice's
physical dimensions. (Logical and physical dimensions may differ for
multisample surfaces).

However, in SURFACE_STATE, we always set Width and Height to the slice's
logical dimensions. We should do the same for 3DSTATE_DEPTH_BUFFER,
because the hw docs say so.

No Piglit regressions (-x glx -x glean) on Ivybridge with Wayland.

v2: No Piglit regressions, for real this time.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-07 11:55:24 -07:00
Chad Versace ccad802ed5 doxygen: Generate Doxygen for i965
Now, one can do the following to generate and read the i965 Doxygen:

  cd $MESA_TOP/doxygen
  make
  firefox i965/index.html

Reviewed-by: Frank Henigman <fjhenigman@google.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-10-07 11:55:16 -07:00
Matt Turner b645913ff6 i965: Remove the "ARF" register file.
The registers in the architecture register file don't share much in
common, so there's no point in grouping them together. Use the HW_REG
class instead. The vec4 backend already does this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 11:38:52 -07:00
Matt Turner e7dc88026a i965: Fixup for don't dead-code eliminate instructions that write to the accumulator.
Accidentally pushed an old version of the patch.

v2: Set destination register using brw_null_reg().
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 11:38:15 -07:00
Matt Turner c4e6569fc8 i965: Generate code for ir_binop_imul_high.
v2: Make accumulator's type match the type of the operation. Noticed by
    Ken.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:43:19 -07:00
Matt Turner 85154241d6 i965: Use the multiplication result's type for the accumulator.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-07 10:43:19 -07:00
Matt Turner 6ff8f06308 i965/fs: Disable CSE on instructions writing to HW_REG.
CSE would otherwise combine the two mul(8) emitted by [iu]mulExtended:

	mul(8)  acc0 x y
	mach(8) null x y
	mov(8)  lsb  acc0
	...
	mul(8)  acc0 x y
	mach(8) msb  x y
Into:
	mul(8)  temp x y
	mov(8)  acc0 temp
	mach(8) null x y
	mov(8)  lsb  acc0
	...
	mov(8)  acc0 temp
	mach(8) msb  x y

But mul(8) into the accumulator produces more than 32-bits of precision,
which is required and lost if multiplying into a general register and
moving to the accumulator.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-07 10:43:19 -07:00
Matt Turner 06e41a02a3 glsl: Implement [iu]mulExtended() built-ins for ARB_gpu_shader5.
These built-ins have two "out" parameters, which makes implementing them
efficiently with our current compiler infrastructure difficult. Instead,
implement them in terms of the existing ir_binop_mul IR (to return the
low 32-bits) and a new ir_binop_mul64 which returns the high 32-bits.

v2: Rename mul64 -> imul_high as suggested by Ken.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:43:19 -07:00
Matt Turner 69909c866b i965: Add Gen assertion checks for newer instructions.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:43:19 -07:00
Matt Turner 92dc16c3e2 i965: Don't dead-code eliminate instructions that write to the accumulator.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:41:17 -07:00
Matt Turner 014cce3dc4 i965: Generate code for ir_binop_carry and ir_binop_borrow.
Using the ADDC and SUBB instructions on Gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:41:17 -07:00
Matt Turner 4ec37317c5 i965: Add UD null register helpers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 10:41:16 -07:00
Matt Turner 6f9428eb68 glsl: Implement usubBorrow() built-in for ARB_gpu_shader5.
i965 implements this with a single (multiple destination) instruction,
SUBB. Emitting SUBB directly from usubBorrow() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

Radeon has an SUBB_UINT instruction that only generates the borrow
bit. I've chosen to go this route and implement usubBorrow() by doing the
subtraction and the borrow operations separately.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-07 10:41:16 -07:00
Matt Turner 6c125973f3 glsl: Implement uaddCarry() built-in for ARB_gpu_shader5.
i965 implements this with a single (multiple destination) instruction,
ADDC. Emitting ADDC directly from uaddCarry() would be ideal, but our
optimization passes don't know how to copy with expressions with
side-effects.

Radeon has an ADDC_UINT instruction that only generates the carry
bit. I've chosen to go this route and implement uaddCarry() by doing the
addition and the carry operations separately.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-07 10:41:16 -07:00
Matt Turner 499d7a7f6e glsl: Add ir_binop_carry and ir_binop_borrow.
Calculates the carry out of the addition of two values and the
borrow from subtraction respectively. Will be used in uaddCarry() and
usubBorrow() built-in implementations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-07 10:41:16 -07:00
Ian Romanick ae514416b2 glsl_compiler: Enable any extension that any Mesa driver enables
The only GLSL extension that is not enabled is AMD_vertex_shader_layer.
I think the standalone-compiler could enable this (as shading language
support is complete), but no driver enables it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick 136568ea18 glsl_compiler: Sort extensions by name
Makes it a little easier to see which ones are missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick 587cd971c8 glsl_compiler: Always log the compiler diagnostics
Not just when there's an error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick 3646d65f6a glsl_compiler: Set max GLSL version on the command line
Infer whether or not to use ES based on the GLSL version (100 or 300 are
for ES).  This replaces the --glsl-es command line option.  Set various
compiler limits based on the minimums required for the specified GLSL
version.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick 257db619c6 glsl_compiler: Use no_argument instead of 0 in getopt_long options
The choices aren't just 0 and 1, so using the enum names is much more
clear.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick 75e9bd13c4 glsl_compiler: Re-enable building glsl_compiler
This allows application developers to use Mesa's compiler as a
standalone validator for their shaders.

This is mostly a revert of commit 569f0e4.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-07 09:59:23 -07:00
Ian Romanick 5d6b0e7f1b glsl: Remove glsl_parser_state MaxVaryingFloats field
Pull the data directly from the context like the other varying related
limits.  The parser state shadow copies were added back when the parser
state didn't have a pointer to the context.  There's no reason to do it
now days.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-07 09:59:23 -07:00
Ian Romanick 7db50171be glsl: Set gl_MaxVertexOutputs from VertexProgram.MaxOutputComponents etc
gl_MaxVertexOutputVectors => ctx->Const.VertexProgram.MaxOutputComponents
gl_MaxFragmentInputVectors => ctx->Const.FragmentProgram.MaxInputComponents

v2: Add types so that the code compiles.  Pointed out by Brian.

v3: Leave gl_MaxVaryingFloats et al. as-is.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v2]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v2]
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v2]
2013-10-07 09:59:23 -07:00
Ian Romanick 42305fb502 glsl: Count shader inputs and outputs separately
Starting with OpenGL 3.2 input limits and output limits for stages may
not match.  This means they need to be accounted separately.

No piglit regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-10-07 09:59:23 -07:00
Emilio Pozuelo Monfort d4b5bc62af glapi: add output info to GetProgramiv's params
Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-07 09:06:33 -07:00
Laurent Carlier 72465fcf57 clover: fix building with llvm-3.4 since rev191922
http://llvm.org/viewvc/llvm-project?view=revision&revision=191922
2013-10-07 08:41:02 -07:00
Brian Paul e58dd465f0 st/mesa: silence warning about unhandled ir_query_levels in switch 2013-10-07 09:08:16 -06:00
Christian König 289d928c8e radeon/vdpau: only export necessary symbols
Export only the absolutely necessary symbols in radeon vdpau targets.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-07 11:16:53 +02:00
Christian König 731f5471fb radeon/uvd: optimize message handling a bit
No need to keep a copy of the message in system memory anymore,
since it should now be in GART memory on newer chips.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-10-07 11:16:53 +02:00
Kenneth Graunke cfbfb50cb8 docs: Mark a few more things as "in progress" in GL3.txt. 2013-10-06 13:58:53 -07:00
Ilia Mirkin 7178d6ac59 dri/nouveau: add AllocTextureImageBuffer implementation
This fixes issues where get_rt_format would see a 0 format because the
nouveau_surface had not been properly initialized. Fixes crash on
supertuxkart startup (which still fails due to out-of-vram issues).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2013-10-06 12:59:18 -07:00
Francisco Jerez b3c04362b4 glsl: Fix usage of the wrong union member in program_resource_visitor::recursion.
In the array-of-struct case, recursion() takes the row_major flag for
each iteration from 't->fields.structure[i]', but 't' is not a record
type.  Inherit the array declaration row_major flag instead.

This mistake was found by running piglit on valgrind.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69449
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2013-10-06 12:55:14 -07:00
Marek Olšák 373f8670d1 Revert "r600g: only flush the caches that need to be flushed during CP DMA operations"
This reverts commit 7948ed1250.

It caused graphical corruption. I've got no idea why.

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

Conflicts:
	src/gallium/drivers/r600/evergreen_hw_context.c
	src/gallium/drivers/r600/r600_hw_context.c
	src/gallium/drivers/r600/r600_pipe.h
2013-10-06 03:13:48 +02:00