Commit graph

160249 commits

Author SHA1 Message Date
Erik Faye-Lund
14b15b4038 zink: assert on unnormalized texcoords
We do not support PIPE_CAP_TEXRECT, so let's assert in case something
tries to use it behind our back.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17708>
2022-09-22 11:37:10 +00:00
Erik Faye-Lund
37733c100d mesa/st: always use normalized coords for samplers
Normalized samplers is the norm, and non-normalized samplers might cause
some drivers and hardware to have to bend over backwards a bit.

We're using TXF here anyway, so it doesn't really matter what we set
this state to. So let's always use normalized samplers instead of
always using non-normalized samplers. That makes things easier for
everyone.

Fixes: e7b9561959 ("gallium: implement compute pbo download")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17708>
2022-09-22 11:37:10 +00:00
Erik Faye-Lund
1a135bdd6c mesa/st: always use normalized coords for samplers
Normalized samplers is the norm, and non-normalized samplers might cause
some drivers and hardware to have to bend over backwards a bit.

We're using TXF here anyway, so it doesn't really matter what we set
this state to. So let's always use normalized samplers instead of
always using non-normalized samplers. That makes things easier for
everyone.

Fixes: 41e093fc98 ("st/pbo: add a fast pbo download code-path")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17708>
2022-09-22 11:37:10 +00:00
Erik Faye-Lund
484205b7eb mesa/st: always use normalized coords for samplers
Normalized samplers is the norm, and non-normalized samplers might cause
some drivers and hardware to have to bend over backwards a bit.

We're using TXF here anyway, so it doesn't really matter what we set
this state to. So let's always use normalized samplers instead of
always using non-normalized samplers. That makes things easier for
everyone.

Fixes: ed0e9862c5 ("st/mesa: implement PBO downloads for ReadPixels")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17708>
2022-09-22 11:37:10 +00:00
Iago Toral Quiroga
7eeb0fec8d broadcom/compiler: increase V3D_MAX_BUFFE_RANGE to 2^30 bytes
This is the minimum required by KHR_maintenance4 and there is no
reason we can't support this.

The only restriction we have is that the texture state base
address (which comes into play with texel buffers) must be aligned
to 4-bits, but this doesn't restrict the size of the buffer, only
its base address, and we already have requirements for buffer
alignment that ensure this.

Fixes: dEQP-VK.api.info.vulkan1p3_limits_validation.khr_maintenance4
Fixes: 2c388c1d ('v3dv: set maxBufferSize property')
Acked-by: Eric Engestrom <eric@igalia.com>
Tested-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18748>
2022-09-22 11:07:26 +00:00
Jason Ekstrand
3417a0c4a2 iris: Support up to 128 textures
This is required for OpenCL.  I kind-of hate this patch.  I really don't
like GROUP_TEXTURE_LOW64 and GROUP_TEXTURE_HIGH64 but it was either that
or I had to make all the used bitsets 128 which would have mean making
them BITSET and that would have been a lot more churn.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16442>
2022-09-22 09:50:23 +00:00
Jason Ekstrand
06a0de492a iris: Support up to 64 images
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16442>
2022-09-22 09:50:23 +00:00
Jason Ekstrand
c4ff82d958 iris: Split max #defines for textures/samplers/images
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16442>
2022-09-22 09:50:23 +00:00
Jason Ekstrand
c9c8134d76 iris: Stop looking at textures_used for samplers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16442>
2022-09-22 09:50:23 +00:00
Laurent Bigonville
0edf63de76 Try to fix FTBFS on kfreebsd architecture
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4081

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15058>
2022-09-22 10:30:36 +02:00
Iván Briano
14810f3498 intel/utrace: create the callback events for xfb trace points
Fixes: 79c2f9e7cb ("anv: trace xfb queries")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7322

Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18738>
2022-09-22 06:59:06 +00:00
Iván Briano
ad89992ee1 anv: Set meshShaderQueries for mesh shader ext features
v2 (Jordan): More descriptive commit message and fixes tag

Fixes: 9701b9098f ("anv: enable EXT_mesh_shader")

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18735>
2022-09-22 06:26:30 +00:00
Vinson Lee
5553846240 d3d12: Initialize d3d12_video_encoder_references_manager_hevc::m_current_frame_idx.
Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_current_frame_idx is not
initialized in this constructor nor in any functions that it calls.

Fixes: da11684e9d ("d3d12: Add HEVC Decode/Encode")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18654>
2022-09-22 05:45:21 +00:00
Yonggang Luo
c74595ead3 radv/r600/clover: Getting libelf to be optional
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18503>
2022-09-22 05:07:35 +00:00
Yonggang Luo
3f18709f1f util: Remove the macro DEBUG_GET_ONCE_FILE_OPTION
DEBUG_GET_ONCE_FILE_OPTION is not a truly once function, it's return a new
FILE* object when calling to it when the conditions are satisfied. And it's
functional can be replaced with DEBUG_GET_ONCE_OPTION properly.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18323>
2022-09-22 04:16:29 +00:00
Yonggang Luo
5229a147c1 util: getting get_tracefile in u_trace.c to be thread safe
Remove the usage of DEBUG_GET_ONCE_FILE_OPTION because it's not a truly
once function, it's return a new FILE* object when calling to it when
the conditions are satisfied.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7151

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18323>
2022-09-22 04:16:29 +00:00
Yonggang Luo
7dfd54cf4a util: Add util_call_once for optimize call to util_call_once_with_context out for hot path
For hot path, there is only need to a load instruction to load if initialized are true now,
So the extra cost is minimal.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18323>
2022-09-22 04:16:29 +00:00
Mike Blumenkrantz
3a6984bbc0 zink: add stencil border color clamping
fixes (tu):
dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_uint_stencil
dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_float_depth_uint_stencil_sample_stencil
dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_unorm_depth_uint_stencil_sample_stencil

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18598>
2022-09-22 03:53:11 +00:00
Mike Blumenkrantz
95d4faea49 zink: add srgb border color clamping
fixes (tu):
dEQP-GLES31.functional.texture.border_clamp.range_clamp.linear_srgb_color
dEQP-GLES31.functional.texture.border_clamp.range_clamp.nearest_srgb_color

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18598>
2022-09-22 03:53:11 +00:00
Mike Blumenkrantz
61d60bb746 zink: add border color clamping when customBorderColorWithoutFormat isn't supported
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18598>
2022-09-22 03:53:11 +00:00
Mike Blumenkrantz
0f98f4882c zink: move color channel clamping to zink_format.c
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18598>
2022-09-22 03:53:11 +00:00
Mike Blumenkrantz
ec0611e9e4 zink: clamp z/s formats to aspected format for border colors
a z/s sampler with int border color is stencil and vice versa

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18598>
2022-09-22 03:53:11 +00:00
Jason Ekstrand
ea185aef03 iris: Handle resource offsets in buffer copies
Fixes: c5b22441f1 ("iris: Fix buffer -> buffer copy_region")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15811>
2022-09-22 03:33:00 +00:00
Jason Ekstrand
f4c05f319e iris: Fix more BO alignments
Fixes: 32c5d6d1dc ("iris: Add an alignment parameter to iris_bo_alloc()")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15811>
2022-09-22 03:33:00 +00:00
Jason Ekstrand
2984134395 iris: Use a larger alignment for buffer allocations
This is likely required for OpenGL buffer texture allocations.  It'll
also make buffer copies faster if things are generally nicely aligned.
It's definitely required for OpenCL.

Fixes: 32c5d6d1dc ("iris: Add an alignment parameter to iris_bo_alloc()")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15811>
2022-09-22 03:33:00 +00:00
Alyssa Rosenzweig
c17fcbaa2f agx: Account for mask when writing registers
To use fewer registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
5cd2371318 agx: Pass mask into ld/st_tile instructions
Properly handle render target formats with <4 components.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
640fd089a2 agx: Ensure that the optimizer sees legitimate SSA
Expecting it to keep around unused definitions around is wishful. Add an
"anchoring" unit_test instruction to consume the results so they don't
have to be precoloured registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
52467c2d1e agx: Test fsat+f2f16 together
Something I hit when mucking with this pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
3e86522cf2 agx: Validate immediates
In particular the new sizing rules.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
14f2be1f33 agx: Use 16-bit immediates
This is slightly more accurate in the IR, and means we instruction
select the current 16-bit size floating point instructions when all
non-immediate operands are 16-bit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
e302e5d527 agx: Emit fewer combines for intrinsics
A bunch of the emitted combines were unnecessary, or unnecessarily
large. Fix the accounting now that combines are variable size.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
Alyssa Rosenzweig
e887a11b06 agx: Fix bfi_mask packing
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
2022-09-22 03:23:36 +00:00
José Roberto de Souza
89d2cdad37 intel/dev: Adjust prefetch_size values for MTL engines
MTL has different CS prefetch sizes for each CS type.
So here replacing the cs_prefetch_size in intel_device_info struct
by a function that takes as argument the i915 engine class.

Fixes:
- func.cmd-buffer.small-secondaries.q0
- dEQP-VK.multiview.secondary_cmd_buffer.*
- Several other VK CTS tests that uses secondary_cmd_buffer

v2:
- renamed to intel_device_info_get_engine_prefetch() (Jordan)

v3:
- renamed to intel_device_info_calc_engine_prefetch()
- store each engine class prefetch in intel_device_info

BSpec: 45718
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18597>
2022-09-22 02:14:47 +00:00
Simon Zeni
029522f67d mesa/st: check egl image and texture target match before binding
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>
2022-09-22 01:44:32 +00:00
Simon Zeni
6a3f5c6512 mesa: simplify st_egl_image binding process for texture storage
The dmabuf imported edge case is now properly handled.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>
2022-09-22 01:44:32 +00:00
Simon Zeni
25f569f58a gallium: track if st_egl_image was created by a dmabuf
This is required by GL_EXT_EGL_image_storage to verify if the image is valid

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>
2022-09-22 01:44:32 +00:00
Simon Zeni
70e2a1faad mesa: fix EXT_EGL_image_storage target validation
EXT_EGL_image_storage requires OpenGL 4.2, OpenGL ES 3.0, or
ARB_texture_storage, and EXT_direct_state_access or equivalent for
`EGLImageTargetTextureStorageEXT`.

`target` can be one of GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_3D,
GL_TEXTURE_CUBE_MAP, GL_TEXTURE_CUBE_MAP_ARRAY. On non-ES GL it can also be
GL_TEXTURE_1D or GL_TEXTURE_1D_ARRAY. If OES_EGL_image_external is supported,
it can also be GL_TEXTURE_EXTERNAL_OES.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>
2022-09-22 01:44:32 +00:00
Mike Blumenkrantz
5b1137043c zink: don't always set VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT with gpl
this is illegal

Fixes: 86e4fcd9a9 ("zink: add a graphics pipeline library implementation")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18729>
2022-09-22 01:12:01 +00:00
Mike Blumenkrantz
5c6d61635d zink: don't call CmdBindVertexBuffers2EXT with no attributes
cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18729>
2022-09-22 01:12:01 +00:00
Sil Vilerino
a70bac6252 d3d12: Make get_feedback return correctly on error when writing *size=0
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
ef8bd5ca9e d3d12: Extract into common variable for metadata slot calculation
Removes duplicated code using X modulo D3D12_VIDEO_ENC_METADATA_BUFFERS_COUNT

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
4e3d93212a d3d12: Enhance get_feedback not enough buffers message
Indicate to increase if the env var D3D12_VIDEO_ENC_METADATA_BUFFERS_COUNT
if not enough buffers in the get_feedback function

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
e8474bca5a d3d12: Fix redundant/inconsistent initializations for d3d12_video_encoder
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
5b5b5a7ed8 d3d12: Add output buffer to inflight resourceset
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
ec16c95e75 d3d12: Make d3d12 encode operations async and do not block waiting
Separate d3d12_video_encode flush on end_frame (ie. vaEndPicture) from fence sync in get_feedback (ie. vaSyncSurface/Buffer)

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
5269d660af d3d12: Have d3d12_video_encoder keep separate references for enc, heap and dpb allocations for in flight resources
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
24433f3a29 d3d12: d3d12_video_encoder add reset() to prevent leaks on re-allocation
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
8e50d5cc0d d3d12: Encoder to use independent command allocators per in flight resource set
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00
Sil Vilerino
f9b850cd55 d3d12: Move encode configuration and capabilities into separate structs
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18715>
2022-09-21 23:31:15 +00:00