summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: only flush vertices when the viewport is differentSamuel Pitoiset2017-06-241-3/+3
| | | | | | | | This prevents glViewport() and friends to always flush and trigger _NEW_VIEWPORT. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove useless comments in the viewport code pathSamuel Pitoiset2017-06-241-10/+2
| | | | | | | No need to explain why calling a driver callback is needed. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i965/miptree: Rework aux enablingJason Ekstrand2017-06-234-122/+120
| | | | | | | | | | | | | | | | | | This commit replaces the complex and confusing set of disable flags with two fairly straightforward fields which describe the intended auxiliary surface usage and whether or not the miptree supports fast clears. Right now, supports_fast_clear can be entirely derived from aux_usage but that will not always be the case. This commit makes functional changes. One of these changes is that it re-enables multisampled fast-clears which were accidentally disabled in cec30a666930ddb8476a9452a89364a24979ff62 around a year ago. Fixing this improves the SynMark v7 DeferredAA test by around ~3% on some gen9 hardware. This commit also gets us closer to enabling CCS_E for window-system buffers which are Y-tiled. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Clamp clear colors to the representable rangeJason Ekstrand2017-06-231-0/+40
| | | | | | | | | | | | Starting with Sky Lake, we can clear to arbitrary floats or integers. Unfortunately, the hardware isn't particularly smart when it comes sampling from that clear color. If the clear color is out of range for the surface format, it will happily return whatever we put in the surface state packet unmodified. In order to avoid returning bogus values for surfaces with a limited range, we need to do some clamping. Cc: "17.1" <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Don't bother with HiZ in renderbuffer_move_to_tempJason Ekstrand2017-06-231-4/+0
| | | | | | This function is only used on gen4-5 which don't support HiZ. Reviewed-by: Chad Versace <[email protected]>
* i965/miptree: Rename the non_msrt_mcs functions to _ccsJason Ekstrand2017-06-233-40/+25
| | | | | | | While we're here, we also make the two support checks static since there are no users outside intel_mipmap_tree.c. Reviewed-by: Chad Versace <[email protected]>
* i965/miptree: Delete the layered rendering resolveJason Ekstrand2017-06-231-14/+0
| | | | | | | | | We never fast-clear more than the base slice (LOD 0, layer 0) anyway, so layered rendering without a resolve is always perfectly safe. Should this ever change in the future, we'll have to put some sort of resolve back in but we can cross that bridge when we come to it. Reviewed-by: Chad Versace <[email protected]>
* i965/cnl: Don't write to Cache Mode Register 1 on gen10+Anuj Phogat2017-06-231-2/+4
| | | | | | | | | | | With below optimizations gone in gen10+ we have nothing left out to write to CACHE_MODE_1: Float Blend Optimization Enable: This bit have been removed in gen10+ Partial Resolve Disable in VC: Recommendation is to always set this field to 0 in gen10+ and that's the default value of the bit. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* drirc: Add glsl_correct_derivatives_after_discard for The Witcher 2Edmondo Tommasina2017-06-231-0/+4
| | | | | | | | This fixes the long-standing problem with black transitions in The Wicher 2. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98238 Signed-off-by: Marek Olšák <[email protected]>
* st/dri: add a drirc workaround for Rocket LeagueMarek Olšák2017-06-232-0/+8
| | | | | | | | | | | | | | This needs to be passed to gallium drivers. No game fix is planned at this time. The addition of glsl_correct_derivatives_after_discard is generally a good thing for mesa compatibility with the broader GL driver ecosystem. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100070 Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't flush vertices in glClientActiveTextureMarek Olšák2017-06-231-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: don't flag _NEW_ARRAY for GL_PRIMITIVE_RESTART_NVMarek Olšák2017-06-231-1/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: remove spurious flush in _mesa_Viewport()Samuel Pitoiset2017-06-231-1/+0
| | | | | | | | | | I don't think this is actually required, if the viewport values are different from the ones stored in the context, we already flush and trigger _NEW_VIEWPORT in set_viewport_no_notify(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove spurious flush in _mesa_DepthRange()Samuel Pitoiset2017-06-231-2/+0
| | | | | | | | | | I don't think this is actually required, if the depth range values are different from the ones stored in the context, we already flush and trigger _NEW_VIEWPORT in set_depth_range_no_notify(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: do not trigger _NEW_TEXTURE_STATE in glActiveTexture()Samuel Pitoiset2017-06-231-2/+0
| | | | | | | | This looks like useless because gl_context::Texture::CurrentUnit is not used by _mesa_update_texture_state() and friends. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add KHR_no_error support for glViewport()Samuel Pitoiset2017-06-232-0/+10
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add viewport() helperSamuel Pitoiset2017-06-231-21/+27
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glViewportArrayv()Samuel Pitoiset2017-06-232-0/+12
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add viewport_array() helperSamuel Pitoiset2017-06-231-7/+14
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glViewportIndexed*()Samuel Pitoiset2017-06-232-0/+22
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: rename ViewportIndexedf() to viewport_indexed_err()Samuel Pitoiset2017-06-231-6/+7
| | | | | | | While are at it, add a 'context' parameter for consistency. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glClipControl()Samuel Pitoiset2017-06-232-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clip_control() helperSamuel Pitoiset2017-06-231-27/+34
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Convert upload_default_color to genxml.Rafael Antognolli2017-06-221-77/+85
| | | | | | | | | | This function was moved to genX_state_upload.c but was still not using genxml. By converting it to genxml, we make some things simpler, like setting haswell's border color state, but others are more complex, since the structs used by each gen are different. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Remove unused code and delete file.Rafael Antognolli2017-06-222-626/+0
| | | | | | | | The sampler state code was all moved to genxml, so we can get rid of these functions and delete the file. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Convert vs, gs, tcs, tes and cs samplers to genxml.Rafael Antognolli2017-06-223-126/+123
| | | | | | | | Since they just use the code that is already available in genX_state_upload.c, convert them in one batch. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Convert fs sampler state to use genxml.Rafael Antognolli2017-06-223-23/+540
| | | | | | | | Also convert some auxiliary functions used by it, and copy upload_default_color to genX_state_upload.c. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Fix -Wunused-variable in gen8_write_pma_stall_bits()Chad Versace2017-06-221-2/+0
| | | | Trivial fix. 'ctx' was unused.
* i965/dri: Add intel_screen param to intel_create_winsys_renderbufferChad Versace2017-06-223-11/+17
| | | | | | | The param is currently unused. It will later be used it to support R8G8B8X8 EGLConfigs on Skylake. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Move brw_context format arrays to intel_screenChad Versace2017-06-224-40/+64
| | | | | | | | | | | | | | | | | | | This allows us to query the driver's supported formats in i965's DRI code, where often there is available a DRIscreen but no GL context. To reduce diff noise, this patch does not completely remove brw_context's format arrays. It just redeclares them as pointers which point to the arrays in intel_screen. Specifically, move these two arrays from brw_context to intel_screen: mesa_to_isl_render_format[] mesa_format_supports_render[] And add a new array to intel_screen, mesa_format_supportex_texture[] which brw_init_surface_formats() copies to ctx->TextureFormatSupported. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Rename some vague format members of brw_contextChad Versace2017-06-229-28/+28
| | | | | | | | | | | | | | | | | | | | | | I'm swimming in a vortex of formats. Mesa formats, isl formats, DRI formats, GL formats, etc. It's easy to misinterpret the following brw_context members unless you've recently read their definition. In upcoming patches, I change them from embedded arrays to simple pointers; after that, even their definition doesn't help, because the MESA_FORMAT_COUNT hint will no longer be present. Rename them to prevent further confusion. While we're renaming, choose shorter names too. -format_supported_as_render_target +mesa_format_supports_render -render_target_format +mesa_to_isl_render_format Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "getteximage: Return correct error value when texure object is not found"Juan A. Suarez Romero2017-06-221-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. But turns out this is a spec bug, and Khronos is fixing it for the next revisions. The proposal is to return INVALID_OPERATION in these cases. This reverts commit 633c959faeae5099fd095f27da7b954e4a36254b. v2: - Use _mesa_lookup_texture_err (Samuel Pitoiset) v3: - _mesa_lookup_texture_err() already handles texture > 0 (Samuel Pitoiset) - Just revert 633c959fae (Juan A. Suarez) Reviewed-by: Samuel Pitoiset <[email protected]> Signed-off-by: Juan A. Suarez Romero <[email protected]>
* i915: Fix gl_Fragcoord interpolationVille Syrjälä2017-06-225-16/+21
| | | | | | | | | | | | | | | | gl_FragCoord contains the window coordinates so it seems to me that we should not use perspective correct interpolation for it. At least now I get similar output as i965/swrast/llvmpipe produce. This fixes dEQP-GLES2.functional.shaders.builtin_variable.fragcoord_w. dEQP-GLES2.functional.shaders.builtin_variable.fragcoord_xyz was already passing, though I'm not quite sure how it managed to do that. v2: Add definitons for the S3 "wrap shortest" bits as well (Ian) Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]>
* mesa: fix using texture id 0 with glTextureSubImage*()Samuel Pitoiset2017-06-221-5/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix using texture id 0 with gl*TextureParameter*()Samuel Pitoiset2017-06-221-4/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix using texture id 0 with VDPAURegisterSurfaceNV()Samuel Pitoiset2017-06-221-3/+3
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Christian König <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix using texture id 0 with glTextureStorage*()Samuel Pitoiset2017-06-221-6/+2
| | | | | | | | This fixes an assertion in debug build, and probably a crash in release build. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: pass the 'caller' function to texturestorage() helperSamuel Pitoiset2017-06-221-10/+13
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: use _mesa_lookup_texture_err() in get_tex_obj_for_clear()Samuel Pitoiset2017-06-221-10/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused _mesa_delete_nameless_texture()Samuel Pitoiset2017-06-222-46/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: check for allocation failures in _mesa_new_texture_object()Samuel Pitoiset2017-06-221-2/+5
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: don't set the border color if it's unusedMarek Olšák2017-06-221-4/+18
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: don't set 16 scissors and 16 viewports if they're unusedMarek Olšák2017-06-224-6/+34
| | | | | | | Only do so if there is a shader writing gl_ViewportIndex. This removes a lot of CPU overhead for the most common case. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: fix pipe_rasterizer_state::scissor with multiple viewportsMarek Olšák2017-06-221-1/+1
| | | | | Cc: 17.1 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify st_update_viewportMarek Olšák2017-06-221-25/+10
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove redundant sample_mask checkingMarek Olšák2017-06-222-7/+1
| | | | | | cso does that too Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use precomputed st_fb_orientationMarek Olšák2017-06-224-8/+8
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't call _mesa_update_clip_plane in the GL core profileMarek Olšák2017-06-221-1/+2
| | | | | | It uses the projection matrix to transform the clip plane. Reviewed-by: Ilia Mirkin <[email protected]>
* st/mesa: set st_context::...num_samplers to 0 when there are no samplersMarek Olšák2017-06-221-1/+3
| | | | | | This was missed during my st/mesa series. Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: unify fail paths for update_single_textureMarek Olšák2017-06-222-7/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>