Compare commits

...

43 Commits

Author SHA1 Message Date
Eric Engestrom
112de3a07a VERSION: bump for 21.3.5 2022-01-26 18:36:23 +00:00
Eric Engestrom
7c4f2f1eb8 docs: add release notes for 21.3.5 2022-01-26 18:36:17 +00:00
Rob Clark
371727f3a7 freedreno/a5xx: Fix clip_mask
The clip_mask needs to also take into account rast->clip_plane_enable

Fixes: 99838513ae ("freedreno/a5xx: Add support for clip distances and use them for userclip.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit 2dfebf3487)
2022-01-26 18:28:31 +00:00
Rob Clark
ea7aac8a3a freedreno/a6xx: Fix clip_mask
The clip_mask needs to also take into account rast->clip_plane_enable

Fixes: f2ae8d116a ("freedreno/a6xx: Implement user clip/cull distances")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit d26cdfac2c)
2022-01-26 18:28:31 +00:00
Rob Clark
a6887c3c4f freedreno: Add FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE
Add a dirty bit for clip_plane_enable changes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit 5e2bd30ea4)
2022-01-26 18:28:31 +00:00
Rob Clark
9c98620378 freedreno: Pass shader cache key instead of shader key
We are going to need to extend the cache key to add state that effects
the program stateobj, but not necessarily the shader itself (ie. so
ir3_shader_key wouldn't be the correct place to add it).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit c190356040)
2022-01-26 18:28:31 +00:00
Rob Clark
935e5fce5e mesa/st: Lowered ucp should still mark rast state dirty
Lowered clip planes should respect the enabled/disabled GL_CLIP_PLANEn
(aka GL_CLIP_DISTANCEn), which means updating the rast state as well.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14643>
(cherry picked from commit 26d591a669)
2022-01-26 18:28:31 +00:00
Kenneth Graunke
12beba1f71 iris: Fix and refactor check for clear color being fully zero
I missed updating this code to check res->aux.clear_color_unknown when
I added it a while back.  While we're here, also refactor this code into
a helper function - I'll want to use it in another place shortly.

Fixes: e83da2d8e3 ("iris: Don't try to CPU read imported clear color BOs")

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
(cherry picked from commit 09072a0803)
2022-01-26 18:28:31 +00:00
Tapani Pälli
102b83d77d mesa: move GetProgramInterfaceiv as a shader_query function
This matches how _mesa_get_program_resourceiv was done and this
makes it possible to skip some validation and shader program lookup
when calling it from glGetProgramiv.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14636>
(cherry picked from commit 1b898d78d8)
2022-01-26 18:28:31 +00:00
Tapani Pälli
36bc6e18a2 mesa: refactor GetProgramiv to use program resource list
This way we make sure glGetActiveUniform and glGetProgramiv
are in sync about active uniform count.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5885
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14589>
(cherry picked from commit 521ede8451)
2022-01-26 18:28:31 +00:00
Alyssa Rosenzweig
fbd47b9d43 panfrost: Only cull polygons
The spec says only polygons, not points/lines, should be culled when
culling is enabled. The hardware does not make this distinction, so we
have to.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
(cherry picked from commit 1e5bb54f59)
2022-01-26 18:28:31 +00:00
Alyssa Rosenzweig
b5ff627603 panfrost: Use u_reduced_prim for primitive checks
Use a Gallium helper that papers over the differences between primitive
types, as required by hardware operation.

[Cc'd to mesa-stable for use in the next commit.]

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14575>
(cherry picked from commit 3f1abda631)
2022-01-26 18:28:31 +00:00
Bas Nieuwenhuizen
f15d2c8d3a util/fossilize_db: Fix double free in error handling.
If the file ptr is not NULL then foz_destroy will also try to destroy it.

Fixes: eca6bb9540 ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14671>
(cherry picked from commit 51416b1a12)
2022-01-26 18:28:30 +00:00
Alejandro Piñeiro
2143a663da vulkan: return default string for undefined enum
Instead of a unreachable.

This would avoid an assert on debug builds that uses vkfoo_to_str to
print structure types. This will become more common as some tests will
start to use VK_STRUCTURE_TYPE_MAX_ENUM to mark structures from
unsupported extensions more often.

v2 (Jason):
   * Include enum name on the default message
   * Handle MAX_ENUM as a special case

v3 (Jason):
   * vk_ObjectType_to_ObjectName don't need to use ${enum.name}

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14525>
(cherry picked from commit 821c66e50c)
2022-01-26 18:28:30 +00:00
Charles Baker
83011a9226 zink: Output PackHalf2x16 to uint not float
Fixes InconsistentSpirv validation errors reporting that PackHalf2x16
outputs uint rather than float.

For example the previous code generates the following SPIR-V with
PackHalf2x16 output as a float:

  %2018 = OpExtInst %float %1 PackHalf2x16 %2017
  %2019 = OpBitcast %uint %2018

The new code generates:

  %2018 = OpExtInst %uint %1 PackHalf2x16 %2017
  %2019 = OpBitcast %uint %2018

cc: mesa-stable

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14568>
(cherry picked from commit 985dae7f41)
2022-01-26 18:28:30 +00:00
Pierre-Eric Pelloux-Prayer
f85939fa86 mesa: use less temporaries in build_lighting
Preallocating temporaries can cause "out of temporaries" error.
Switch to on-demand allocation.

Growing temp_in_use would be an alternative, but some drivers
support less than 64 temps (see PIPE_SHADER_CAP_MAX_TEMPS) so
this wouldn't help them.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5777
Fixes: 272acbed0e ("mesa: merge STATE_LIGHTPROD parameters")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14590>
(cherry picked from commit 3b4d4c7d84)
2022-01-26 18:28:30 +00:00
Pierre-Eric Pelloux-Prayer
823a047198 driconf: enable vs_position_always_invariant for Dirt Rally
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5648
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14614>
(cherry picked from commit 4e4a2d0f97)
2022-01-26 18:28:30 +00:00
Pavel Ondračka
ec6eaf7adf r300: properly initialize new_vs in r300_draw_init_vertex_shader
Fixes the following valgrind warnings:
 Conditional jump or move depends on uninitialised value(s)
    at 0x5D1298C: draw_pt_so_emit_prepare (draw_pt_so_emit.c:95)
    by 0x5D89FD7: llvm_middle_end_prepare (draw_pt_fetch_shade_pipeline_llvm.c:319)
    by 0x5D13BFF: vsplit_prepare (draw_pt_vsplit.c:229)
    by 0x5D0D5D8: draw_pt_arrays.isra.0 (draw_pt.c:124)
    by 0x5D0DA08: draw_instances (draw_pt.c:484)
    by 0x5D0DEB9: draw_vbo (draw_pt.c:610)
    by 0x5E847D6: r300_swtcl_draw_vbo (r300_render.c:901)
    by 0x5D67125: u_vbuf_draw_vbo (u_vbuf.c:1470)
    by 0x5CFCAD3: cso_multi_draw (cso_context.c:1639)
    by 0x58FEC37: st_draw_gallium (st_draw.c:186)
    by 0x5A486BA: _mesa_draw_arrays.part.0 (draw.c:1323)
    by 0x48B4E27: stub_glDrawArrays (piglit-dispatch-gen.c:12421)
  Uninitialised value was created by a stack allocation
    at 0x5E90D3F: r300_draw_init_vertex_shader (r300_vs_draw.c:313)

 Conditional jump or move depends on uninitialised value(s)
    at 0x5D175D9: draw_create_vertex_shader (draw_vs.c:70)
    by 0x5E90E7A: r300_draw_init_vertex_shader (r300_vs_draw.c:366)
    by 0x5E8751F: r300_create_vs_state (r300_state.c:1950)
    by 0x594453B: st_create_common_variant (st_program.c:888)
    by 0x594720C: st_get_common_variant (st_program.c:973)
    by 0x59484B6: st_precompile_shader_variant (st_program.c:1994)
    by 0x59484B6: st_finalize_program (st_program.c:2056)
    by 0x58F0571: st_program_string_notify (st_cb_program.c:128)
    by 0x5928C9B: st_link_tgsi (st_glsl_to_tgsi.cpp:7514)
    by 0x5904B53: st_link_shader (st_glsl_to_ir.cpp:178)
    by 0x58D3E08: _mesa_glsl_link_shader (link_program.cpp:91)
    by 0x58865C7: link_program (shaderapi.c:1363)
    by 0x58865C7: link_program_error.part.0 (shaderapi.c:1474)
    by 0x48DBC5A: stub_glLinkProgram (piglit-dispatch-gen.c:34426)
  Uninitialised value was created by a stack allocation
    at 0x5E90D4F: r300_draw_init_vertex_shader (r300_vs_draw.c:313)

Based on Filip Gawin's
   r300: set new_vs.type to PIPE_SHADER_IR_TGSI

CC: mesa-stable
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14620>
(cherry picked from commit b5b105df96)
2022-01-26 18:28:30 +00:00
Ian Romanick
2c51e96672 intel/fs: Fix gl_FrontFacing optimization on Gfx12+
It's not obvious why the (gl_FrontFacing ? -1.0 : 1.0) case was handled
different for Gfx12+ than for previous generations, and it's not
correct.  It tries to negate the result as an integer, and it does this
before the mask operation that clears the other bits in the value.

When we eventually support dual-SIMD8 dispatch, the other front-facing
bit is in g1.6 at bit 15, so similar code should be possible there.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: c92fb60007 ("intel/fs/gen12: Implement gl_FrontFacing on gen12+.")
Closes: #5876
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14625>
(cherry picked from commit 945fb51fb5)
2022-01-26 18:28:30 +00:00
Mike Blumenkrantz
107c8232e0 zink: stop allocating such massive staging regions for buffer maps
this would allocate a new stream uploader for every map if the offset was
large (e.g., all sparse buffer usage), which almost immediately consumes all vram

cc: mesa-stable

fixes KHR-GL46.CommonBugs.CommonBug_SparseBuffersWithCopyOps

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14381>
(cherry picked from commit d83b52928c)
2022-01-26 18:28:30 +00:00
Emma Anholt
089a957bef softpipe: respect !independent_blend_enable for color masks.
blend_buf is the resolved "are we using independent blending?" index, cbuf
is the RT we're drawing to.

Cc: mesa-stable.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14627>
(cherry picked from commit 263faa3dfb)
2022-01-26 18:28:30 +00:00
Stefan Brüns
ec2e78b3ff llvmpipe: Add get_{driver,device}_uuid implementations
Commit 9da15aa3aa ("llvmpipe: enable EXT_memory_object(_fd)") enabled
the extension, but left this unimplemented.

Leaving this unimplemented causes segfaults for anyone trying to retrieve
the UUIDs, as the calling code in the state tracker does not check if the
function is implemented. This affects e.g. current Wine versions.

Set the UUID to all zeros. Although this slightly violates the vulkan
specification (since 1.2.146), the UUIDs have to match the ones from
lavapipe (lvp_get_physical_device_properties_1_1).

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5865
Fixes: 9da15aa3aa ("llvmpipe: enable EXT_memory_object(_fd)")
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Dave Airlie airlied@redhat.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14558>
(cherry picked from commit 537a0ee3b7)
2022-01-26 18:28:30 +00:00
Lionel Landwerlin
f7a52a16cf anv: fix missing descriptor copy of bufferview/surfacestate content
When doing copies of descriptors from one set to another, that contain
either a UNIFORM_BUFFER or STORAGE_BUFFER, both the buffer view &
surface state are allocated from the source descriptor. Therefore we
need to copy their content otherwise we could run into lifecycle
issues when the source descriptor is destroyed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14585>
(cherry picked from commit acebea9cf1)
2022-01-26 18:28:30 +00:00
Mike Blumenkrantz
85c655f946 zink: check EXT_image_drm_format_modifier for dmabuf support
probably fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/5836

cc: mesa-stable

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14595>
(cherry picked from commit 29cb1c7c13)
2022-01-26 18:28:30 +00:00
Qiang Yu
44bfdb08fb nir: fix nir_tex_instr hash not count is_sparse field
This fixes nir_opt_cse miss replace a non-sparse tex instruction
with a sparse tex instruction and fail the nir_validate_shader().

Fixes: 3a7972f72a ("nir,spirv: add sparse texture fetches")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14362>
(cherry picked from commit 2cee73f0f7)
2022-01-26 18:28:30 +00:00
Rhys Perry
7a579039cc nir/unsigned_upper_bound: don't follow 64-bit f2u32()
Fixes Doom Eternal crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 72ac3f6026 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14555>
(cherry picked from commit d95a0b52e4)
2022-01-26 18:28:30 +00:00
Alyssa Rosenzweig
c7684b11e2 pan/bi: Schedule around blend shader register clobbering
By software ABI, a blend shader is permitted to clobber registers
R0-R15. The scheduler needs to be aware of this, to avoid moving a write
to one of these registers past the BLEND itself. Otherwise the schedule
is invalid.

This bug affects GLES3.0, but is rare enough in practice that we had
missed it. It requires a fragment shader to write to multiple render
targets with attached blend shaders, and have temporaries register
allocated to R0-R15 that are not read by the blend shader, but are sunk
past the BLEND instruction by the scheduler. Prevents a regression when
switching boolean representations on:

dEQP-GLES31.functional.shaders.builtin_functions.integer.uaddcarry.uvec4_lowp_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14577>
(cherry picked from commit b8d37eb1bb)
2022-01-26 18:28:29 +00:00
Lepton Wu
448da15129 driconf: Fix unhandled tags in static conf
A rule with executable_regexp tag would match every executable
without this fix and force_glsl_extensions_warn would be always
set to true which breaks some dEQP tests.

Fixes: 5740ac3701 ("xmlconfig: Add static driconfig support")

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14562>
(cherry picked from commit d15021435e)
2022-01-26 18:28:29 +00:00
Lionel Landwerlin
b4fb2974de intel/fs: disable VRS when omask is written
As indicated by
VkPhysicalDeviceFragmentShadingRatePropertiesKHR::fragmentShadingRateWithShaderSampleMask
our implementation will clamp to 1x1 when reading samplemask or
writing to samplemask.

This fixes vkd3d-proton tests test_sample_mask_dxbc & test_sample_mask_dxil

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b6332fc4a8 ("intel/compiler: handle coarse pixel in render target writes descriptors")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14553>
(cherry picked from commit 30a8b8d2df)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
d3226c6e95 zink: remove SpvMemorySemanticsMakeVisibleMask from nir_intrinsic_memory_barrier
this is invalid since vk memory model isn't used

cc: mesa-stable

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14540>
(cherry picked from commit f0eb07f98f)
2022-01-26 18:28:29 +00:00
Carsten Haitzler
e91c5034a7 panfrost: Don't double-free when handling error for unsupported GPU
Setting the screen ro member before we checked gpu id means the error
case leads to a double-free because screen->ro is set and allocated
by parent who hanbdles de-alloc a second time after we destroyed the
screen we just created because ro was set.

Cc: mesa-stable

Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14516>
(cherry picked from commit 874f4095c5)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
d0e7882abd util/vbuf: fix buffer translation sizing
the original change here attempted to fix calculating the maximum bound for the
mapped readback buffer by adding the maximum attribute size to the final element
used by readback

the calculation was erroneous, however, because it instead calculated the maximum
offset instead of the size, which would cause a different kind of overrun

Fixes: 3c5b7dca30 ("util/vbuf: fix buffer overrun in attribute conversions")

fixes #5846

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14479>
(cherry picked from commit 596d2ab0ad)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
bb025625e1 aux/trace: copy over stream_output_target_offset method from context
this can't be traced, so don't crash

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14481>
(cherry picked from commit 01709464a4)
2022-01-26 18:28:29 +00:00
Yiwei Zhang
fc8bc2d307 venus: VkExternalImageFormatProperties is optional
It's optional even if VkPhysicalDeviceExternalImageFormatInfo is there.

Fixes: 108f386a61 ("venus: initial support for VkPhysicalDevice commands")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14503>
(cherry picked from commit 17b753459e)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
709fd542be zink: use even more accurate stride values for query result copies
this shouldn't be used at all, but some drivers get it wrong and I don't want
to have to fix every driver

Fixes: 039ed2de94 ("zink: always use type size for query result copy stride")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14397>
(cherry picked from commit d3bb5b5dd1)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
bd8a5ae4d8 Revert "zink: when performing an implicit reset, sync qbos"
this appeared to fix some sort of bug related to preserving qbo data,
but really there shouldn't have been any sort of bug anyway since the qbos
all get read back, and thus the data is already preserved

instead, it just preserved the query id, which overloaded the pools and crashed

This reverts commit 79790e276f.

fixes #5669

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14397>
(cherry picked from commit 2fa1bf60d6)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
48174fea16 zink: skip readback of qbos with no results
this is a no-op and also crashes

Fixes: 93190be1b9 ("zink: rewrite query internals")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14397>
(cherry picked from commit b7a4faea9b)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
f36373e072 zink: fix availability buffer sizing/copying for xfb queries
xfb queries have 2 results, and the availability bit is a 3rd result, so
the buffer size has to be at least that big and the copy offset has to reflect
the number of xfb results in the src offset

cc: mesa-stable

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14397>
(cherry picked from commit f8d2770737)
2022-01-26 18:28:29 +00:00
Mike Blumenkrantz
d9b0864420 zink: always set number of timestamp results to 1 for internal qbo
timestamp queries don't accumulate results

Fixes: 93190be1b9 ("zink: rewrite query internals")

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14397>
(cherry picked from commit bf9ac4dfcd)
2022-01-26 18:28:29 +00:00
Eric Engestrom
834af3f195 .pick_status.json: Mark 58a843ab14 as denominated 2022-01-26 18:28:28 +00:00
Eric Engestrom
74cb10a290 .pick_status.json: Mark d1530a3f3b as denominated 2022-01-26 18:28:28 +00:00
Eric Engestrom
fc3c71437e .pick_status.json: Mark 1b88777e97 as denominated 2022-01-26 18:28:28 +00:00
Eric Engestrom
b2ec8bd740 .pick_status.json: Update to 06504fb9e2 2022-01-26 18:28:22 +00:00
49 changed files with 5793 additions and 243 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
21.3.4
21.3.5

143
docs/relnotes/21.3.5.rst Normal file
View File

@@ -0,0 +1,143 @@
Mesa 21.3.5 Release Notes / 2022-01-26
======================================
Mesa 21.3.5 is a bug fix release which fixes bugs found since the 21.3.4 release.
Mesa 21.3.5 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
Mesa 21.3.5 implements the Vulkan 1.2 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
SHA256 checksum
---------------
::
TBD.
New features
------------
- None
Bug fixes
---------
- glGetActiveUniform failing with GL_INVALID_VALUE for no reason
- CopelliaSim crashes on adding vision sensor to a scene on Ubuntu 20+, runs fine on Ubuntu 18.04
- Dirt Rally: Flickering glitches on certain foliage going from Mesa 21.2.5 to 21.3.0
- FrontFacing input is broken on Intel/Vulkan
- llvmpipe: Unimplemented get_driver_uuid/get_device_uuid causes segfaults in e.g. Wine
Changes
-------
Alejandro Piñeiro (1):
- vulkan: return default string for undefined enum
Alyssa Rosenzweig (3):
- pan/bi: Schedule around blend shader register clobbering
- panfrost: Use u_reduced_prim for primitive checks
- panfrost: Only cull polygons
Bas Nieuwenhuizen (1):
- util/fossilize_db: Fix double free in error handling.
Carsten Haitzler (1):
- panfrost: Don't double-free when handling error for unsupported GPU
Charles Baker (1):
- zink: Output PackHalf2x16 to uint not float
Emma Anholt (1):
- softpipe: respect !independent_blend_enable for color masks.
Eric Engestrom (4):
- .pick_status.json: Update to 06504fb9e2382e43b889fd6ca642bb785b544d4d
- .pick_status.json: Mark 1b88777e97f635612c560a2f00d349ea271581b1 as denominated
- .pick_status.json: Mark d1530a3f3b1625baa42e84cba9844b6eb4ac76ce as denominated
- .pick_status.json: Mark 58a843ab14e0eecf044a35154da72cdf7ab6f15a as denominated
Ian Romanick (1):
- intel/fs: Fix gl_FrontFacing optimization on Gfx12+
Kenneth Graunke (1):
- iris: Fix and refactor check for clear color being fully zero
Lepton Wu (1):
- driconf: Fix unhandled tags in static conf
Lionel Landwerlin (2):
- intel/fs: disable VRS when omask is written
- anv: fix missing descriptor copy of bufferview/surfacestate content
Mike Blumenkrantz (10):
- zink: always set number of timestamp results to 1 for internal qbo
- zink: fix availability buffer sizing/copying for xfb queries
- zink: skip readback of qbos with no results
- Revert "zink: when performing an implicit reset, sync qbos"
- zink: use even more accurate stride values for query result copies
- aux/trace: copy over stream_output_target_offset method from context
- util/vbuf: fix buffer translation sizing
- zink: remove SpvMemorySemanticsMakeVisibleMask from nir_intrinsic_memory_barrier
- zink: check EXT_image_drm_format_modifier for dmabuf support
- zink: stop allocating such massive staging regions for buffer maps
Pavel Ondračka (1):
- r300: properly initialize new_vs in r300_draw_init_vertex_shader
Pierre-Eric Pelloux-Prayer (2):
- driconf: enable vs_position_always_invariant for Dirt Rally
- mesa: use less temporaries in build_lighting
Qiang Yu (1):
- nir: fix nir_tex_instr hash not count is_sparse field
Rhys Perry (1):
- nir/unsigned_upper_bound: don't follow 64-bit f2u32()
Rob Clark (5):
- mesa/st: Lowered ucp should still mark rast state dirty
- freedreno: Pass shader cache key instead of shader key
- freedreno: Add FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE
- freedreno/a6xx: Fix clip_mask
- freedreno/a5xx: Fix clip_mask
Stefan Brüns (1):
- llvmpipe: Add get_{driver,device}_uuid implementations
Tapani Pälli (2):
- mesa: refactor GetProgramiv to use program resource list
- mesa: move GetProgramInterfaceiv as a shader_query function
Yiwei Zhang (1):
- venus: VkExternalImageFormatProperties is optional

View File

@@ -272,6 +272,7 @@ hash_tex(uint32_t hash, const nir_tex_instr *instr)
hash = HASH(hash, instr->is_array);
hash = HASH(hash, instr->is_shadow);
hash = HASH(hash, instr->is_new_style_shadow);
hash = HASH(hash, instr->is_sparse);
unsigned component = instr->component;
hash = HASH(hash, component);
for (unsigned i = 0; i < 4; ++i)

View File

@@ -1465,7 +1465,6 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
case nir_op_b32csel:
case nir_op_ubfe:
case nir_op_bfm:
case nir_op_f2u32:
case nir_op_fmul:
case nir_op_extract_u8:
case nir_op_extract_i8:
@@ -1476,6 +1475,7 @@ nir_unsigned_upper_bound(nir_shader *shader, struct hash_table *range_ht,
case nir_op_u2u8:
case nir_op_u2u16:
case nir_op_u2u32:
case nir_op_f2u32:
if (nir_ssa_scalar_chase_alu_src(scalar, 0).def->bit_size > 32) {
/* If src is >32 bits, return max */
return max;

View File

@@ -2271,6 +2271,8 @@ trace_context_create(struct trace_screen *tr_scr,
TR_CTX_INIT(create_stream_output_target);
TR_CTX_INIT(stream_output_target_destroy);
TR_CTX_INIT(set_stream_output_targets);
/* this is lavapipe-only and can't be traced */
tr_ctx->base.stream_output_target_offset = pipe->stream_output_target_offset;
TR_CTX_INIT(resource_copy_region);
TR_CTX_INIT(blit);
TR_CTX_INIT(flush_resource);

View File

@@ -491,9 +491,10 @@ u_vbuf_translate_buffers(struct u_vbuf *mgr, struct translate_key *key,
* themselves, meaning that if stride < element_size, the mapped size will
* be too small and conversion will overrun the map buffer
*
* instead, add the size of the largest possible attribute to ensure the map is large enough
* instead, add the size of the largest possible attribute to the final attribute's offset
* in order to ensure the map is large enough
*/
unsigned last_offset = offset + size - vb->stride;
unsigned last_offset = size - vb->stride;
size = MAX2(size, last_offset + sizeof(double)*4);
}

View File

@@ -454,7 +454,7 @@ fd3_program_create(void *data, struct ir3_shader_variant *bs,
struct ir3_shader_variant *vs, struct ir3_shader_variant *hs,
struct ir3_shader_variant *ds, struct ir3_shader_variant *gs,
struct ir3_shader_variant *fs,
const struct ir3_shader_key *key) in_dt
const struct ir3_cache_key *key) in_dt
{
struct fd_context *ctx = fd_context(data);
struct fd3_program_state *state = CALLOC_STRUCT(fd3_program_state);

View File

@@ -560,7 +560,7 @@ fd4_program_create(void *data, struct ir3_shader_variant *bs,
struct ir3_shader_variant *vs, struct ir3_shader_variant *hs,
struct ir3_shader_variant *ds, struct ir3_shader_variant *gs,
struct ir3_shader_variant *fs,
const struct ir3_shader_key *key) in_dt
const struct ir3_cache_key *key) in_dt
{
struct fd_context *ctx = fd_context(data);
struct fd4_program_state *state = CALLOC_STRUCT(fd4_program_state);

View File

@@ -91,6 +91,7 @@ fd5_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.vastc_srgb = fd5_ctx->vastc_srgb,
.fastc_srgb = fd5_ctx->fastc_srgb,
},
.clip_plane_enable = ctx->rasterizer->clip_plane_enable,
},
.rasterflat = ctx->rasterizer->flatshade,
.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,

View File

@@ -658,7 +658,7 @@ fd5_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
OUT_RING(ring, A5XX_GRAS_CL_VPORT_ZSCALE_0(ctx->viewport.scale[2]));
}
if (dirty & FD_DIRTY_PROG)
if (dirty & (FD_DIRTY_PROG | FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE))
fd5_program_emit(ctx, ring, emit);
if (dirty & FD_DIRTY_RASTERIZER) {

View File

@@ -250,9 +250,12 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
setup_stages(emit, s);
bool do_streamout = (s[VS].v->shader->stream_output.num_outputs > 0);
uint8_t clip_mask = s[VS].v->clip_mask, cull_mask = s[VS].v->cull_mask;
uint8_t clip_mask = s[VS].v->clip_mask,
cull_mask = s[VS].v->cull_mask;
uint8_t clip_cull_mask = clip_mask | cull_mask;
clip_mask &= ctx->rasterizer->clip_plane_enable;
fssz = (s[FS].i->double_threadsize) ? FOUR_QUADS : TWO_QUADS;
pos_regid = ir3_find_output_regid(s[VS].v, VARYING_SLOT_POS);
@@ -711,7 +714,7 @@ fd5_program_create(void *data, struct ir3_shader_variant *bs,
struct ir3_shader_variant *vs, struct ir3_shader_variant *hs,
struct ir3_shader_variant *ds, struct ir3_shader_variant *gs,
struct ir3_shader_variant *fs,
const struct ir3_shader_key *key) in_dt
const struct ir3_cache_key *key) in_dt
{
struct fd_context *ctx = fd_context(data);
struct fd5_program_state *state = CALLOC_STRUCT(fd5_program_state);

View File

@@ -52,7 +52,7 @@ void fd5_emit_shader(struct fd_ringbuffer *ring,
const struct ir3_shader_variant *so);
void fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
struct fd5_emit *emit);
struct fd5_emit *emit) in_dt;
void fd5_prog_init(struct pipe_context *pctx);

View File

@@ -151,7 +151,8 @@ setup_state_map(struct fd_context *ctx)
BIT(FD6_GROUP_ZSA));
fd_context_add_map(ctx, FD_DIRTY_ZSA | FD_DIRTY_BLEND | FD_DIRTY_PROG,
BIT(FD6_GROUP_LRZ) | BIT(FD6_GROUP_LRZ_BINNING));
fd_context_add_map(ctx, FD_DIRTY_PROG, BIT(FD6_GROUP_PROG));
fd_context_add_map(ctx, FD_DIRTY_PROG | FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE,
BIT(FD6_GROUP_PROG));
fd_context_add_map(ctx, FD_DIRTY_RASTERIZER, BIT(FD6_GROUP_RASTERIZER));
fd_context_add_map(ctx,
FD_DIRTY_FRAMEBUFFER | FD_DIRTY_RASTERIZER_DISCARD |

View File

@@ -156,6 +156,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.sample_shading = (ctx->min_samples > 1),
.msaa = (ctx->framebuffer.samples > 1),
},
.clip_plane_enable = ctx->rasterizer->clip_plane_enable,
},
.rasterflat = ctx->rasterizer->flatshade,
.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,
@@ -195,7 +196,7 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
ir3_fixup_shader_state(&ctx->base, &emit.key.key);
if (!(ctx->dirty & FD_DIRTY_PROG)) {
if (!(ctx->gen_dirty & BIT(FD6_GROUP_PROG))) {
emit.prog = fd6_ctx->prog;
} else {
fd6_ctx->prog = fd6_emit_get_prog(&emit);

View File

@@ -351,8 +351,10 @@ next_regid(uint32_t reg, uint32_t increment)
static void
setup_stateobj(struct fd_ringbuffer *ring, struct fd_context *ctx,
struct fd6_program_state *state,
const struct ir3_shader_key *key, bool binning_pass) assert_dt
const struct ir3_cache_key *cache_key,
bool binning_pass) assert_dt
{
const struct ir3_shader_key *key = &cache_key->key;
uint32_t pos_regid, psize_regid, color_regid[8], posz_regid;
uint32_t clip0_regid, clip1_regid;
uint32_t face_regid, coord_regid, zwcoord_regid, samp_id_regid;
@@ -536,6 +538,8 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_context *ctx,
cull_mask = last_shader->cull_mask;
uint8_t clip_cull_mask = clip_mask | cull_mask;
clip_mask &= cache_key->clip_plane_enable;
/* If we have streamout, link against the real FS, rather than the
* dummy FS used for binning pass state, to ensure the OUTLOC's
* match. Depending on whether we end up doing sysmem or gmem,
@@ -1184,7 +1188,7 @@ fd6_program_create(void *data, struct ir3_shader_variant *bs,
struct ir3_shader_variant *vs, struct ir3_shader_variant *hs,
struct ir3_shader_variant *ds, struct ir3_shader_variant *gs,
struct ir3_shader_variant *fs,
const struct ir3_shader_key *key) in_dt
const struct ir3_cache_key *key) in_dt
{
struct fd_context *ctx = fd_context(data);
struct fd6_program_state *state = CALLOC_STRUCT(fd6_program_state);

View File

@@ -172,8 +172,9 @@ enum fd_dirty_3d_state {
* from hw perspective:
*/
FD_DIRTY_RASTERIZER_DISCARD = BIT(24),
FD_DIRTY_BLEND_DUAL = BIT(25),
#define NUM_DIRTY_BITS 26
FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE = BIT(25),
FD_DIRTY_BLEND_DUAL = BIT(26),
#define NUM_DIRTY_BITS 27
/* additional flag for state requires updated resource tracking: */
FD_DIRTY_RESOURCE = BIT(31),

View File

@@ -38,6 +38,8 @@
#include "freedreno_texture.h"
#include "freedreno_util.h"
#define get_safe(ptr, field) ((ptr) ? (ptr)->field : 0)
/* All the generic state handling.. In case of CSO's that are specific
* to the GPU version, when the bind and the delete are common they can
* go in here.
@@ -434,7 +436,8 @@ fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso) in_dt
{
struct fd_context *ctx = fd_context(pctx);
struct pipe_scissor_state *old_scissor = fd_context_get_scissor(ctx);
bool discard = ctx->rasterizer && ctx->rasterizer->rasterizer_discard;
bool discard = get_safe(ctx->rasterizer, rasterizer_discard);
unsigned clip_plane_enable = get_safe(ctx->rasterizer, clip_plane_enable);
ctx->rasterizer = hwcso;
fd_context_dirty(ctx, FD_DIRTY_RASTERIZER);
@@ -453,8 +456,11 @@ fd_rasterizer_state_bind(struct pipe_context *pctx, void *hwcso) in_dt
if (old_scissor != fd_context_get_scissor(ctx))
fd_context_dirty(ctx, FD_DIRTY_SCISSOR);
if (ctx->rasterizer && (discard != ctx->rasterizer->rasterizer_discard))
if (discard != get_safe(ctx->rasterizer, rasterizer_discard))
fd_context_dirty(ctx, FD_DIRTY_RASTERIZER_DISCARD);
if (clip_plane_enable != get_safe(ctx->rasterizer, clip_plane_enable))
fd_context_dirty(ctx, FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE);
}
static void

View File

@@ -157,7 +157,7 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key,
cache->data, bs, variants[MESA_SHADER_VERTEX],
variants[MESA_SHADER_TESS_CTRL], variants[MESA_SHADER_TESS_EVAL],
variants[MESA_SHADER_GEOMETRY], variants[MESA_SHADER_FRAGMENT],
&key->key);
key);
state->key = *key;
/* NOTE: uses copy of key in state obj, because pointer passed by caller

View File

@@ -27,6 +27,8 @@
#ifndef IR3_CACHE_H_
#define IR3_CACHE_H_
#include "pipe/p_state.h"
#include "ir3/ir3_shader.h"
/*
@@ -39,6 +41,11 @@
struct ir3_cache_key {
struct ir3_shader_state *vs, *hs, *ds, *gs, *fs; // 5 pointers
struct ir3_shader_key key; // 7 dwords
/* Additional state that effects the cached program state, but
* not the compiled shader:
*/
unsigned clip_plane_enable : PIPE_MAX_CLIP_PLANES;
};
/* per-gen backend program state object should subclass this for it's
@@ -54,7 +61,7 @@ struct ir3_cache_funcs {
void *data, struct ir3_shader_variant *bs, /* binning pass vs */
struct ir3_shader_variant *vs, struct ir3_shader_variant *hs,
struct ir3_shader_variant *ds, struct ir3_shader_variant *gs,
struct ir3_shader_variant *fs, const struct ir3_shader_key *key);
struct ir3_shader_variant *fs, const struct ir3_cache_key *key);
void (*destroy_state)(void *data, struct ir3_program_state *state);
};

View File

@@ -337,6 +337,16 @@ pipe_format_for_aspect(enum pipe_format format, unsigned pipe_mask)
}
}
static bool
clear_color_is_fully_zero(const struct iris_resource *res)
{
return !res->aux.clear_color_unknown &&
res->aux.clear_color.u32[0] == 0 &&
res->aux.clear_color.u32[1] == 0 &&
res->aux.clear_color.u32[2] == 0 &&
res->aux.clear_color.u32[3] == 0;
}
/**
* The pipe->blit() driver hook.
*
@@ -590,10 +600,7 @@ get_copy_region_aux_settings(struct iris_context *ice,
* original format (e.g. A8_UNORM/R8_UINT).
*/
*out_clear_supported = (devinfo->ver >= 11 && !is_render_target) ||
(res->aux.clear_color.u32[0] == 0 &&
res->aux.clear_color.u32[1] == 0 &&
res->aux.clear_color.u32[2] == 0 &&
res->aux.clear_color.u32[3] == 0);
clear_color_is_fully_zero(res);
break;
default:
*out_aux_usage = ISL_AUX_USAGE_NONE;

View File

@@ -560,6 +560,18 @@ llvmpipe_get_compute_param(struct pipe_screen *_screen,
return 0;
}
static void
llvmpipe_get_driver_uuid(struct pipe_screen *pscreen, char *uuid)
{
memset(uuid, 0, PIPE_UUID_SIZE);
}
static void
llvmpipe_get_device_uuid(struct pipe_screen *pscreen, char *uuid)
{
memset(uuid, 0, PIPE_UUID_SIZE);
}
static const struct nir_shader_compiler_options gallivm_nir_options = {
.lower_scmp = true,
.lower_flrp32 = true,
@@ -1040,6 +1052,9 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
screen->base.get_timestamp = llvmpipe_get_timestamp;
screen->base.get_driver_uuid = llvmpipe_get_driver_uuid;
screen->base.get_device_uuid = llvmpipe_get_device_uuid;
screen->base.finalize_nir = llvmpipe_finalize_nir;
screen->base.get_disk_shader_cache = lp_get_disk_shader_cache;

View File

@@ -2715,7 +2715,8 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
}
}
bool points = info->mode == PIPE_PRIM_POINTS;
enum pipe_prim_type prim = u_reduced_prim(info->mode);
bool polygon = (prim == PIPE_PRIM_TRIANGLES);
void *prim_size = pan_section_ptr(job, TILER_JOB, PRIMITIVE_SIZE);
#if PAN_ARCH >= 6
@@ -2731,8 +2732,17 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
cfg.four_components_per_vertex = true;
cfg.draw_descriptor_is_64b = true;
cfg.front_face_ccw = rast->front_ccw;
cfg.cull_front_face = rast->cull_face & PIPE_FACE_FRONT;
cfg.cull_back_face = rast->cull_face & PIPE_FACE_BACK;
/*
* From the Gallium documentation,
* pipe_rasterizer_state::cull_face "indicates which faces of
* polygons to cull". Points and lines are not considered
* polygons and should be drawn even if all faces are culled.
* The hardware does not take primitive type into account when
* culling, so we need to do that check ourselves.
*/
cfg.cull_front_face = polygon && (rast->cull_face & PIPE_FACE_FRONT);
cfg.cull_back_face = polygon && (rast->cull_face & PIPE_FACE_BACK);
cfg.position = pos;
cfg.state = batch->rsd[PIPE_SHADER_FRAGMENT];
cfg.attributes = batch->attribs[PIPE_SHADER_FRAGMENT];
@@ -2746,9 +2756,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
* be set to 0 and the provoking vertex is selected with the
* PRIMITIVE.first_provoking_vertex field.
*/
if (info->mode == PIPE_PRIM_LINES ||
info->mode == PIPE_PRIM_LINE_LOOP ||
info->mode == PIPE_PRIM_LINE_STRIP) {
if (prim == PIPE_PRIM_LINES) {
/* The logic is inverted across arches. */
cfg.flat_shading_vertex = rast->flatshade_first
^ (PAN_ARCH <= 5);
@@ -2769,7 +2777,7 @@ panfrost_draw_emit_tiler(struct panfrost_batch *batch,
}
}
panfrost_emit_primitive_size(ctx, points, psiz, prim_size);
panfrost_emit_primitive_size(ctx, prim == PIPE_PRIM_POINTS, psiz, prim_size);
}
static void

View File

@@ -841,8 +841,6 @@ panfrost_create_screen(int fd, struct renderonly *ro)
if (dev->debug & PAN_DBG_NO_AFBC)
dev->has_afbc = false;
dev->ro = ro;
/* Check if we're loading against a supported GPU model. */
switch (dev->gpu_id) {
@@ -862,6 +860,8 @@ panfrost_create_screen(int fd, struct renderonly *ro)
return NULL;
}
dev->ro = ro;
screen->base.destroy = panfrost_destroy_screen;
screen->base.get_name = panfrost_get_name;

View File

@@ -312,15 +312,17 @@ void r300_draw_init_vertex_shader(struct r300_context *r300,
struct r300_vertex_shader *vs)
{
struct draw_context *draw = r300->draw;
struct pipe_shader_state new_vs;
struct tgsi_shader_info info;
struct vs_transform_context transform;
const uint newLen = tgsi_num_tokens(vs->state.tokens) + 100 /* XXX */;
struct pipe_shader_state new_vs = {
.type = PIPE_SHADER_IR_TGSI,
.tokens = tgsi_alloc_tokens(newLen)
};
unsigned i;
tgsi_scan_shader(vs->state.tokens, &info);
new_vs.tokens = tgsi_alloc_tokens(newLen);
if (new_vs.tokens == NULL)
return;

View File

@@ -440,7 +440,6 @@ dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.blit_framebuffer
dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.read_pixels_fbo_format_mismatch,Fail
dEQP-GLES31.functional.debug.negative_coverage.log.buffer.read_pixels_fbo_format_mismatch,Fail
dEQP-GLES31.functional.draw_base_vertex.draw_elements_instanced_base_vertex.line_loop.instanced_attributes,Fail
dEQP-GLES31.functional.draw_buffers_indexed.overwrite_indexed.common_color_mask_buffer_color_mask,Fail
dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.0,Fail
dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.1,Fail
dEQP-GLES31.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.10,Fail

View File

@@ -1,3 +1,2 @@
dEQP-GLES31.functional.draw_buffers_indexed.overwrite_indexed.common_color_mask_buffer_color_mask
dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.const_literal.geometry.isampler2darray
dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.const_literal.geometry.isampler3d

View File

@@ -1005,7 +1005,7 @@ blend_fallback(struct quad_stage *qs,
rebase_colors(bqs->base_format[cbuf], quadColor);
if (blend->rt[blend_buf].colormask != 0xf)
colormask_quad( blend->rt[cbuf].colormask, quadColor, dest);
colormask_quad( blend->rt[blend_buf].colormask, quadColor, dest);
/* Output color values
*/

View File

@@ -1742,7 +1742,13 @@ emit_alu(struct ntv_context *ctx, nir_alu_instr *alu)
BUILTIN_UNOP(nir_op_ufind_msb, GLSLstd450FindUMsb)
BUILTIN_UNOP(nir_op_find_lsb, GLSLstd450FindILsb)
BUILTIN_UNOP(nir_op_ifind_msb, GLSLstd450FindSMsb)
BUILTIN_UNOPF(nir_op_pack_half_2x16, GLSLstd450PackHalf2x16)
case nir_op_pack_half_2x16:
assert(nir_op_infos[alu->op].num_inputs == 1);
result = emit_builtin_unop(ctx, GLSLstd450PackHalf2x16, get_dest_type(ctx, &alu->dest.dest, nir_type_uint), src[0]);
force_float = true;
break;
BUILTIN_UNOPF(nir_op_unpack_half_2x16, GLSLstd450UnpackHalf2x16)
BUILTIN_UNOPF(nir_op_pack_64_2x32, GLSLstd450PackDouble2x32)
#undef BUILTIN_UNOP
@@ -2869,7 +2875,7 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
case nir_intrinsic_memory_barrier:
spirv_builder_emit_memory_barrier(&ctx->builder, SpvScopeWorkgroup,
SpvMemorySemanticsImageMemoryMask | SpvMemorySemanticsUniformMemoryMask |
SpvMemorySemanticsMakeVisibleMask | SpvMemorySemanticsAcquireReleaseMask);
SpvMemorySemanticsAcquireReleaseMask);
break;
case nir_intrinsic_memory_barrier_image:

View File

@@ -183,22 +183,6 @@ is_bool_query(struct zink_query *query)
query->type == PIPE_QUERY_GPU_FINISHED;
}
static void
qbo_sync_from_prev(struct zink_context *ctx, struct zink_query *query, unsigned id_offset, unsigned last_start)
{
assert(id_offset);
struct zink_query_buffer *prev = list_last_entry(&query->buffers, struct zink_query_buffer, list);
unsigned result_size = get_num_results(query->type) * sizeof(uint64_t);
/* this is get_buffer_offset() but without the zink_query object */
unsigned qbo_offset = last_start * get_num_results(query->type) * sizeof(uint64_t);
query->curr_query = id_offset;
query->curr_qbo->num_results = id_offset;
zink_copy_buffer(ctx, zink_resource(query->curr_qbo->buffer), zink_resource(prev->buffer), 0,
qbo_offset,
id_offset * result_size);
}
static bool
qbo_append(struct pipe_screen *screen, struct zink_query *query)
{
@@ -459,6 +443,8 @@ get_query_result(struct pipe_context *pctx,
uint64_t *xfb_results = NULL;
uint64_t *results;
bool is_timestamp = query->type == PIPE_QUERY_TIMESTAMP || query->type == PIPE_QUERY_TIMESTAMP_DISJOINT;
if (!qbo->num_results)
continue;
results = pipe_buffer_map_range(pctx, qbo->buffer, 0,
(is_timestamp ? 1 : qbo->num_results) * result_size, flags, &xfer);
if (!results) {
@@ -563,7 +549,7 @@ copy_pool_results_to_buffer(struct zink_context *ctx, struct zink_query *query,
util_range_add(&res->base.b, &res->valid_buffer_range, offset, offset + result_size);
assert(query_id < NUM_QUERIES);
VKCTX(CmdCopyQueryPoolResults)(batch->state->cmdbuf, pool, query_id, num_results, res->obj->buffer,
offset, type_size, flags);
offset, base_result_size, flags);
}
static void
@@ -575,8 +561,6 @@ copy_results_to_buffer(struct zink_context *ctx, struct zink_query *query, struc
static void
reset_pool(struct zink_context *ctx, struct zink_batch *batch, struct zink_query *q)
{
unsigned last_start = q->last_start;
unsigned id_offset = q->curr_query - q->last_start;
/* This command must only be called outside of a render pass instance
*
* - vkCmdResetQueryPool spec
@@ -605,8 +589,6 @@ reset_pool(struct zink_context *ctx, struct zink_batch *batch, struct zink_query
reset_qbo(q);
else
debug_printf("zink: qbo alloc failed on reset!");
if (id_offset)
qbo_sync_from_prev(ctx, q, id_offset, last_start);
}
static inline unsigned
@@ -650,6 +632,8 @@ update_qbo(struct zink_context *ctx, struct zink_query *q)
if (!is_timestamp)
q->curr_qbo->num_results++;
else
q->curr_qbo->num_results = 1;
q->needs_update = false;
}
@@ -1014,17 +998,18 @@ zink_get_query_result_resource(struct pipe_context *pctx,
*/
VkQueryResultFlags flag = is_time_query(query) ? 0 : VK_QUERY_RESULT_PARTIAL_BIT;
unsigned src_offset = result_size * get_num_results(query->type);
if (zink_batch_usage_check_completion(ctx, query->batch_id)) {
uint64_t u64[2] = {0};
if (VKCTX(GetQueryPoolResults)(screen->dev, query->query_pool, query_id, 1, 2 * result_size, u64,
uint64_t u64[4] = {0};
if (VKCTX(GetQueryPoolResults)(screen->dev, query->query_pool, query_id, 1, sizeof(u64), u64,
0, size_flags | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | flag) == VK_SUCCESS) {
pipe_buffer_write(pctx, pres, offset, result_size, (unsigned char*)u64 + result_size);
pipe_buffer_write(pctx, pres, offset, result_size, (unsigned char*)u64 + src_offset);
return;
}
}
struct pipe_resource *staging = pipe_buffer_create(pctx->screen, 0, PIPE_USAGE_STAGING, result_size * 2);
struct pipe_resource *staging = pipe_buffer_create(pctx->screen, 0, PIPE_USAGE_STAGING, src_offset + result_size);
copy_results_to_buffer(ctx, query, zink_resource(staging), 0, 1, size_flags | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT | flag);
zink_copy_buffer(ctx, res, zink_resource(staging), offset, result_size, result_size);
zink_copy_buffer(ctx, res, zink_resource(staging), offset, result_size * get_num_results(query->type), result_size);
pipe_resource_reference(&staging, NULL);
return;
}

View File

@@ -1231,13 +1231,13 @@ zink_buffer_map(struct pipe_context *pctx,
mgr = ctx->tc->base.stream_uploader;
else
mgr = ctx->base.stream_uploader;
u_upload_alloc(mgr, 0, box->width + box->x,
u_upload_alloc(mgr, 0, box->width,
screen->info.props.limits.minMemoryMapAlignment, &offset,
(struct pipe_resource **)&trans->staging_res, (void **)&ptr);
res = zink_resource(trans->staging_res);
trans->offset = offset + box->x;
trans->offset = offset;
usage |= PIPE_MAP_UNSYNCHRONIZED;
ptr = ((uint8_t *)ptr) + box->x;
ptr = ((uint8_t *)ptr);
} else {
/* At this point, the buffer is always idle (we checked it above). */
usage |= PIPE_MAP_UNSYNCHRONIZED;

View File

@@ -671,7 +671,10 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return MIN2(screen->info.props.limits.maxVertexOutputComponents / 4 / 2, 16);
case PIPE_CAP_DMABUF:
return screen->info.have_KHR_external_memory_fd && screen->info.have_EXT_external_memory_dma_buf && screen->info.have_EXT_queue_family_foreign;
return screen->info.have_KHR_external_memory_fd &&
screen->info.have_EXT_external_memory_dma_buf &&
screen->info.have_EXT_queue_family_foreign &&
screen->info.have_EXT_image_drm_format_modifier;
case PIPE_CAP_DEPTH_BOUNDS_TEST:
return screen->info.feats.features.depthBounds;
@@ -1941,9 +1944,11 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
screen->base.get_compiler_options = zink_get_compiler_options;
screen->base.get_sample_pixel_grid = zink_get_sample_pixel_grid;
screen->base.is_format_supported = zink_is_format_supported;
screen->base.query_dmabuf_modifiers = zink_query_dmabuf_modifiers;
screen->base.is_dmabuf_modifier_supported = zink_is_dmabuf_modifier_supported;
screen->base.get_dmabuf_modifier_planes = zink_get_dmabuf_modifier_planes;
if (screen->info.have_EXT_image_drm_format_modifier && screen->info.have_EXT_external_memory_dma_buf) {
screen->base.query_dmabuf_modifiers = zink_query_dmabuf_modifiers;
screen->base.is_dmabuf_modifier_supported = zink_is_dmabuf_modifier_supported;
screen->base.get_dmabuf_modifier_planes = zink_get_dmabuf_modifier_planes;
}
screen->base.context_create = zink_context_create;
screen->base.flush_frontbuffer = zink_flush_frontbuffer;
screen->base.destroy = zink_destroy_screen;

View File

@@ -9675,6 +9675,7 @@ brw_nir_populate_wm_prog_data(const nir_shader *shader,
prog_data->per_coarse_pixel_dispatch =
key->coarse_pixel &&
!prog_data->uses_omask &&
!prog_data->persample_dispatch &&
!prog_data->uses_sample_mask &&
(prog_data->computed_depth_mode == BRW_PSCDEPTH_OFF) &&

View File

@@ -547,17 +547,16 @@ fs_visitor::optimize_frontfacing_ternary(nir_alu_instr *instr,
/* For (gl_FrontFacing ? 1.0 : -1.0), emit:
*
* or(8) tmp.1<2>W g0.0<0,1,0>W 0x00003f80W
* or(8) tmp.1<2>W g1.1<0,1,0>W 0x00003f80W
* and(8) dst<1>D tmp<8,8,1>D 0xbf800000D
*
* and negate the result for (gl_FrontFacing ? -1.0 : 1.0).
* and negate g1.1<0,1,0>W for (gl_FrontFacing ? -1.0 : 1.0).
*/
if (value1 == -1.0f)
g1.negate = true;
bld.OR(subscript(tmp, BRW_REGISTER_TYPE_W, 1),
g1, brw_imm_uw(0x3f80));
if (value1 == -1.0f)
bld.MOV(tmp, negate(tmp));
} else if (devinfo->ver >= 6) {
/* Bit 15 of g0.0 is 0 if the polygon is front facing. */
fs_reg g0 = fs_reg(retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_W));

View File

@@ -1702,8 +1702,36 @@ void anv_UpdateDescriptorSets(
copy->srcArrayElement,
copy->descriptorCount);
} else {
for (uint32_t j = 0; j < copy->descriptorCount; j++)
dst_desc[j] = src_desc[j];
struct anv_buffer_view *dst_bview =
&dst->buffer_views[dst_layout->buffer_view_index +
copy->dstArrayElement];
struct anv_buffer_view *src_bview =
&src->buffer_views[src_layout->buffer_view_index +
copy->srcArrayElement];
/* If ANV_DESCRIPTOR_BUFFER_VIEW is present in the source descriptor,
* it means we're using an anv_buffer_view allocated by the source
* descriptor set. In that case we want to careful copy it because
* his lifecycle is tied to the source descriptor set, not the
* destination descriptor set.
*/
if (src_layout->data & ANV_DESCRIPTOR_BUFFER_VIEW) {
assert(dst_layout->data & ANV_DESCRIPTOR_BUFFER_VIEW);
for (uint32_t j = 0; j < copy->descriptorCount; j++) {
dst_bview[j].format = src_bview[j].format;
dst_bview[j].range = src_bview[j].range;
dst_bview[j].address = src_bview[j].address;
memcpy(dst_bview[j].surface_state.map,
src_bview[j].surface_state.map,
src_bview[j].surface_state.alloc_size);
dst_desc[j].type = src_desc[j].type;
dst_desc[j].buffer_view = &dst_bview[j];
}
} else {
for (uint32_t j = 0; j < copy->descriptorCount; j++)
dst_desc[j] = src_desc[j];
}
unsigned desc_size = anv_descriptor_size(src_layout);
if (desc_size > 0) {

View File

@@ -918,19 +918,19 @@ static struct ureg get_scenecolor( struct tnl_program *p, GLuint side )
static struct ureg get_lightprod( struct tnl_program *p, GLuint light,
GLuint side, GLuint property )
GLuint side, GLuint property, bool *is_state_light )
{
GLuint attrib = material_attrib(side, property);
if (p->materials & (1<<attrib)) {
struct ureg light_value =
register_param3(p, STATE_LIGHT, light, property);
struct ureg material_value = get_material(p, side, property);
struct ureg tmp = get_temp(p);
emit_op2(p, OPCODE_MUL, tmp, 0, light_value, material_value);
return tmp;
*is_state_light = true;
return light_value;
}
else
else {
*is_state_light = false;
return register_param3(p, STATE_LIGHTPROD, light, attrib);
}
}
@@ -1112,20 +1112,28 @@ static void build_lighting( struct tnl_program *p )
*/
struct ureg lightprod_front[MAX_LIGHTS][3];
struct ureg lightprod_back[MAX_LIGHTS][3];
bool lightprod_front_is_state_light[MAX_LIGHTS][3];
bool lightprod_back_is_state_light[MAX_LIGHTS][3];
for (i = 0; i < MAX_LIGHTS; i++) {
if (p->state->unit[i].light_enabled) {
lightprod_front[i][0] = get_lightprod(p, i, 0, STATE_AMBIENT);
lightprod_front[i][0] = get_lightprod(p, i, 0, STATE_AMBIENT,
&lightprod_front_is_state_light[i][0]);
if (twoside)
lightprod_back[i][0] = get_lightprod(p, i, 1, STATE_AMBIENT);
lightprod_back[i][0] = get_lightprod(p, i, 1, STATE_AMBIENT,
&lightprod_back_is_state_light[i][0]);
lightprod_front[i][1] = get_lightprod(p, i, 0, STATE_DIFFUSE);
lightprod_front[i][1] = get_lightprod(p, i, 0, STATE_DIFFUSE,
&lightprod_front_is_state_light[i][1]);
if (twoside)
lightprod_back[i][1] = get_lightprod(p, i, 1, STATE_DIFFUSE);
lightprod_back[i][1] = get_lightprod(p, i, 1, STATE_DIFFUSE,
&lightprod_back_is_state_light[i][1]);
lightprod_front[i][2] = get_lightprod(p, i, 0, STATE_SPECULAR);
lightprod_front[i][2] = get_lightprod(p, i, 0, STATE_SPECULAR,
&lightprod_front_is_state_light[i][2]);
if (twoside)
lightprod_back[i][2] = get_lightprod(p, i, 1, STATE_SPECULAR);
lightprod_back[i][2] = get_lightprod(p, i, 1, STATE_SPECULAR,
&lightprod_back_is_state_light[i][2]);
}
}
@@ -1209,6 +1217,18 @@ static void build_lighting( struct tnl_program *p )
/* Front face lighting:
*/
{
/* Transform STATE_LIGHT into STATE_LIGHTPROD if needed. This isn't done in
* get_lightprod to avoid using too many temps.
*/
for (int j = 0; j < 3; j++) {
if (lightprod_front_is_state_light[i][j]) {
struct ureg material_value = get_material(p, 0, STATE_AMBIENT + j);
struct ureg tmp = get_temp(p);
emit_op2(p, OPCODE_MUL, tmp, 0, lightprod_front[i][j], material_value);
lightprod_front[i][j] = tmp;
}
}
struct ureg ambient = lightprod_front[i][0];
struct ureg diffuse = lightprod_front[i][1];
struct ureg specular = lightprod_front[i][2];
@@ -1264,6 +1284,18 @@ static void build_lighting( struct tnl_program *p )
/* Back face lighting:
*/
if (twoside) {
/* Transform STATE_LIGHT into STATE_LIGHTPROD if needed. This isn't done in
* get_lightprod to avoid using too many temps.
*/
for (int j = 0; j < 3; j++) {
if (lightprod_back_is_state_light[i][j]) {
struct ureg material_value = get_material(p, 1, STATE_AMBIENT + j);
struct ureg tmp = get_temp(p);
emit_op2(p, OPCODE_MUL, tmp, 1, lightprod_back[i][j], material_value);
lightprod_back[i][j] = tmp;
}
}
struct ureg ambient = lightprod_back[i][0];
struct ureg diffuse = lightprod_back[i][1];
struct ureg specular = lightprod_back[i][2];

View File

@@ -97,7 +97,6 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
_mesa_enum_to_string(pname), params);
}
unsigned i;
struct gl_shader_program *shProg =
_mesa_lookup_shader_program_err(ctx, program,
"glGetProgramInterfaceiv");
@@ -117,125 +116,7 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
return;
}
/* Validate pname against interface. */
switch(pname) {
case GL_ACTIVE_RESOURCES:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++)
if (shProg->data->ProgramResourceList[i].Type == programInterface)
(*params)++;
break;
case GL_MAX_NAME_LENGTH:
if (programInterface == GL_ATOMIC_COUNTER_BUFFER ||
programInterface == GL_TRANSFORM_FEEDBACK_BUFFER) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
_mesa_enum_to_string(pname));
return;
}
/* Name length consists of base name, 3 additional chars '[0]' if
* resource is an array and finally 1 char for string terminator.
*/
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type != programInterface)
continue;
unsigned len =
_mesa_program_resource_name_len(&shProg->data->ProgramResourceList[i]);
*params = MAX2(*params, len + 1);
}
break;
case GL_MAX_NUM_ACTIVE_VARIABLES:
switch (programInterface) {
case GL_UNIFORM_BLOCK:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_block *block =
(struct gl_uniform_block *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, block->NumUniforms);
}
}
break;
case GL_SHADER_STORAGE_BLOCK:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_block *block =
(struct gl_uniform_block *)
shProg->data->ProgramResourceList[i].Data;
GLint block_params = 0;
for (unsigned j = 0; j < block->NumUniforms; j++) {
struct gl_program_resource *uni =
_mesa_program_resource_find_active_variable(
shProg,
GL_BUFFER_VARIABLE,
block,
j);
if (!uni)
continue;
block_params++;
}
*params = MAX2(*params, block_params);
}
}
break;
case GL_ATOMIC_COUNTER_BUFFER:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_active_atomic_buffer *buffer =
(struct gl_active_atomic_buffer *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, buffer->NumUniforms);
}
}
break;
case GL_TRANSFORM_FEEDBACK_BUFFER:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_transform_feedback_buffer *buffer =
(struct gl_transform_feedback_buffer *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, buffer->NumVaryings);
}
}
break;
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
_mesa_enum_to_string(pname));
}
break;
case GL_MAX_NUM_COMPATIBLE_SUBROUTINES:
switch (programInterface) {
case GL_VERTEX_SUBROUTINE_UNIFORM:
case GL_FRAGMENT_SUBROUTINE_UNIFORM:
case GL_GEOMETRY_SUBROUTINE_UNIFORM:
case GL_COMPUTE_SUBROUTINE_UNIFORM:
case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM: {
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_storage *uni =
(struct gl_uniform_storage *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, uni->num_compatible_subroutines);
}
}
break;
}
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
_mesa_enum_to_string(pname));
}
break;
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(pname %s)",
_mesa_enum_to_string(pname));
}
_mesa_get_program_interfaceiv(shProg, programInterface, pname, params);
}
static bool

View File

@@ -1668,6 +1668,135 @@ _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
*length = amount;
}
extern void
_mesa_get_program_interfaceiv(struct gl_shader_program *shProg,
GLenum programInterface, GLenum pname,
GLint *params)
{
GET_CURRENT_CONTEXT(ctx);
unsigned i;
/* Validate pname against interface. */
switch(pname) {
case GL_ACTIVE_RESOURCES:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++)
if (shProg->data->ProgramResourceList[i].Type == programInterface)
(*params)++;
break;
case GL_MAX_NAME_LENGTH:
if (programInterface == GL_ATOMIC_COUNTER_BUFFER ||
programInterface == GL_TRANSFORM_FEEDBACK_BUFFER) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
_mesa_enum_to_string(pname));
return;
}
/* Name length consists of base name, 3 additional chars '[0]' if
* resource is an array and finally 1 char for string terminator.
*/
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type != programInterface)
continue;
unsigned len =
_mesa_program_resource_name_len(&shProg->data->ProgramResourceList[i]);
*params = MAX2((unsigned)*params, len + 1);
}
break;
case GL_MAX_NUM_ACTIVE_VARIABLES:
switch (programInterface) {
case GL_UNIFORM_BLOCK:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_block *block =
(struct gl_uniform_block *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2((unsigned)*params, block->NumUniforms);
}
}
break;
case GL_SHADER_STORAGE_BLOCK:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_block *block =
(struct gl_uniform_block *)
shProg->data->ProgramResourceList[i].Data;
GLint block_params = 0;
for (unsigned j = 0; j < block->NumUniforms; j++) {
struct gl_program_resource *uni =
_mesa_program_resource_find_active_variable(
shProg,
GL_BUFFER_VARIABLE,
block,
j);
if (!uni)
continue;
block_params++;
}
*params = MAX2(*params, block_params);
}
}
break;
case GL_ATOMIC_COUNTER_BUFFER:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_active_atomic_buffer *buffer =
(struct gl_active_atomic_buffer *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2((unsigned)*params, buffer->NumUniforms);
}
}
break;
case GL_TRANSFORM_FEEDBACK_BUFFER:
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_transform_feedback_buffer *buffer =
(struct gl_transform_feedback_buffer *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2((unsigned)*params, buffer->NumVaryings);
}
}
break;
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
_mesa_enum_to_string(pname));
}
break;
case GL_MAX_NUM_COMPATIBLE_SUBROUTINES:
switch (programInterface) {
case GL_VERTEX_SUBROUTINE_UNIFORM:
case GL_FRAGMENT_SUBROUTINE_UNIFORM:
case GL_GEOMETRY_SUBROUTINE_UNIFORM:
case GL_COMPUTE_SUBROUTINE_UNIFORM:
case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM: {
for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_storage *uni =
(struct gl_uniform_storage *)
shProg->data->ProgramResourceList[i].Data;
*params = MAX2((unsigned)*params, uni->num_compatible_subroutines);
}
}
break;
}
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
_mesa_enum_to_string(pname));
}
break;
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(pname %s)",
_mesa_enum_to_string(pname));
}
}
static bool
validate_io(struct gl_program *producer, struct gl_program *consumer)
{

View File

@@ -767,13 +767,8 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
*params = _mesa_longest_attribute_name_length(shProg);
return;
case GL_ACTIVE_UNIFORMS: {
unsigned i;
const unsigned num_uniforms =
shProg->data->NumUniformStorage - shProg->data->NumHiddenUniforms;
for (*params = 0, i = 0; i < num_uniforms; i++) {
if (!shProg->data->UniformStorage[i].is_shader_storage)
(*params)++;
}
_mesa_get_program_interfaceiv(shProg, GL_UNIFORM, GL_ACTIVE_RESOURCES,
params);
return;
}
case GL_ACTIVE_UNIFORM_MAX_LENGTH: {

View File

@@ -334,6 +334,11 @@ _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
GLsizei bufSize, GLsizei *length,
GLint *params);
extern void
_mesa_get_program_interfaceiv(struct gl_shader_program *shProg,
GLenum programInterface, GLenum pname,
GLint *params);
extern void
_mesa_create_program_resource_hash(struct gl_shader_program *shProg);

View File

@@ -555,10 +555,9 @@ st_init_driver_flags(struct st_context *st)
f->NewDepthClamp = ST_NEW_RASTERIZER;
}
f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
if (st->lower_ucp)
f->NewClipPlaneEnable = ST_NEW_VS_STATE | ST_NEW_GS_STATE;
else
f->NewClipPlaneEnable = ST_NEW_RASTERIZER;
f->NewClipPlaneEnable |= ST_NEW_VS_STATE | ST_NEW_GS_STATE;
f->NewLineState = ST_NEW_RASTERIZER;
f->NewPolygonState = ST_NEW_RASTERIZER;

View File

@@ -197,7 +197,7 @@ bi_is_sched_barrier(bi_instr *I)
}
static void
bi_create_dependency_graph(struct bi_worklist st, bool inorder)
bi_create_dependency_graph(struct bi_worklist st, bool inorder, bool is_blend)
{
struct util_dynarray last_read[64], last_write[64];
@@ -262,6 +262,17 @@ bi_create_dependency_graph(struct bi_worklist st, bool inorder)
}
}
/* Blend shaders are allowed to clobber R0-R15. Treat these
* registers like extra destinations for scheduling purposes.
*/
if (ins->op == BI_OPCODE_BLEND && !is_blend) {
for (unsigned c = 0; c < 16; ++c) {
add_dependency(last_read, c, i, st.dependents, st.dep_counts);
add_dependency(last_write, c, i, st.dependents, st.dep_counts);
mark_access(last_write, c, i);
}
}
bi_foreach_src(ins, s) {
if (ins->src[s].type != BI_INDEX_REGISTER) continue;
@@ -414,7 +425,7 @@ bi_flatten_block(bi_block *block, unsigned *len)
*/
static struct bi_worklist
bi_initialize_worklist(bi_block *block, bool inorder)
bi_initialize_worklist(bi_block *block, bool inorder, bool is_blend)
{
struct bi_worklist st = { };
st.instructions = bi_flatten_block(block, &st.count);
@@ -425,7 +436,7 @@ bi_initialize_worklist(bi_block *block, bool inorder)
st.dependents = calloc(st.count, sizeof(st.dependents[0]));
st.dep_counts = calloc(st.count, sizeof(st.dep_counts[0]));
bi_create_dependency_graph(st, inorder);
bi_create_dependency_graph(st, inorder, is_blend);
st.worklist = calloc(BITSET_WORDS(st.count), sizeof(BITSET_WORD));
for (unsigned i = 0; i < st.count; ++i) {
@@ -1796,7 +1807,8 @@ bi_schedule_block(bi_context *ctx, bi_block *block)
/* Copy list to dynamic array */
struct bi_worklist st = bi_initialize_worklist(block,
bifrost_debug & BIFROST_DBG_INORDER);
bifrost_debug & BIFROST_DBG_INORDER,
ctx->inputs->is_blend);
if (!st.count) {
bi_free_worklist(st);

View File

@@ -1154,7 +1154,6 @@ spec@!opengl 1.1@linestipple,Fail
spec@!opengl 1.1@linestipple@Line loop,Fail
spec@!opengl 1.1@linestipple@Line strip,Fail
spec@!opengl 1.1@linestipple@Restarting lines within a single Begin-End block,Fail
spec@!opengl 1.1@point-line-no-cull,Fail
spec@!opengl 1.1@polygon-mode-facing,Fail
spec@!opengl 1.1@polygon-mode,Fail
spec@!opengl 1.1@polygon-mode-offset@config 0: Expected white pixel on bottom edge,Fail

View File

@@ -293,6 +293,11 @@ TODO: document the other workarounds.
<option name="force_integer_tex_nearest" value="true" />
</application>
<application name="DiRT Rally" executable="DirtRally">
<!-- https://gitlab.freedesktop.org/mesa/mesa/-/issues/5648 -->
<option name="vs_position_always_invariant" value="true" />
</application>
<!-- Workarounds for SPECviewperf relying on invalid / non-conformant
OpenGL behavior. Older SPECviewperf versions might also need this.
-->

View File

@@ -46,6 +46,7 @@ class Application(object):
self.cname = cname('application')
self.name = xml.attrib['name']
self.executable = xml.attrib.get('executable', None)
self.executable_regexp = xml.attrib.get('executable_regexp', None)
self.sha1 = xml.attrib.get('sha1', None)
self.application_name_match = xml.attrib.get('application_name_match', None)
self.application_versions = xml.attrib.get('application_versions', None)
@@ -118,6 +119,7 @@ struct driconf_option {
struct driconf_application {
const char *name;
const char *executable;
const char *executable_regexp;
const char *sha1;
const char *application_name_match;
const char *application_versions;
@@ -179,6 +181,9 @@ static const struct driconf_application ${device.cname}_applications[] = {
% if application.executable:
.executable = "${application.executable}",
% endif
% if application.executable_regexp:
.executable_regexp = "${application.executable_regexp}",
% endif
% if application.sha1:
.sha1 = "${application.sha1}",
% endif

View File

@@ -318,8 +318,12 @@ foz_prepare(struct foz_db *foz_db, char *cache_path)
free(filename);
free(idx_filename);
if (!check_files_opened_successfully(foz_db->file[file_idx], db_idx))
if (!check_files_opened_successfully(foz_db->file[file_idx], db_idx)) {
/* Prevent foz_destroy from destroying it a second time. */
foz_db->file[file_idx] = NULL;
continue; /* Ignore invalid user provided filename and continue */
}
if (!load_foz_dbs(foz_db, db_idx, file_idx, true)) {
fclose(db_idx);

View File

@@ -1093,6 +1093,8 @@ parseStaticConfig(struct OptConfData *data)
const char *appattr[] = {
"name", a->name,
"executable", a->executable,
"executable_regexp", a->executable_regexp,
"sha1", a->sha1,
"application_name_match", a->application_name_match,
"application_versions", a->application_versions,
NULL

View File

@@ -2196,8 +2196,25 @@ vn_GetPhysicalDeviceImageFormatProperties2(
if (result != VK_SUCCESS || !external_info)
return vn_result(physical_dev->instance, result);
if (external_info->handleType ==
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
VkAndroidHardwareBufferUsageANDROID *ahb_usage =
vk_find_struct(pImageFormatProperties->pNext,
ANDROID_HARDWARE_BUFFER_USAGE_ANDROID);
if (ahb_usage) {
ahb_usage->androidHardwareBufferUsage = vn_android_get_ahb_usage(
pImageFormatInfo->usage, pImageFormatInfo->flags);
}
/* AHBs with mipmap usage will ignore this property */
pImageFormatProperties->imageFormatProperties.maxMipLevels = 1;
}
VkExternalImageFormatProperties *img_props = vk_find_struct(
pImageFormatProperties->pNext, EXTERNAL_IMAGE_FORMAT_PROPERTIES);
if (!img_props)
return VK_SUCCESS;
VkExternalMemoryProperties *mem_props =
&img_props->externalMemoryProperties;
@@ -2217,17 +2234,6 @@ vn_GetPhysicalDeviceImageFormatProperties2(
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
mem_props->compatibleHandleTypes =
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
VkAndroidHardwareBufferUsageANDROID *ahb_usage =
vk_find_struct(pImageFormatProperties->pNext,
ANDROID_HARDWARE_BUFFER_USAGE_ANDROID);
if (ahb_usage) {
ahb_usage->androidHardwareBufferUsage = vn_android_get_ahb_usage(
pImageFormatInfo->usage, pImageFormatInfo->flags);
}
/* AHBs with mipmap usage will ignore this property */
pImageFormatProperties->imageFormatProperties.maxMipLevels = 1;
} else {
mem_props->compatibleHandleTypes = supported_handle_types;
mem_props->exportFromImportedHandleTypes =
@@ -2236,7 +2242,7 @@ vn_GetPhysicalDeviceImageFormatProperties2(
: 0;
}
return vn_result(physical_dev->instance, result);
return VK_SUCCESS;
}
void

View File

@@ -78,8 +78,9 @@ C_TEMPLATE = Template(textwrap.dedent(u"""\
case ${v}:
return "${enum.values[v]}";
% endfor
case ${enum.max_enum_name}: return "${enum.max_enum_name}";
default:
unreachable("Undefined enum value.");
return "Unknown ${enum.name} value.";
}
}
@@ -116,7 +117,7 @@ C_TEMPLATE = Template(textwrap.dedent(u"""\
return "${object_types[0].enum_to_name[object_type]}";
% endfor
default:
unreachable("Undefined enum value.");
return "Unknown VkObjectType value.";
}
}
"""))
@@ -246,12 +247,24 @@ class VkExtension(object):
def CamelCase_to_SHOUT_CASE(s):
return (s[:1] + re.sub(r'(?<![A-Z])([A-Z])', r'_\1', s[1:])).upper()
def compute_max_enum_name(s):
max_enum_name = CamelCase_to_SHOUT_CASE(s)
last_prefix = max_enum_name.rsplit('_', 1)[-1]
# Those special prefixes need to be always at the end
if last_prefix in ['AMD', 'EXT', 'INTEL', 'KHR', 'NV'] :
max_enum_name = "_".join(max_enum_name.split('_')[:-1])
max_enum_name = max_enum_name + "_MAX_ENUM_" + last_prefix
else:
max_enum_name = max_enum_name + "_MAX_ENUM"
return max_enum_name
class VkEnum(object):
"""Simple struct-like class representing a single Vulkan Enum."""
def __init__(self, name, bitwidth=32, values=None):
self.name = name
self.max_enum_name = compute_max_enum_name(name)
self.bitwidth = bitwidth
self.extension = None
# Maps numbers to names