Commit Graph

126868 Commits

Author SHA1 Message Date
Anuj Phogat ddb04b31fd intel: Remove unused MAKE_GEN macro
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat 81e85f9434 intel: Make line wrapping changes due to IS_GFX_VER_BETWEEN
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat efc863f9a1 intel: Rename IS_GEN* macros to IS_GFX_VER*
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "IS_GEN" -rIl $SEARCH_PATH | xargs sed -ie "s/IS_GEN/IS_GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat e7e55af4d6 intel: Rename GENx keyword to GFXx
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN[[:digit:]]+" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\([[:digit:]]\+\)/GFX\1/g"

Exclude the changes to modifiers:
grep -E "I915_.*GFX" -rIl $SEARCH_PATH | xargs sed -ie "s/\(I915_.*\)GFX/\1GEN/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat 1d296484b4 intel: Rename Genx keyword to Gfxx
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "Gen[[:digit:]]+" -rIl $SEARCH_PATH | xargs sed -ie "s/Gen\([[:digit:]]\+\)/Gfx\1/g"

Exclude changes in src/intel/perf/oa-*.xml:
find src/intel/perf -type f \( -name "*.xml" \) | xargs sed -ie "s/Gfx/Gen/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat b75f095bc7 intel: Rename genx keyword to gfxx in source files
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "gen[[:digit:]]+" -rIl $SEARCH_PATH | xargs sed -ie "s/gen\([[:digit:]]\+\)/gfx\1/g"

Exclude pack.h and xml changes in this patch:
grep -E "gfx[[:digit:]]+_pack\.h" -rIl $SEARCH_PATH | xargs sed -ie "s/gfx\([[:digit:]]\+_pack\.h\)/gen\1/g"
grep -E "gfx[[:digit:]]+\.xml" -rIl $SEARCH_PATH | xargs sed -ie "s/gfx\([[:digit:]]\+\.xml\)/gen\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat 66f6535974 intel: Rename genx keyword to gfxx in build files
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
find $SEARCH_PATH -type f \( -name "*.mk" -o -name "*.sources" -o -name "*.build" \) | xargs sed -ie "s/gen\([[:digit:]]\+\)/gfx\1/g"

Exclude --device-prefix, xml and _pack.h changes in this patch:
find $SEARCH_PATH -type f \( -name "*.mk" -o -name "*.sources" -o -name "*.build" \) | xargs sed -ie "s/gfx\([[:digit:]]\+_pack\.h\)/gen\1/g"
find $SEARCH_PATH -type f \( -name "*.mk" -o -name "*.sources" -o -name "*.build" \) | xargs sed -ie "s/gfx\([[:digit:]]\+\.xml\)/gen\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat c1f3a778de intel: Rename GENx prefix in macros to GFXx in source files
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN" -rIl src/intel/genxml | grep -E ".*py" |  xargs sed -ie "s/GEN\([%{]\)/GFX\1/g"
grep -E "[^_]GEN[[:digit:]]+" -rIl $SEARCH_PATH | grep -E ".*(\.c|\.h|\.y|\.l)" | xargs sed -ie "s/\([^_]\)GEN\([[:digit:]]\+\)/\1GFX\2/g"

Leave out renaming GFX12_CCS_E macros. They fall under renaming pattern like "_GEN[[:digit:]]+":
grep -E "GFX12_CCS_E" -rIl $SEARCH_PATH | xargs sed -ie "s/GFX12_CCS_E/GEN12_CCS_E/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat 0cfe7e3968 intel: Rename GENx prefix in macros to GFXx in build files
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN[[:digit:]]+[[:alpha:]_]*_FILES" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\([[:digit:]]\+[[:alpha:]_]*_FILES\)/GFX\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat dc28390e3c intel: Rename genx keyword in filenames to gfxx
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
find $SEARCH_PATH -type f -name "*gen[[:digit:]]*.*[cph]" -exec sh -c 'f="{}"; mv -- "$f" "${f/gen/gfx}"' \;
grep -E "gen[[:digit:]]+_[[:alnum:]_]*\.(c|h|cpp)" -rIl $SEARCH_PATH | xargs sed -ie "s/gen\([[:digit:]]\+_[[:alnum:]_]*\.\)\(c\|h\|cpp\)/gfx\1\2/g"
grep -E "_gen[[:digit:]]+[[:alnum:]_]*\.(c|h|cpp)" -rIl $SEARCH_PATH | xargs sed -ie "s/\(_\)gen\([[:digit:]]\+[[:alnum:]_]*\.\)\(c\|h\|cpp\)/\1gfx\2\3/g"
grep -E "GEN[[:digit:]]+[[:alnum:]_]*_H( |$)" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN\([[:digit:]]\+[[:alnum:]_]*_H\)\( \|$\)/GFX\1\2/g"

Exclude the "_pack.h" changes:
grep -E "gfx[[:digit:]]+_pack\.h" -rIl $SEARCH_PATH | xargs sed -ie "s/gfx\([[:digit:]]\+_pack\.h\)/gen\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat abe9a71a09 intel: Rename gen field in gen_device_info struct to ver
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "info\)*(.|->)gen" -rIl $SEARCH_PATH | xargs sed -ie "s/info\()*\)\(\.\|->\)gen/info\1\2ver/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat 99331f6deb intel: Rename genx10 field in gen_device_info struct to verx10
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "info\)*(.|->)genx10" -rIl $SEARCH_PATH | xargs sed -ie "s/info\()*\)\(\.\|->\)genx10/info\1\2verx10/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat cc422fa498 intel: Rename ISL_DEV_GEN to ISL_GFX_VER
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "ISL_DEV_GEN" -rIl $SEARCH_PATH | xargs sed -ie "s/ISL_DEV_GEN/ISL_GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:07 +00:00
Anuj Phogat 9da8a55b08 intel: Rename GEN_GEN macro to GFX_VER
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN_GEN" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_GEN/GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:06 +00:00
Anuj Phogat 295bb3c263 intel: Rename GEN_VERSIONx10 macro to GFX_VERx10
Commands used to do the changes:
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "GEN_VERSION" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_VERSION/GFX_VER/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9936>
2021-04-02 18:33:06 +00:00
Ilia Mirkin b9b4324ca3 mesa: fix restoring of texture attributes for msaa binding points
This fixes rendering in Unigine Tropics with MSAA enabled. Since the
binding for MSAA does not get restored, we can't rely on the "defaults
get restored below" logic in that case.

Fixes: 81e6f6ef0c (mesa: don't push/pop default texture attributes redundantly)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4558
Reported-by: Andrew Randrianasulu <randrianasulu@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10001>
2021-04-02 17:49:59 +00:00
Jesse Natalie f447c69653 spirv_to_dxil: Handle clip/cull distance
Clip/cull only needs a little bit of lowering before nir_to_dxil can
handle it. Specifically, we just need to split apart arrays that
straddle the 4-component boundary of location, so that the signature
builder can handle it.

To do that cleanly, we need to add some lowering and optimization passes:
* nir_lower_clip_cull_distance_arrays: Merge clip/cull into a single array,
  which is similar to DXIL's requirements here.
* nir_lower_io_to_temporaries: Ensure that we only have one non-indirect write
  to the clip/cull output.
* nir_split_var_copies and nir_lower_var_copies: Ensure that each array entry
  has an independent write with a constant index
* Optimization loop: Make sure that there's no extra derefs in the way between
  deref_var for the output, deref_array for the component, and store_deref.
Then we can actually lower the clip/cull array cleanly.

Still to do is to sort the variables and add driver_location.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie 39aa32b838 microsoft/spirv_to_dxil: Implement TODO for removing dead functions
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie bd64669fa7 d3d12: Use compact arrays for clip/cull distance
This puts us more in line with other drivers, and matches what
SPIR-V would produce rather than the GLSL compiler. It also means
we can delete the current fixup pass, since previously clip distance
was always float4s but some components could go unused. Now, clip
distance is an array that's appropriately sized for what's actually
written.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie baeb363df0 microsoft/compiler: Support compact arrays for clip/cull in nir_to_dxil
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie 4941decc58 microsoft/compiler: Enable dxil_nir.h to be included from C++
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie 65e1bee99c microsoft/compiler: Add a lowering pass to split clip/cull distance compact arrays
As the pass's comment explains, NIR compact arrays are a better match
to represent the GLSL float[] design of clip/cull distance arrays, compared
to the float4[2] approach. This pass adjusts the variables to more closely
match what DXIL signatures would look like for that representation.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie 96cd961853 microsoft/compiler: Add copy_prop_vars to optimization loop
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Jesse Natalie 3f1b90d638 microsoft/compiler: Move blob_init earlier to prevent crash on failure
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Acked-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Michael Tang cb5120bcf7 microsoft/spirv_to_dxil: Add extra lowering functions according to the docs on nir_inline_functions
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Michael Tang 2f3dc0264c microsoft/spirv_to_dxil: Add lowering pass to handle gl_PerVertex
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
2021-04-02 17:16:48 +00:00
Mike Blumenkrantz 9d8dd8d27b zink: add some asserts to avoid zero-sized blit regions
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9999>
2021-04-02 14:14:57 +00:00
Mike Blumenkrantz 44076a3d6c zink: fix layercount for array texture blits
3d is base, base+count, array is base, count

Fixes: 83bee837e5 ("zink: be more explicit about blit layer/depth usage")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9999>
2021-04-02 14:14:57 +00:00
Marek Olšák 5e4d31f646 ac/surface/tests: move shareable code into ac_surface_test_common.h
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák b3e6514984 radeonsi: don't use CP DMA for clears/copies except for very small ones
The current compute shaders are much faster.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 64cbab5348 radeonsi: turn the loops over color buffers into while loops in si_clear
NULL color buffers are not set in "buffers" here.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 5ba77c4a5d radeonsi: unset PIPE_CLEAR_* flags for non-existent buffers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 0580d4c1a2 radeonsi: enable HTILE with mipmapping on gfx9+
Everything seems to be there except fast clears.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 4e35eb1d69 radeonsi: set better default depth clear value
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 3345e32de7 radeonsi: group and parallelize all clears in si_texture_create_object
This reduces aux_context flushes significantly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák cb6e1c7c11 radeonsi: add num_layers variable into si_do_fast_color_clear
in preparation for the next commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 1936a046b1 radeonsi: return success/failure from si_alloc_separate_cmask
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 8cd61d1248 radeonsi: parallelize CMASK and DCC clears
Clearing 8 RTs with both DCC and CMASK caused 16 synchronized clears where
we also did 16 times WAIT_REG_MEM for CB flushes that were 15 times
useless.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák d0f06e5c47 radeonsi: remove si_screen::dcc_msaa_allowed
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 4707dc6a64 radeonsi: determine accurately whether the framebuffer state has DCC MSAA
We only need to check storage samples, which is what affects DCC.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 933df67296 ac/surface: add CMASK info for level 0
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák b3e7c77f13 amd: fix parsing the last dword of DMA_DATA packets
It was parsing it as SQ_WAVE_GPR_ALLOC instead of COMMAND.
Change the offset to an odd number to work around it.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 95940459be radeonsi: pack the variable block size in one SGPR, 10 bits per component
The side effect of this is that the compute copy image shader now has
enough free user SGPRs that it passes the src image via user SGPRs,
resulting in lower wave lifetime.

Previous copy shader:
    s_load_dwordx8
    image_load
    s_load_dwordx8
    s_waitcnt
    image_store

Current copy shader:
    image_load
    s_load_dwordx8
    s_waitcnt
    image_store

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 034c1e4845 radeonsi: decrease the maximum variable block size
to allow packing the block size in 1 user SGPR with 10 bits per component,
so that block sizes such as 512x1x1 fit in there.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák ad71ef9326 radeonsi: don't use a constant buffer for the copy_image compute shader
just use user SGPRs and 16-bit values for the x,y,z coordinates.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 5701baa34b radeonsi: don't use constbuf and set cache policy for 12-byte clear shader
This removes the constant buffer and sets the cache policy like other
compute shaders.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 7d14eb623b radeonsi: return false from si_is_format_supported instead of NULL
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák c53261645d radeonsi: add SI_CONTEXT_PFP_SYNC_ME to skip syncing PFP for image operations
DCC/CMASK/HTILE clears will not set this. We could do a better job
at not setting this in other cases too

Image copies also don't set this.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 4fb1b7b2d8 radeonsi: use the optimal packet order before draw packets for VS flushes too
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák b1a73ec99b radeonsi: rename and apply SI_OP_CPDMA_SKIP_CACHE_FLUSH to compute as well
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 419e05d5f6 radeonsi: don't do an L2 flush in compute_do_clear_or_copy if we're not syncing
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák aed881e34e radeonsi: reduce syncing in si_compute_expand_fmask when it's already idle
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 5c827bde29 radeonsi: reduce syncing for initializing new buffers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 207bafd4dd radeonsi: reduce syncing in si_dcc_decompress
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 7e2b5ce722 radeonsi: set compute/cpdma sync flags in the outermost caller
This allows us to control syncing everywhere.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák a4ad08b455 radeonsi: inline clear_buffer in si_screen_clear_buffer
We'll add a new parameter there.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 1af99a28a0 radeonsi: merge CP DMA flags with internal compute flags
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák dd5e9af78f radeonsi: remove unused SI_CP_DMA_SKIP_* definitions
The existing uses had no effect.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 938dc0e291 radeonsi: rename internal compute sync flags
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 69ff9c16bb radeonsi: never set DISABLE_WR_CONFIRM for CP DMA clears and copies
Only prefetches set it. Unsynchronized clears and copies shouldn't set it
because syncing later wouldn't wait for the writes.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 28d065d3e5 radeonsi: don't insert start/stop pipeline stat events if it has no effect
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák cb59cae04c radeonsi: set the clear/copy cache policy based on L2 cache size
This matches the intent.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák 8ea685dfc0 radeonsi: disable sparse buffers on gfx7-8
Cc: 20.3 21.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Marek Olšák ac78b12e23 ac/llvm: don't set unsupported xnack options to fix LLVM crashes on gfx6-8
LLVM prints an error if xnack is unsupported and it uses a global stream
object that is not thread-safe. Since Mesa uses multiple threads to compile
shaders, there is a small chance that it will crash.

Just don't set any xnack options to use LLVM defaults.

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

Cc: 20.3 21.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9795>
2021-04-02 12:05:00 +00:00
Samuel Pitoiset 57916fbdcd radv: use COLOR_ATTACHMENT_OPTIMAL for fast clear/hw resolve operations
This should be equivalent without needed to force enable FMASK for
some specific internal pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9940>
2021-04-02 08:36:19 +02:00
Samuel Pitoiset fc2186d302 radv: do not force enable FMASK during MSAA blits
This is no longer needed since FMASK is also compressed for
transfer dst operations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9940>
2021-04-02 08:36:16 +02:00
Samuel Pitoiset 6dbf975cb9 radv: cleanup FMASK expand transitions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9990>
2021-04-02 06:34:45 +00:00
Samuel Pitoiset 87c8764448 radv: compress FMASK for all layouts except GENERAL
The COMPRESSION bit is FMASK and this is much faster! Should
speedup transfer dst operations with MSAA images considerably.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9990>
2021-04-02 06:34:45 +00:00
Eric Anholt adf04d1af4 ci/freedreno: Switch to the trimmed glxgears trace.
The old one had a ton of frames and took ~5 minutes on a306.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9957>
2021-04-01 21:04:11 +00:00
Eric Anholt fe5349f70c freedreno/a6xx: Fix alpha tests.
Apparently I inverted the sense of this flag back when we didn't have
piglit testing.  Fixes terrible rendering in minetest, HL2, CS:Source, and
CS.

Fixes: 0369dd9077 ("freedreno/a6xx: Add ARB_depth_clamp and separate clamp support.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9957>
2021-04-01 21:04:11 +00:00
Eric Anholt 3043940183 freedreno/a5xx: Fix alpha test vs early Z bugs.
Just like with discards, we have to disable early Z writes when alpha test
is enabled.

Fixes rendering on HL2, CS: Source, counter-strike, and minetest.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9957>
2021-04-01 21:04:11 +00:00
Eric Anholt c9fd8c2570 ci/freedreno: Add trace testing on a3xx, a5xx.
Having compared rendering between a6xx and these, I found several bugs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9957>
2021-04-01 21:04:11 +00:00
Eric Anholt 8e3a1d0dd2 ci/freedreno: Rename a306-test and a530-test to drop "arm64" from the name.
We don't have an armhf variant, and probably won't.  Now matches a630.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9957>
2021-04-01 21:04:11 +00:00
Eric Anholt ec54546b2a ci/freedreno: Add more new traces for a630 (minetest, TDM, pioneer, glyphy).
These are all recent traces that have been added.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9957>
2021-04-01 21:04:11 +00:00
Mike Blumenkrantz 3d55998504 zink: emit ImageCubeArray cap when accessing arrayed cube dimension images
required by spec

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9987>
2021-04-01 20:05:06 +00:00
Mike Blumenkrantz ccbaf31f3c zink: use max_rt to determine number of blend state attachments
this is more consistent with how gallium applies the states

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9988>
2021-04-01 19:55:00 +00:00
Pierre-Eric Pelloux-Prayer d0fefddf4a vbo/dlist: use DrawGallium(Complex)
We can build the needed structs during list compilation and then
use DrawGallium (if one draw or a single primitive mode is used) or DrawGalliumComplex
otherwise.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
2021-04-01 19:16:39 +00:00
Pierre-Eric Pelloux-Prayer 43e243762f mesa: make _mesa_HashTable InDeleteAll debug only
It's only used in asserts so we can wrap it inside

This makes the struct 32 bytes instead of 40 in release
builds.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
2021-04-01 19:16:39 +00:00
Pierre-Eric Pelloux-Prayer e26f261c7e mesa/hash: switch to simple_mtx
simple_mtx are faster and smaller (4 bytes instead of 8) so switch to using them.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
2021-04-01 19:16:39 +00:00
Pierre-Eric Pelloux-Prayer 0a78c22666 mesa/hash: make the mtx non-recursive
Now that no one is recursively locking it we can switch to
a plain mutex.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
2021-04-01 19:16:39 +00:00
Pierre-Eric Pelloux-Prayer 46c4ae5ff1 mesa: remove 2 recursive lock usages of _mesa_HashTable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
2021-04-01 19:16:39 +00:00
Pierre-Eric Pelloux-Prayer bb108bdec7 dlist: remove ListExt feature
This is only used by vbo_save_api so let's simplify the code and add a normal
opcode for this one.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9533>
2021-04-01 19:16:39 +00:00
Dave Airlie 89b6d70c1c zink/ci: update results after lavapipe clear fixes
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9971>
2021-04-01 19:05:29 +00:00
Dave Airlie fe53c22294 lavapipe: fix only clearing depth or stencil paths.
This fixes the ds clears path to clear only depth or stencil

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: b38879f8c5 ("vallium: initial import of the vulkan frontend")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9971>
2021-04-01 19:05:29 +00:00
Ian Romanick 7878497c94 mesa: Clean up _mesa_layout_parameters after previous commit
After the previous change, PASS 1 can be trivially pulled out of the
loop.

With PASS 1 removed, the loop can be unrolled, and a lot of code can be
deleted (from the unrolls).  This saves a couple lines of code, and it
makes the function a little easier to follow.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9867>
2021-04-01 18:42:36 +00:00
Ian Romanick 9413c6aec3 mesa: Add anything dynamically indexed before any non-dynamically indexed
Things that are not dynamically indexed must be added last.  This is
necessary so that values that are both statically indexed (or used
directly) and dynamically indexed will only be added once.  With the
above change, if the constant 47 is used as a literal in an instruction
and in an array that is dynamically indexed, it will be added to
`Parameters` twice.  On (really old) GPUs that store constants and other
parameters in the same storage, this can cause some valid programs to
exceed the storage limits.  I don't know about R300 or NV30, but R200
was limited to something like 256 vec4s.  This applies to constants,
state parameters, and local parameters (the assembly shader version of
uniforms).

The problem this causes here is that the final parameter layout created
in `_mesa_layout_parameters` may have more parameters than the input
layout.  The fundamental assumption of that routine (and documented as
an assumption of `copy_indirect_accessed_array`) is that the input size
and the output size will be the same.

The affected shader had something like below.  This is a common pattern
for ARB assembly shaders generated by NVIDIA's cgc compiler.  As far as
I can tell, the majory of applications that use ARB assembly shaders
either use cgc or use some sort of DX9 crosscompiler... that generates
similar patterns.

    PARAM c[141] = { program.local[0..133],
                   { 255, 0.1, 3, 1 },
                   { 0.5, 2, 0.15915491, 0.25 },
                   { 0, 0.5, 1, -1 },
                   { 24.980801, -24.980801, -60.145809, 60.145809 },
                   { 85.453789, -85.453789, -64.939346, 64.939346 },
                   { 19.73921, -19.73921, -9, 0.75 },
                   { -999999 } };

The shader contains instructions like

    MUL R0.x, R0, c[135].y;

and

    DP4 R2.z, c[A0.x + 6], R1;

Starting with b9bff76b63, the constants at the end of `c` would get
added to `Parameters` twice.  The first time they are added due to
instructions that directly access the array (e.g., the `c[135].y`
above).  The second time is because they are part of an array that is
dynamically indexed.  As a result, the final layout of Parameters
(calculated by `_mesa_layout_parameters`) is 7 elements larger than the
input layout.

Since bcc61a01d4 fixed the allocation size of `ParameterValues`,
`copy_indirect_accessed_array` will now write past the end of the array.
The eventually results in a crash in `free`.  Thankfully Valgrind was
able to help find the real source of the problem.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: b9bff76b63 ("mesa: put constants before state vars for ARB programs")
Closes: #4505
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9867>
2021-04-01 18:42:36 +00:00
Adam Jackson 04b28b9375 mesa/st: Check for successful framebuffer allocation in st_api_make_current
Ran into this while trying to rework fbconfig setup, due to a bug I
ended up trying to allocate a PIPE_FORMAT_NONE framebuffer, which failed
like you'd hope, but which we weren't converting into an error in
st_api_make_current. Instead we'd treat it like binding no drawable to
the context, which is really not what was asked for, so let's go ahead
and make this an error.

Reviewed-by: Eric Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9956>
2021-04-01 18:14:33 +00:00
Adam Jackson 95be3c9b6d mesa/st: Remove unused ST_ATTACHMENT_SAMPLE
Not sure what this was supposed to do, but whatever it did, it doesn't.

Reviewed-by: Eric Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9956>
2021-04-01 18:14:33 +00:00
Danylo Piliaiev ce1a381e57 turnip: enable VK_KHR_16bit_storage on A650
A650 can use the same SSBO descriptor for both 32-bit and 16-bit access,
which makes it easy to enable this extension.

Passes tests that run under:

dEQP-VK.spirv_assembly.instruction.*.16bit_storage.*

Rebased and modified commit from Jonathan Marek.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
2021-04-01 17:51:07 +00:00
Jonathan Marek 14acc64c3b turnip: enable VK_KHR_shader_float16_int8
ir3 supports 16-bit floats, so we can enable this.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
2021-04-01 17:51:07 +00:00
Danylo Piliaiev 64aaa4afc3 turnip: enable infinities for f16 math and document the register
When float16 is enabled this will allow to pass a number of
float16 tests.

When A6XX_SP_FLOAT_CNTL_F16_NO_INF is set - all operations which
generate +-infinity generate +-MAX_HALF_FLOAT.

Fixes some tests from:
 dEQP-VK.spirv_assembly.instruction.*.float16.*
 dEQP-VK.spirv_assembly.instruction.*.float_controls.fp16.*

E.g.:
 dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic_1.sinh_vert
 dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic_4.length
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.log_denorm_flush_to_zero_nostorage
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.log2_denorm_flush_to_zero_nostorage
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.inv_sqrt_denorm_flush_to_zero_nostorage

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
2021-04-01 17:51:07 +00:00
Danylo Piliaiev 14460faa64 ir3: convert shift amount to 16b for 16b shifts
NIR has shifts defined as:
 opcode("*shr", 0, tuint, [0, 0], [tuint, tuint32], False, ...

However, in ir3 we have to ensure that both operators of shift
instruction have the same bitness.

Let's hope that in future the additional COV for constants would
be optimized away.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
2021-04-01 17:51:07 +00:00
Jonathan Marek 3777ecdf11 turnip: implement VK_KHR_shader_float_controls
This matches the blob and doesn't require actually implementing controls
since the supported modes are just what the HW does.

Passes tests under:

dEQP-VK.spirv_assembly.*.float_controls.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
2021-04-01 17:51:07 +00:00
Danylo Piliaiev de195671bd ir3: nir_op_f2f16 should round to even
cat1 instructions round to zero by default.

When fp16 is enabled this will fix:
 dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp32_nostorage_frag
 dEQP-VK.spirv_assembly.instruction.graphics.float_controls.fp16.input_args.rounding_rte_conv_from_fp32_nostorage_vert
 dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp16.input_args.rounding_rte_conv_from_fp32_nostorage

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9840>
2021-04-01 17:51:07 +00:00
Keith Packard 8c7940cc0f wsi/x11: Fix type of target_msc argument to x11_present_to_x11_dri3
Broken out of VK_GOOGLE_display_timing patch

Cc: stable
Co-author: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9939>
2021-04-01 17:39:47 +00:00
Andrii Simiklit 302dce9929 gitlab-ci: remove fixed tests
These tests are fixed by MR2333

Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>
2021-04-01 17:16:33 +00:00
Andrii Simiklit 7661320815 glsl/linker: Fix xfb stride alignment for buffers containing 64bit types
Per OpenGL 4.6 spec:
"If no xfb_stride qualifier is specified for a
 binding point, the stride is derived by identifying the variable associated with the
 binding point having the largest offset, and then adding the offset and the size of
 the variable, in basic machine units. If any variable associated with the binding
 point contains double-precision floating-point components, the derived stride is
 aligned to the next multiple of eight basic machine units. If a binding point has no
 xfb_stride qualifier and no associated output variables, its stride is zero."

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>
2021-04-01 17:16:33 +00:00
Danylo Piliaiev 67e33db4a6 glsl/linker: Fix xfb with explicit locations and 64bit types
1) Per GL_ARB_enhanced_layouts if explicit location is set for varying,
each struct member, array element and matrix row will take
separate location. With GL_ARB_gpu_shader_fp64/GL_ARB_gpu_shader_int64
they may take two locations.

Examples:

| layout(location=0) dvec3[2] a; | layout(location=4) vec2[4] b; |
|                                |                               |
|   32b 32b 32b 32b              |   32b 32b 32b 32b             |
| 0  X   X   Y   Y               | 4  X   Y   0   0              |
| 1  Z   Z   0   0               | 5  X   Y   0   0              |
| 2  X   X   Y   Y               | 6  X   Y   0   0              |
| 3  Z   Z   0   0               | 7  X   Y   0   0              |

Previously it wasn't taken into account.

2) Captured double-precision variables should be aligned to
8 bytes per GL_ARB_gpu_shader_fp64:
 "If any variable captured in transform feedback has double-precision
 components, the practical requirements for defined behavior are:
     ...
 (c) each double-precision variable captured must be aligned to a
     multiple of eight bytes relative to the beginning of a vertex."

v2: fix `output_size` calculations
         ( Andrii Simiklit <andrii.simiklit@globallogic.com> )

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1667
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>
2021-04-01 17:16:33 +00:00
Danylo Piliaiev c432cb672a glsl/linker: Fix attempts to split up 64bit varyings between slots
When packing varyings when there is only 32bit of space
left in slot 64bit type is attempted to be divided between
current and next slot. However there is neither code for
splitting the 64bit type nor for assembling it back.
Instead we add 32bit padding.

The above happens only in structs because their
members aren't sorted by packing order.

Example of the issue:

struct S {
 vec3 a;
 double d;
};
out flat S s;

Before, the packing went as:

slot 32b  32b  32b  32b
 0   a.x  a.y  a.z   d
 1    d    0    0    0

After:

slot 32b  32b  32b  32b
 0   a.x  a.y  a.z   0
 1    d    d    0    0

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2333>
2021-04-01 17:16:33 +00:00
Michel Dänzer 6652c5018c ci: Merge ARM testing docker images to a single arm_test one
The merged image contains kernels & rootfs for both arm64 & armhf
baremetal test jobs, and is smaller than either arm{64,hf}_test image
before.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9955>
2021-04-01 16:35:26 +00:00