Commit Graph

63325 Commits

Author SHA1 Message Date
Brian Paul 3b66029dd3 svga: use svga_shader_too_large() in compile_vs()
And rework the dummy shader code to match the fragment shader case.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:36 -06:00
Brian Paul 3bb18eab72 svga: use svga_shader_too_large() in compile_fs()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:35 -06:00
Brian Paul 7b2ff54417 svga: added svga_shader_too_large() helper
To check if a shader bytcode exceeds the device limit.  There's no
limit when using GBS.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2014-05-31 06:25:35 -06:00
Jeremy Huddleston Sequoia b4f34241ec darwin: Remove extra kCGLPFAColorSize attribute when requesting an offscreen context
https://xquartz.macosforge.org/trac/ticket/650

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-05-31 03:44:51 -07:00
Vinson Lee 83bba8f146 util: Do not use __builtin_clrsb with Intel C++ Compiler.
This patch fixes this build error with icc 14.0.2.

In file included from state_tracker/st_glsl_to_tgsi.cpp(63):
../../src/gallium/auxiliary/util/u_math.h(583): error: identifier "__builtin_clrsb" is undefined
     return 31 - __builtin_clrsb(i);
                 ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-05-30 19:47:35 -07:00
Lubomir Rintel 90b5747856 i915: add a missing NULL pointer check
mesaVisual can be NULL with configless context since this commit:

    commit 551d459af4
    Author: Neil Roberts <neil@linux.intel.com>
    Date:   Fri Mar 7 18:05:47 2014 +0000

    Add the EGL_MESA_configless_context extension
...
    Previously the i965 and i915 drivers were explicitly creating a zeroed visual
    whenever 0 is passed for the EGLConfig.

We attempt to dereference the visual in i915 and now we don't create a
zeroed-out one one it crashes, breaking at least weston in an i915. There's
no point in doing so as it would be zero anyway.

v2: Fixed a typo in commit message.  Added some tags.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1100967
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 17:10:08 -07:00
Ian Romanick 7b1aeec9cd glapi: Duplicate GLES1 prototypes in glapi_dispatch.c
These prototypes are necessary because GLES1 library builds will create
dispatch functions for them.  We can't directly include GLES/gl.h
because it would conflict the previously-included GL/gl.h.  Since GLES1
ABI is not expected to every add more functions, the path of least
resistance is to just duplicate the prototypes for the functions that
aren't already in desktop OpenGL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79294
Acked-by: Matt Turner <mattst88@gmail.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-05-30 16:33:34 -07:00
Matt Turner 65bccff800 i965/vec4: Allow writemasking on math instructions on Gen7+.
The math instruction was Align1-only on Gen6 and we never updated this
to let it use Align16 features like writemasking on newer platforms.

total instructions in shared programs: 1686120 -> 1685507 (-0.04%)
instructions in affected programs:     48593 -> 47980 (-1.26%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-30 12:20:45 -07:00
Pavel Popov d292d40207 i965: Fix Line Stipple enable bit in 3DSTATE_SF for Haswell.
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Pavel Popov <pavel.e.popov@intel.com>
2014-05-30 12:20:18 -07:00
Brian Paul ebf229a436 st/wgl: use _debug_printf() instead of fprintf()
This should print output both for debug and release builds.
Suggested by Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul 4b05e3cb0f st/wgl: formatting fixes in stw_framebuffer.c
And remove some unneeded #includes and INLINE qualifiers.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul f9595e21bc st/wgl: make stw_lookup_context_locked() an inline function
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul bd36cbfa5a st/wgl: fix implementation of wglCreateContextAttribsARB()
wglCreateContextAttribsARB() didn't work previously since it returned
a context ID that wasn't allocated by OPENGL32.DLL.  So if that context
ID was later passed to wglMakeCurrent(), etc. it was rejected.

Now when wglCreateContextAttribsARB() is called we actually call
wglCreateContext() in order to get a valid context ID.  Then we
replace the context data which was created with new context data
which reflects the arguments passed to wglCreateContextAttribsARB().

If there were a DrvCreateContextAttribs() function in the ICD this
work-around wouldn't be necessary.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>

Conflicts:
	src/gallium/state_trackers/wgl/stw_ext_extensionsstring.c
	src/gallium/state_trackers/wgl/stw_getprocaddress.c
2014-05-30 18:52:39 +01:00
Brian Paul fa55c2402c st/wgl: add debug code to check that pixel format initialization worked
If the assertion fails, it means something is really broken.  Before,
if this happened we reverted to the GDI renderer without any warning.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
2014-05-30 18:52:39 +01:00
Brian Paul e4a5165562 st/wgl: change PFD_SWAP_COPY to PFD_SWAP_EXCHANGE.
To reflect our actual SwapBuffers implementation.  See
stw_st_swap_framebuffer_locked().  This fixes various rendering issues
with SolidEdge.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-05-30 18:52:39 +01:00
José Fonseca 76bf4bd3c5 docs: Document how to replace Windows built-in OpenGL software rasterizer with llvmpipe.
Just happened to stumble across this registry key while debugging
something else.

This technique is much neater than trying to override opengl32.dll.

Also a few minors cleanups.
2014-05-30 18:52:39 +01:00
Tapani Pälli 56bdffe8c1 scons: add common.c as part of glcpp build
to have _mesa_error_no_memory function available

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79440
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-30 10:11:44 +03:00
Juha-Pekka Heikkila fb7baafbbf mesa: Add missing null checks into prog_hash_table.c
Check calloc return values in hash_table_insert() and
hash_table_replace()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 09:22:34 +03:00
Tapani Pälli c692581ae8 glcpp: link with tests/common.c
So that prog_hash_table can use _mesa_error_no_memory function.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2014-05-30 09:22:24 +03:00
Juha-Pekka Heikkila 7bfe94694c mesa/main: Add missing null check in _mesa_CreatePerfQueryINTEL()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2014-05-30 07:22:01 +03:00
Juha-Pekka Heikkila 5c9056d37f mesa/drivers: Add extra null check in blitframebuffer_texture()
If texObj == NULL here it mean there is already GL_INVALID_VALUE
or GL_OUT_OF_MEMORY error set to context.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:21:39 +03:00
Juha-Pekka Heikkila 19f1d137f8 glsl: Add null check in loop_analysis.cpp
Check return value from hash_table_find before using it as a pointer

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:21:12 +03:00
Juha-Pekka Heikkila 77a00c71bb mesa: add missing null check in _mesa_NewHashTable()
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-30 07:20:53 +03:00
Gary Wong 85b6f36ca5 loader: add optional /sys filesystem method for PCI identification.
Introduce a simple PCI identification method of looking up the answer
the /sys filesystem (available on Linux).  Attempted after libudev, but
before DRM.

Disabled by default (available only when the --enable-sysfs configure
option is specified).

Signed-off-by: Gary Wong <gtw@gnu.org>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:25:37 -06:00
Gary Wong 090c772b8a loader: allow attempting more than one method of PCI identification.
loader_get_pci_id_for_fd() and loader_get_device_name_for_fd() now attempt
all available strategies to identify the hardware, instead of conditionally
compiling in a single test.  The existing libudev and DRM approaches have
been retained, attempting first libudev (if available) and then DRM (if
necessary).

Signed-off-by: Gary Wong <gtw@gnu.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:25:37 -06:00
Emil Velikov febec73147 st/egl: do not link against libloader
Move the link to the final targets, like any other place in
mesa/gallium. This allows better visibilty and will prevent
us from including the library archive twice.

Resolves multiple definition of `loader_get_pci_id_for_fd'

multiple definition of `loader_get_pci_id_for_fd'

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79263
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79382
Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2014-05-29 20:01:33 +01:00
Emil Velikov 6638c55838 egl_dri2: fix wayland_platform when drm_platform is not set
The build fails with implicit delaration of drmGetCap (xf86drm.h)
Were we're including the header only when building the DRM_PLATFORM.

Wayland backend can operate without DRM_PLATFORM so replace the
guard, and fold in drmGetCap() usage to silence compiler warnings.

Cc: Chad Versace <chad.versace@linux.intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-29 20:01:03 +01:00
Matt Turner dfd117b857 i965/fs: Set correct number of regs_written for MCS fetches.
regs_written is in units of virtual GRFs.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-05-29 10:42:25 -07:00
Jerome Glisse e3cc0d90e1 glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload
There is no reason anymore to load with RTLD_GLOBAL and for some driver
this even result in dlclose failing to unload leading to catastrophic
failure with swrast fallback.

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
2014-05-29 13:32:21 -04:00
Stéphane Marchesin c0bd206a14 i915g: Support B5G5R5A1 render targets and textures 2014-05-28 19:53:58 -07:00
Stéphane Marchesin 569c026520 i915g: Support R4G4B4A4 render targets and textures 2014-05-28 19:53:55 -07:00
Stéphane Marchesin 9e59c91a73 i915g: Fix copy region code
This fixes a few issues with it, also cleans up the code.
2014-05-28 19:53:51 -07:00
Connor Abbott fc7e7cfabc glsl/tests: remove generated tests from the repo
They were made unneccesary by the last commit.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:07:07 -07:00
Connor Abbott a1d8322fbb glsl/tests: call create_test_cases.py in optimization-test
This way, when someone modifies create_test_cases.py and forgets to
commit their changes again, people will notice.

v2: make sure we parse the right directories and check for existance the
right way.

v3 (Ken): Use $PYTHON2 instead of calling python directly.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:06:45 -07:00
Connor Abbott 6e24111b9c glsl/tests/lower_jumps: fix generated sexpr's for loops
In 088494aa (as well as other commits in the series) Paul Berry modified
the tests for lower_jumps to account for the fact that the s-expression
for the loop IR instruction changed from
(loop () () () () (statements...)) to (loop (statements...)), but he
forgot to update create_test_cases.py which he used to create the tests.
Fix that, so that now create_test_cases.py is synced with the generated
tests.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:06:16 -07:00
Connor Abbott bbaec0f76c glsl: be more consistent about printing constants
Make sure that we print the same number of digits when printing 0.0 as
any other floating-point number. This will make generating expected
output files for tests easier. To avoid breaking "make check," update
the generated tests for lower_jumps before the next commit which will
bring create_test_cases.py in line with them.

Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-28 15:05:59 -07:00
Brian Paul a7aca3919b glsl: replace strncmp("gl_") calls with new is_gl_identifier() helper
Makes things a little easier to read.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-28 15:06:07 -06:00
Brian Paul f9cecca7a6 glsl: fix use-after free bug/crash in ast_declarator_list::hir()
The call to get_variable_being_redeclared() may delete 'var' so we
can't reference var->name afterward.  We fix that by examining the
var's name before making that call.

Fixes valgrind warnings and possible crash when running the piglit
tests/spec/glsl-1.30/execution/clipping/vs-clip-distance-in-param.shader_test
test (and probably others).

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-05-28 15:06:07 -06:00
Kenneth Graunke bb9623a1a8 i965: Fix repeated usage of rectangle texture coordinate scaling.
Previously, we set up new entries in the params[] array on every access
of a rectangle texture.  Unfortunately, we only reserve space for
(2 * MaxTextureImageUnits) extra entries, so programs which accessed
rectangle textures more times than that would write off the end of the
array and likely crash.

We don't really have a decent mapping between the index returned by
_mesa_add_state_reference and our index into the params array, so we
have to manually search for it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78691
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: mesa-stable@lists.freedesktop.org
2014-05-28 13:12:10 -07:00
José Fonseca 9ec7cb8aa0 egl-static: Fix undefined reference to `loader_*'
Trivial.  Better than a broken build.
2014-05-28 10:33:33 +01:00
Topi Pohjolainen a6022e5405 meta/blit: Use gl_FragColor also in the msaa blit shader
Fixes framebuffer_blit_functionality_multisampled_to_singlesampled_blit
es3 cts test on bdw. Also fixes this on ivb when ivb is forced to use
the meta path.

No piglit regressions on IVB.

Further input from Ken:

 "Unfortunately, this doesn't fix MRT for integer data.

  In the single-sampled case, since we're directly copying data, we were
  read/copy/write data as "float" values, which actually contained the
  integer bits.  Here, we can't do that since we need to process the
  actual integer data.

  I do wonder if we could use intBitsToFloat/uintBitsToFloat to stuff the
  integer bits in the float gl_FragColor output.  Just a crazy idea.

  In the long term (post 10.2), I think we should draft an extension that
  allows you to do "layout(location = all)" on user-defined fragment
  shader outputs.  (Or some similar syntax.)"

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2014-05-28 10:32:29 +03:00
Alexandre Courbot ecee4c4229 nvc0/ir: use SM35 ISA with GK20A
GK20A is mostly compatible with GK104, but uses the SM35 ISA. Use
the GK110 path when this chip is detected.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-27 22:12:40 -04:00
Alexandre Courbot 1973d79e27 nvc0: add GK20A 3D class
GK20A is mostly compatible with GK104, but features a new 3D
class. Add it to the relevant header and use it when GK20A is
detected.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-05-27 22:12:40 -04:00
Kenneth Graunke 4b846e231e i965/sf: Replace push/pop in brw_emit_anyprim_setup.
Each of the subroutine emitters alter the predication state, but
otherwise don't change anything (or put it back when they do).
Resetting predication at the end makes these functions idempotent with
regard to the default instruction state - which is a nice property.

With that in place, push/pop is no longer necessary.

v2: Improve whitespace (requested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke 471bff4c62 i965/sf: Drop unnecessary push/pop in copy_z_inv_w.
brw_MOV doesn't alter the default instruction state, so this does
nothing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke 0f9eeae878 i965/sf: Drop unnecessary push/pop in flatshading code.
brw_JMPI sets predicate_control to BRW_PREDICATE_NONE, but that's
already the value coming in.  Otherwise, nothing changes state.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:02 -07:00
Kenneth Graunke d9cac44a14 i965/sf: Move brw_compile::flag_value to brw_sf_compile.
This field is only used to track the current value of the flag register
during the SF compile.  It has no place in the common compiler code.

While we're changing every call, drop the 'brw' prefix from the function
since it's static.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke e287f5937f i965/sf: Move brw_set_predicate_control_flag_value to brw_sf_emit.c.
Only the Gen4-5 SF program compiler actually uses this function; move
it there.  Soon the fields will be moved out of brw_compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke 41afb3ade4 i965/sf: Drop useless push/pop state from flag register mashing code.
There's no point in pushing and popping the default state; the code
between the two stack operations doesn't alter anything.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00
Kenneth Graunke 2747f6a1f9 i965/sf: Drop unnecessary push/pop in do_twoside_color.
None of the assembly emitters called between push and pop actually
change the state.  So, we can drop these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-05-27 13:46:01 -07:00