summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* glsl: don't lose uniform values when falling back to full compileTimothy Arceri2017-02-171-2/+2
| | | | | | | | | Here we skip the recreation of uniform storage if we are relinking after a cache miss. This is improtant because uniform values may have already been set by the application and we don't want to reset them. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: don't reference shader prog data during cache fallbackTimothy Arceri2017-02-171-1/+2
| | | | | | We already have a reference. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl: add cache_fallback flag to gl_shader_program_dataTimothy Arceri2017-02-171-0/+2
| | | | | | | | | | | This will allow us to skip certain things when falling back to a full recompile on a cache miss such as avoiding reinitialising uniforms. In this change we use it to avoid reading the program metadata from the cache and skipping linking during a fallback. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: use correct shader source in case of cache fallbackTimothy Arceri2017-02-173-3/+15
| | | | | | | | | | | | | | | | | The scenario is: glShaderSource glCompileShader <-- deferred due to cache hit of shader glShaderSource <-- with new source code glAttachShader glLinkProgram <-- no cache hit for program At this point we need to compile the original source when we fallback. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: make use of on disk shader cacheTimothy Arceri2017-02-171-0/+8
| | | | | | | | | | | | | | | The hash key for glsl metadata is a hash of the hashes of each GLSL source string. This commit uses the put_key/get_key support in the cache put the SHA-1 hash of the source string for each successfully compiled shader into the cache. This allows for early, optimistic returns from glCompileShader (if the identical source string had been successfully compiled in the past), in the hope that the final, linked shader will be found in the cache. This is based on the intial patch by Carl. Reviewed-by: Nicolai Hähnle <[email protected]>
* r100: use correct libdrm_radeon macroEmil Velikov2017-02-161-6/+2
| | | | | | | | | | Remove local definition of RADEON_INFO_TILE_CONFIG and use the correct macro provided by libdrm_radeon RADEON_INFO_TILING_CONFIG. Latter was present as of libdrm 2.4.22, sirca 2010. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: retain gl_shader_programs after glDeleteProgram if they are in useTimothy Arceri2017-02-165-9/+17
| | | | | | | | | | | | | | Fixes regressions from c505d6d852220f4aaaee161465dd2c579647e672. Switching from using gl_shader_program to gl_program for the pipline objects CurrentProgram array meant we were freeing gl_shader_programs immediately after glDeleteProgram was called, but the spec states the program should only get deleted once it is no longer in use. To work around this we add a new ReferencedPrograms array to track gl_shader_programs in use. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove tabs in dri xmlconfig.cTimothy Arceri2017-02-161-362/+362
| | | | Acked-by: Nicolai Hähnle <[email protected]>
* mesa: style fixes for dri xmlconfig.cTimothy Arceri2017-02-161-37/+94
| | | | Acked-by: Nicolai Hähnle <[email protected]>
* i965: Do not use purged bo after calling glObjectUnpurgeableChris Wilson2017-02-151-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | If the buffer has been freed by the kernel under memory pressure, it is invalid to try and access the backing storage for that buffer in the future - the backing storage is not recreated automatically. As such we need to mark the GL object as being freed for unretained buffers and so recreate the object on next use. Futhermore from the GL_APPLE_object_purgeable: "In contrast, by calling ObjectUnpurgeableAPPLE with an <option> of UNDEFINED_APPLE, the application is indicating that it intends to recreate the contents of the storage from scratch. Further, the application is is stating that it would like the GL to do only the minimal amount of work set PURGEABLE_APPLE to FALSE. If ObjectUnpurgeableAPPLE is called with the <option> set to UNDEFINED_APPLE, then ObjectUnpurgeableAPPLE will return the value UNDEFINED_APPLE." we must always report GL_UNDEFINED_APPLE when called with glObjectUnpurgeable(GL_UNDEFINED_APPLE). Testcase: piglit/object_purgeable-api-* Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "i915: Always enable GL 2.0 support."Matt Turner2017-02-152-4/+25
| | | | | | | | | | This partially reverts commit 97217a40f97cdeae0304798b607f704deb0c3558. It leaves ES 2.0 support in place per Ian's suggestion, because ES 2.0 is designed to work on hardware like i915. Chrome only uses the GPU if you have GL >= 2.0, and using i915 (and prog_execute) actually hurt performance compared with the software paths.
* getteximage: Return correct error value when texure object is not foundEduardo Lima Mitev2017-02-151-2/+4
| | | | | | | | | | | | | | | | | | | | | glGetTextureSubImage() and glGetCompressedTextureSubImage() are currently returning INVALID_OPERATION error when the passed texture argument does not correspond to an existing texture object. However, the error should be INVALID_VALUE instead. From OpenGL 4.5 spec PDF, section '8.11. Texture Queries', page 236: "An INVALID_VALUE error is generated if texture is not the name of an existing texture object." Same wording applies to the compressed version. The INVALID_OPERATION error is coming from the call to _mesa_lookup_texture_err(). This patch uses _mesa_lookup_texture() instead and emits the correct error in the caller. Fixes: GL45-CTS.get_texture_sub_image.errors_test Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: define default allow_higher_compat_version valueLionel Landwerlin2017-02-151-0/+1
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Matt Turner <[email protected]> Fixes: 9d16f3903e2 ("driconf: add allow_higher_compat_version option")
* drirc: add allow_higher_compat_version for Tropico 5Samuel Pitoiset2017-02-151-0/+4
| | | | | | | | | v2: s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* drirc: add allow_higher_compat_version for Crookz - The Big HeistSamuel Pitoiset2017-02-151-0/+4
| | | | | | | | | v2: s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* drirc: add allow_higher_compat_version for Worms WMDSamuel Pitoiset2017-02-151-0/+4
| | | | | | | | | v2: s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* driconf: add allow_higher_compat_version optionSamuel Pitoiset2017-02-155-2/+21
| | | | | | | | | | | | | | | | | | | Mesa currently doesn't allow to create 3.1+ compatibility profiles mainly because various features are unimplemented and bugs can happen. However, some buggy apps request a compat profile without using any old features unimplemented in mesa, and they fail to start. This option should help some games to run but it's not enough for all (eg. Dying Light). v2: - s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: tell u_vbuf that GL core doesn't have user VBOsMarek Olšák2017-02-141-1/+8
| | | | | | | I think this only affects radeonsi - VI, because all other drivers using u_vbuf probably don't support GL_DOUBLE, so they won't be affected by this. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: let state trackers tell u_vbuf whether user VBOs are possibleMarek Olšák2017-02-141-1/+1
| | | | | | This can affect whether u_vbuf will be enabled or not. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use the common uploader (v2)Marek Olšák2017-02-147-44/+25
| | | | | | | | v2: use const_uploader Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> (v1) Tested-by: Charmaine Lee <[email protected]>
* mesa: Add EXT_frag_depth bits and enable it on all driversAnuj Phogat2017-02-131-0/+1
| | | | | | | | | Passes the newly added piglit test for this extension on i965. V2: Fix comments by Ilia. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* xlib: remove always true ifdef GLX_EXTENSION guardsEmil Velikov2017-02-132-26/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* mesa: Ignore per-vertex array size in SSO pipeline validation.Kenneth Graunke2017-02-121-42/+56
| | | | | | | | | | | | We were already unwrapping types when the producer was a non-array stage and the consumer was an arrayed-stage...but we ought to unwrap both ends for TCS -> TES matching too. This will allow us to drop the "resize to gl_MaxPatchVertices" check shortly, which breaks some things. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: Do a draw time check for TES && !TCS in ES 3.x.Kenneth Graunke2017-02-121-0/+14
| | | | | | | | | | | | | ES 3.x requires both TCS and TES to be present. We already checked the TCS && !TES case above, so we just have to check !TCS && TES here. Note that this is allowed in OpenGL, just not ES. This fixes a subcase of: dEQP-GLES31.functional.debug.negative_coverage.*.tessellation.single_tessellation_stage Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: Do (TCS && !TES) draw time validation in ES as well.Kenneth Graunke2017-02-121-19/+26
| | | | | | | | | | | | | | | | | Now that we have OES_tessellation_shader, the same situation can occur in ES too, not just GL core profile. Having a TCS but no TES may confuse drivers - i965 crashes, for example. This prevents regressions in ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage with some SSO pipeline validation changes I'm making. v2: Add an ES spec citation (suggested by Alejandro) Cc: "17.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* i965/sampler_state: Set the "Base Mip Level" field on Sandy BridgeJason Ekstrand2017-02-122-1/+20
| | | | | | | | | | | Fixes two GL ES 3.0 CTS tests on Sandy Bridge: ES3-CTS.functional.texture.mipmap.cube.base_level.linear_linear ES3-CTS.functional.texture.mipmap.cube.base_level.linear_nearest Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.0 13.0" <[email protected]>
* i965/sampler_state: Pass texObj into update_sampler_stateJason Ekstrand2017-02-121-6/+4
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.0 13.0" <[email protected]>
* i965/sampler_state: Clamp min/max LOD to 14 on gen7+Jason Ekstrand2017-02-121-2/+5
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.0" <[email protected]>
* st/mesa: don't pass compare mode for stencil-sampled texturesIlia Mirkin2017-02-121-1/+1
| | | | | | | | Fixes dEQP-GLES31.functional.stencil_texturing.misc.compare_mode_effect Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: [email protected]
* gallium: add separate PIPE_CAP_INT64_DIVMODIlia Mirkin2017-02-091-0/+3
| | | | | | | | | | | Nouveau does not currently have logic to implement this as a library function. Even though such a library could be written, there's no big advantage to do it that way for now given that int64 is a very uncommon use-case. Allow a driver to expose INT64 without supporting division and modulo operations. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i965/fs: add support for int64 to bool conversionSamuel Iglesias Gonsálvez2017-02-091-2/+13
| | | | | | Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99660 Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/fs: Add support for nir_op_[iu]2[iu]32Samuel Iglesias Gonsálvez2017-02-091-0/+4
| | | | | | Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99660 Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/fs: Add support for nir_op_[iu]642fSamuel Iglesias Gonsálvez2017-02-091-0/+2
| | | | | | Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99660 Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/fs: legalize [u]int64 to 32-bit data conversions in lower_d2xSamuel Iglesias Gonsálvez2017-02-091-1/+3
| | | | | | Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99660 Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/fs: Add support for nir_op_[iu]642dJason Ekstrand2017-02-091-0/+2
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* i965: Allow int64 conversion operations in channel_expressionsJason Ekstrand2017-02-091-24/+24
| | | | | | | This fixes 143 of the new piglit tests added by Nicolai Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* glsl: add param to force shader recompileTimothy Arceri2017-02-091-1/+1
| | | | | | This will be used to skip checking the cache and force a recompile. Reviewed-by: Anuj Phogat <[email protected]>
* st/mesa/i965: create link status enumTimothy Arceri2017-02-0911-17/+28
| | | | | | | | | | | | For the on-disk shader cache we want to be able to differentiate between a program that was linked and one that was loaded from cache. V2: - don't return the new enum directly to the application when queried, instead return GL_TRUE or GL_FALSE as required. Fixes google-chrome corruptions when using cache. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: (trivial) include <inttypes.h> for PRIx64 macrosRoland Scheidegger2017-02-081-0/+1
| | | | Fixes a compile error with mingw.
* mesa: use PRId64/PRIu64 when printing 64-bit intsTimothy Arceri2017-02-081-2/+2
| | | | | | V2: actually use PRIu64 Reviewed-by: Dave Airlie <[email protected]>
* mesa/st: fix strict aliasing issue in int64 code.Dave Airlie2017-02-081-4/+2
| | | | | | | This fixes the int64 code same as the double code. Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/uniform: fix strict aliasing issues with int64 code.Dave Airlie2017-02-081-12/+26
| | | | | | | This fixes these like the double version does. Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Revert "i965: Disable guardband clipping in the smaller-than-viewport case."Kenneth Graunke2017-02-061-31/+0
| | | | | | | | | | | | | | | | | | | This reverts commit 0bac2551e40410e2251daf4fd9faf69310ab34ce. Now that we position the guardband correctly (applying translations in addition to scaling) and made it as large (or larger) than the render target, this shouldn't be necessary. Now we leave guardband clipping enabled 100% of the time, like the Windows driver does. Fixes GL45-CTS.gtf21.GL2FixedTests.clip.clip. It tries to draw a 16384x64 rectangle, and it appears that some kind of numerical imprecisions in the clipper result in some edge pixels going missing. The Windows driver passes this test because of guardband clipping. Cc: "17.0" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Always scissor on Gen6-7.5 instead of disabling guardband.Kenneth Graunke2017-02-063-48/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we disabled the guardband when the viewport was smaller than the framebuffer on Gen6-7.5, to prevent portions of primitives from being draw outside of the viewport. On Gen8+, we relied on the viewport extents test to effectively scissor this away for us. We can simply always enable scissoring instead. We already include the viewport in the scissor rectangle, so this will effectively do the viewport extents test for us. (The only difference is that the scissor rectangle doesn't support sub-pixel values. I think that's okay.) Given that the viewport extents test is essentially a second scissor, and is enabled for basically all 3D drawing on Gen8+, it stands to reason that scissoring is cheap. Enabling the guardband reduces the cost of clipping, which is expensive. The Windows driver appears to never disable guardband clipping, and appears to use scissoring in this case. I don't know if they leave it on universally though. This fixes misrendering in Blender, where the "floor plane" grid lines started rendering at wrong angles after I disabled XY clipping of line primitives. Enabling the guardband seems to solve the issue. Cc: "17.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99339 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Use a better guardband calculation.Jason Ekstrand2017-02-064-82/+126
| | | | | | | | | | | | | | | | | | | | | (Patch co-authored by Jason and Ken.) We scaled the guardband based on the viewport size, but failed to take into account the translation portion of the viewport transform. This meant the guardband was always centered around the origin. We want it to be centered around the screen-space drawing area, which is the intersection of the viewport and the render target. At best, getting this wrong would reduce the guardband's effectiveness in some cases. At worst, it might break things - objects outside of the guardband are trivially rejected, so getting the guardband in the wrong place and leaving guardband clipping enabled could cause problems. v2: drop clamping of positive maximums. Cc: "17.0" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Combine the Gen6 SF and Clip viewport atoms.Kenneth Graunke2017-02-063-57/+30
| | | | | | | | | | The next patch will make the guardband calculation dependent on the transformation matrix. Instead of computing it in both atoms, just combine them into a single atom. Cc: "17.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* dri/common: clear the loaderPrivate pointer in driDestroyDrawableNicolai Hähnle2017-02-061-0/+12
| | | | | | | | | | | | | | | | | | | | The GLX specification says about glXDestroyPixmap: "The storage for the GLX pixmap will be freed when it is not current to any client." We're not really following this language to the letter: some of the storage is freed immediately (in particular, the dri3_drawable, which contains both GLXDRIdrawable and loader_dri3_drawable). So we NULL out the pointers to that freed storage; the previous patches added the corresponding NULL-pointer checks. This fixes memory corruption in piglit ./bin/glx-visuals-depth/stencil -pixmap -auto Cc: 17.0 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* main/fboject: default_framebuffer allowed for GetFramebufferParameterAlejandro Piñeiro2017-02-061-7/+37
| | | | | | | | | | | | | | | | | | | | Before 4.5, the default framebuffer was not allowed for GetFramebufferParameter, so it should return INVALID_OPERATION for any call using the default framebuffer. 4.5 included new pnames, and some of them are allowed for the default framebuffer. For the rest, INVALID_OPERATION. From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries: "An INVALID_OPERATION error is generated by GetFramebufferParameteriv if the default framebuffer is bound to target and pname is not one of the accepted values from table 23.73, other than SAMPLE_POSITION." Fixes: GL45-CTS.direct_state_access.framebuffers_get_parameter_errors Reviewed-by: Anuj Phogat <[email protected]>
* main/fbobject: implement new 4.5 pnames for GetFramebufferParameterAlejandro Piñeiro2017-02-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | 4.5 added new pnames allowed for GetFramebufferParameter, and GetNamedFramebufferParameter. From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries" (quoting the paragraph with only the new pnames, not all the supported): "pname may also be one of DOUBLEBUFFER, IMPLEMENTATION_COLOR_READ_FORMAT, IMPLEMENTATION_COLOR_READ_TYPE, SAMPLES, SAMPLE_BUFFERS, or STEREO, indicating the corresponding framebuffer-dependent state from table 23.73. Values of framebuffer-dependent state are identical to those that would be obtained were the framebuffer object bound and queried using the simple state queries in that table. These values may be queried from either a framebuffer object or a default framebuffer." Fixes: GL45-CTS.direct_state_access.framebuffers_get_parameters Reviewed-by: Anuj Phogat <[email protected]>
* main/framebuffer: refactor _mesa_get_color_read_format/typeAlejandro Piñeiro2017-02-064-22/+71
| | | | | | | | | | | | | | | | | | Current implementation returns the value for the currently bound read framebuffer. GetNamedFramebufferParameteriv allows to get it for any given framebuffer. GetFramebufferParameteriv would be also interested on that method It was refactored by allowing to pass a given framebuffer. If NULL is passed, it used the currently bound framebuffer. It also adds a call to _mesa_update_state. When used only by GetIntegerv, this one was called as part of the extra checks defined at get_hash. But now that the method is used by more methods, and the update is needed, it makes sense (and it is safer) just calling it on the method itself, instead of rely on the caller. Reviewed-by: Anuj Phogat <[email protected]>