summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* genxml: Rename 3DSTATE_SF::Anti-Aliasing EnableJason Ekstrand2019-08-061-1/+1
| | | | | | | This makes it consistent with the new name when it's moved to 3DSTATE_RASTER. Reviewed-by: Lionel Landwerlin <[email protected]>
* meson: drop unused dep_{thread,dl}Eric Engestrom2019-08-031-4/+4
| | | | | | | | Unused as of last commit. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* meson: replace libmesa_util with idep_mesautilEric Engestrom2019-08-033-10/+8
| | | | | | | | | | | This automates the include_directories and dependencies tracking so that all users of libmesa_util don't need to add them manually. Next commit will remove the ones that were only added for that reason. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* i965/clear: clear_value better precisionSergii Romantsov2019-08-021-1/+1
| | | | | | | | | | | | | | Test-case with depth-clear 0.5 and format MESA_FORMAT_Z24_UNORM_X8_UINT fails due inconsistent clear-value of 0.4999997. Maybe its better to improve? CC: Jason Ekstrand <[email protected]> Fixes: 0ae9ce0f29ea (i965/clear: Quantize the depth clear value based on the format) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111113 Signed-off-by: Sergii Romantsov <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* gallium: Implement GL_EXT_shader_samples_identical via a new capabilityKenneth Graunke2019-08-011-0/+1
| | | | | | | | | This exposes the textureSamplesIdenticalEXT function in GLSL. We enable it for iris and radeonsi, because their compilers already have support for this. Tested on Intel Kabylake and AMD Vega 64. Reviewed-by: Marek Olšák <[email protected]>
* i965: Move device info initialization to common codeMark Janes2019-08-012-114/+6
| | | | | | | | | | | With perf queries, initializing the device info is much more complex than just getting a PCI ID and calling gen_get_device_info. This commit adds a new gen_get_device_info_from_fd helper in common code which does all of the requisite kernel queries to get device info including all of the topology information. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/perf: verify kernel support before registering OA metricsMark Janes2019-08-011-0/+44
| | | | | | | | | | When gen_device_info updates the topology in it's initializer, the kernel queries will fail silently. Iris and anv have minimum kernel requirements that support the queries. i965 must verify kernel support before reporting OA metrics. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* nir: Stop whacking gl_FrontFacing to a system valueJason Ekstrand2019-08-011-0/+1
| | | | | | | | | | We have a cap bit for gallium and a GLSL compiler flag to control this. Just trust what GLSL gives us and stop forcing it. In order for this to be safe, we have to advertise another cap in some of the gallium drivers. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: fix MSVC compile breakageBrian Paul2019-08-011-2/+2
| | | | Trivial.
* gallium: Make PIPE_CAP_DEPTH_CLIP_DISABLE a tri-state value and use itGert Wollny2019-08-011-0/+3
| | | | | | | | | | | Use value "2" to signal that lowering is needed and supported and enable it accordingly. v2: - Note in CAP description that this lowering currently requires TGSI - use "true" instead of GL_TRUE (both Erik) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Signal state changes when depth_clamp is emulatedGert Wollny2019-08-011-1/+25
| | | | | | | | | | | | | v1 implemented by Erik Faye-Lund <[email protected]> v2: - Add GS and TES - fix constants state update flags (Erik) v3: don't update rasterizer when depth_clamp is lowered (Erik) v4: Correct NewDepthClamp and also set flags for NewClipControl (Erik) v5: Also set shader_has_one_variant property acording to possible depth_clamp lowering (Marek) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Add depth clamping to rasterizer codeGert Wollny2019-08-012-6/+39
| | | | | | | | | | implemented by Erik Faye-Lund <[email protected]> v2: Use current depth range values for clamping (Erik) v3: fix scons-win64 build Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Tie depth_clamp code into other shaders (GS and TES)Gert Wollny2019-08-013-1/+36
| | | | | | | | | | | | v2: Use file scope defined depth_range_state in common v3: - don't use the one_shader_variant property, as this is not correct (Marek) - also use tests on available shader stages to enable depth_clamp lowering v4: Don't use key.st, use st directly (Marek) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Tie depth_clamp lowering into the FSGert Wollny2019-08-013-0/+18
| | | | | | | | | v1 implemented by Erik Faye-Lund <[email protected]> v2: Use different call for FS v3: Use file scope defined depth_range_state Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: Tie depth clamp lowering in to the VP codeGert Wollny2019-08-014-0/+32
| | | | | | | | | | | | v1: implemented by Erik Faye-Lund <[email protected]> v2: Add handling of the ARB_clip_control depth mode v3: Move depth_range_state to file scope and remove training zeros (Erik) v4: - don't use the one_shader_variant property, as this is not correct (Marek) - also use tests on available shader stages to enable depth_clamp lowering V5: Don't use key.st, use st directly (Marek) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add tgsi-lowering code for depth-clampErik Faye-Lund2019-08-014-0/+451
| | | | | | | | | | | | | | | | | This is a TGSI pass that lowers depth-clamping into shader-operations, by replacing the depth-value with 0 (a z-coordinate of zero will always pass the OpenGL depth test conditions), and using a dedicated varying to interpolate the real depth-value instead. Finally we replace the depth-output in the fragment shader. v1 implemented by Erik Faye-Lund <[email protected]> v2: Add support for handling depth clip mode, and refactor code v3: - Rename *_vs functions to *_last_vertex_stage (Erik) - Use 0.0 depth to avoid clipping (Erik) v4: Fix inversion of bool value for clip control property Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: replace boolean declarations by boolGert Wollny2019-08-011-2/+2
| | | | | Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Reviewed-by: Marek Olšák <[email protected]>
* state_tracker: Free Labels for querry and tranform_feedbackYevhenii Kolesnikov2019-07-312-0/+2
| | | | | | | Memory leaks were observed on iris with GL_KHR_debug. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add handling for YUV planar surfacesMike Blumenkrantz2019-07-316-7/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | st/dri: this adds a table (similar to the one in i965) which provides mappings for turning various planar formats into multiple sampler views. whereas only NV12 and IYUV were supported, now many more formats are supported here: * P0XX * YUV4XX * YVU4XX * AYUV * XYUV * YUYV * UYVY the table is used directly to handle image creation, simplifying a lot of code and resolving related TODO/FIXME items where workarounds were previously in place to manage NV12 and IYUV formats exclusively st/mesa: the changes here relate to setting up samplers for the planar formats. this requires: * checking for driver support for all the sampler formats * creating the samplers with the corresponding formats and swizzling * running nir_lower_tex with the appropriate options to trigger the lowering for each plane->sampler fixes kwg/mesa#36 Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: Skip scissor rect updates when scissor is entirely disabled.Kenneth Graunke2019-07-311-0/+3
| | | | | | | | | | | | | | | | | If any scissor rectangles are enabled, then we need to set proper scissor rectangles for all viewports. But if the scissor test is entirely disabled, then we can skip updating any scissor rectangles. Without this step, we were updating the scissor rectangles based on the current framebuffer size. So if an app rendered to a variety of render targets at different sizes, with scissor test disabled each time, we'd still be continually updating the scissor rectangles, even though it's not necessary. In Civilization VI, this drops us from 310-350 set_scissor_state calls per frame to 0, as it doesn't appear to use scissor testing. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add an ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: add a couple of ASSERTEDEric Engestrom2019-07-312-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-3115-20/+20
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: replace MAYBE_UNUSED with UNUSEDEric Engestrom2019-07-311-2/+2
| | | | | | | | MAYBE_UNUSED is going away, so let's replace legitimate uses of it with UNUSED, which the former aliased to so far anyway. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* st/tests: drop incorrect MAYBE_UNUSEDEric Engestrom2019-07-311-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: drop MAYBE_UNUSED varEric Engestrom2019-07-311-3/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: drop unused MAYBE_UNUSED functionEric Engestrom2019-07-311-11/+1
| | | | | | | | Added in 1b85c605a60a80975460 but never used. Cc: Jordan Justen <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: replace MAYBE_UNUSED with GEN conditionEric Engestrom2019-07-311-1/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: replace MAYBE_UNUSED with UNUSEDEric Engestrom2019-07-312-6/+6
| | | | | | | | MAYBE_UNUSED is going away, so let's replace legitimate uses of it with UNUSED, which the former aliased to so far anyway. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: drop incorrect MAYBE_UNUSEDEric Engestrom2019-07-312-4/+4
| | | | | | | All these are actually always used. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: add EXT_dsa indexed generic queriesPierre-Eric Pelloux-Prayer2019-07-304-4/+40
| | | | | Only GetPointerIndexedvEXT needs an implementation, the other functions are aliases of existing functions.
* mesa: add EXT_dsa indexed texture commands functionsPierre-Eric Pelloux-Prayer2019-07-303-2/+54
| | | | | | | | | | | | | | | | | | | | | Added functions: - EnableClientStateIndexedEXT - DisableClientStateIndexedEXT - EnableClientStateiEXT - DisableClientStateiEXT Implemented using the idiom provided by the spec: if (array == TEXTURE_COORD_ARRAY) { int savedClientActiveTexture; GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); ClientActiveTexture(TEXTURE0+index); XXX(array); ClientActiveTexture(savedActiveTexture); } else { // Invalid enum }
* mesa: add EXT_dsa (Named)Framebuffer functionsPierre-Eric Pelloux-Prayer2019-07-305-22/+311
| | | | | | | | | | These functions dont support display list as specified: Should the selector-free versions of various OpenGL 3.0 and EXT_framebuffer_object framebuffer object commands not be allowed in display lists [...]? RESOLVED: Yes
* mesa: add EXT_dsa NamedBuffer functionsPierre-Eric Pelloux-Prayer2019-07-303-9/+121
|
* i965/curbe: Look at SYSTEM_VALUE_FRAG_COORD instead of VARYING_SLOT_POSJason Ekstrand2019-07-301-1/+1
| | | | | | | | | | When transitioning gl_FragCoord over to a system value, we missed one instance of VARYING_SLOT_POS in i965. As of this commit, i965 has no references to VARYING_SLOT_POS. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111263 Fixes: 4bb6e6817ec "intel: Use a system value for gl_FragCoord" Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: Add PIPE_CAP_TEXTURE_SHADOW_LODSagar Ghuge2019-07-301-0/+1
| | | | | | | | v2: Line wrap to 80 char (Marek Olsak) Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Enable EXT_texture_shadow_lodSagar Ghuge2019-07-301-0/+1
| | | | | Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: extension boilerplate for EXT_texture_shadow_lodPaulo Zanoni2019-07-302-0/+2
| | | | | | | | With the help of Sagar, Ian and Ivan. Signed-off-by: Paulo Zanoni <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen10: Remove unnecessary workaround.Rafael Antognolli2019-07-291-16/+0
| | | | | | | | | | | | | | | | | | | | In fact, the description of the workaround states that the mask field doesn't work correctly on gen10, and we need to set it to 0xffff even we we only want to update a single field: "The mask bits are not implemented properly on 3DSTATE_3D_MODE. Driver must always program bits 31:16 of DW1 a value of 0xFFFF. This means if it is only updating 1 field, it must update all the fields to the correct value." So unless we want to change any of the fields of 3DSTATE_3D_MODE, there's not need to emit. Additionally, it seems this workaround is not required on gen11. And last but not least, this workaround is not implemented on iris or anv, and it doesn't seem to be missed there. So let's just remove the whole thing. Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Use a system value for gl_FragCoordJason Ekstrand2019-07-292-0/+2
| | | | | | | | | | | | It's kind-of an anomaly that the Intel drivers are still treating gl_FragCoord as an input. It also makes zero sense because we have to special-case it in the back-end. Because ANV is the only user of nir_lower_wpos_center, we go ahead and just update it to look for nir_intrinsic_load_frag_coord as part of this patch. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/spirv: Set frag_coord_is_sysval to GLSLFragCoordIsSysValJason Ekstrand2019-07-291-0/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* intel: replace large stack buffer with heap allocationEric Engestrom2019-07-291-4/+5
| | | | | | | | | For now, this keeps the "100 bytes" allocation; we can try to figure out the correct size as a follow up. Suggested-by: Lionel Landwerlin <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* main: unreference ATIFragmentShader program before creating new oneYevhenii Kolesnikov2019-07-261-1/+4
| | | | | | | Old program was overwritten without release of memory. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* state_tracker: Add destroying routine for feedback and select stagesYevhenii Kolesnikov2019-07-261-2/+2
| | | | | | | Fixes leaking memory on iris. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa: Fix GetTextureImage error reporting, againPierre-Eric Pelloux-Prayer2019-07-251-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Iago Toral Quiroga fixed this in commit 94f740e3fce0cb26e4d90cb9de75b, but it recently regressed in 0d8826f723cd8868b5271f17f18a1ab4548a1199. Quoting Iago's original commit message for the fix: GetTex*Image should return INVALID_ENUM if target is not valid, however, GetTextureImage does not receive a target, and instead should return INVALID_OPERATION if the effective target is not valid. From the OpenGL 4.6 core profile spec, section 8.11 Texture Queries: "An INVALID_OPERATION error is generated by GetTextureImage if the effective target is not one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_RECTANGLE, or TEXTURE_CUBE_MAP (for GetTextureImage only)." Note that this differs from the original ARB_direct_state_access spec. However, the EXT_direct_state_access version does take a target parameter, so it should continue reporting INVALID_ENUM. Fixes KHR-GL45.direct_state_access.textures_image_query_errors. Fixes: 0d8826f723c ("mesa: refactor get_texture_image to remove duplicate code") Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Enable GL_MESA_framebuffer_flip_y for GL 4.3Heinrich Fink2019-07-251-1/+1
| | | | | | | | Extend MESA_framebuffer_flip_y to be used with OpenGL versions 4.3 and higher. OpenGL 4.3 adds FramebufferParameteri needed by this extension. Reviewed-by: Fritz Koenig <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* main: Free memory allocated for gl_bitmap_atlas structureYevhenii Kolesnikov2019-07-241-0/+1
| | | | | | | | | Structure itself wasn't freed during context tear-down, causing a memory leak on iris. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* i965: Use NIR to lower legacy userclipping.Kenneth Graunke2019-07-242-0/+61
| | | | | | | | | | | | | | | This allows us to drop legacy userclip plane handling in both the vec4 and FS backends, and simplifies a few interfaces. v2 (Jason Ekstrand): - Move brw_nir_lower_legacy_clipping to brw_nir_uniforms.cpp because it's i965-specific. - Handle adding the params in brw_nir_lower_legacy_clipping - Call brw_nir_lower_legacy_clipping from brw_codegen_vs_prog Co-authored-by: Jason Ekstrand <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Be more conservative about subgroup sizes in GLJason Ekstrand2019-07-241-0/+2
| | | | | | | | | | | The rules for gl_SubgroupSize in Vulkan require that it be a constant that can be queried through the API. However, all GL requires is that it's a uniform. Instead of always claiming that the subgroup size in the shader is 32 in GL like we have to do for Vulkan, claim 8 for geometry stages, the maximum for fragment shaders, and the actual size for compute. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* main: Fix memleaks in mesa_use_programYevhenii Kolesnikov2019-07-241-0/+2
| | | | | | | | | Add freeing of SubroutineIndexes to the _mesa_free_shader_state. Fixes: 4566aaaa5b1 ("mesa/subroutines: start adding per-context subroutine index support (v1.1)") Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>