Commit Graph

189 Commits

Author SHA1 Message Date
Erik Faye-Lund dd0f941097 zink: verify geometry shader feature
We shouldn't try to use geometry shaders on implementations that don't
support them. So let's verify the feature before using it.

Fixes: 8028991f36 ("zink: enable gs pipe caps")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7287>
2020-10-26 10:36:42 +00:00
Mike Blumenkrantz 0c70268ff7 zink: mark ARB_sample_shading as supported
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7192>
2020-10-16 17:14:51 +00:00
Mike Blumenkrantz 7c5129985b zink: implement ARB_draw_indirect
other than the vaguely gross case of primitive restart with incompatible
draw modes and/or restart index, this is no trouble since the buffer formats
are compatible

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7191>
2020-10-16 15:55:09 +00:00
Mike Blumenkrantz 80c66642cc zink: bump GLSL to 3.30
somehow all these tests Just Pass™

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7190>
2020-10-16 11:37:49 -04:00
Mike Blumenkrantz 26b076ff66 zink: GLSL 1.50
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7190>
2020-10-16 11:37:45 -04:00
Mike Blumenkrantz 815f0c01b0 zink: bump to glsl 1.40
but leaving compat mode at 1.30 for now

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7109>
2020-10-16 13:57:56 +00:00
Mike Blumenkrantz 8028991f36 zink: enable gs pipe caps
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7139>
2020-10-16 09:15:34 -04:00
Mike Blumenkrantz 23e731fcdb zink: export PIPE_CAP_MAX*_VARYINGS values
this is separate from PIPE_SHADER_CAP_MAX_OUTPUTS

fixes mesa/mesa#3105

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7110>
2020-10-14 14:47:22 +00:00
Erik Faye-Lund 77c1b01508 zink: do not report SSBOs as halfway supported
We don't support SSBOs yet, as we don't expose the
PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT-cap. But the gallium
state-tracker's limit-calculation gets confused by this half-way
support, and ends up thinking we can support atomics, which we
don't support yet either.

So let's not confuse the state-tracker here, and let's introduce this
again when SSBOs are actually supported.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7113>
2020-10-13 16:55:22 +00:00
Mike Blumenkrantz ef0babab38 zink: ARB_uniform_buffer_object is now implemented, so add cap and feature doc
fixes mesa/mesa#2872

Reviewed-By: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7079>
2020-10-13 12:02:59 +00:00
Mike Blumenkrantz bab0d8630c zink: support VK_EXT_extended_dynamic_state
just the screen parts

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7099>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz 66fc9f5571 zink: support VK_EXT_blend_operation_advanced
just the screen bits

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7099>
2020-10-12 18:26:56 +00:00
Mike Blumenkrantz 61c095f09a zink: enable pipe caps for ARB_timer_query
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6923>
2020-10-06 12:17:31 +00:00
Mike Blumenkrantz e3b814d5e9 zink: hook up driconf
we need this

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7009>
2020-10-05 12:26:30 -04:00
Mike Blumenkrantz 9a8539206f zink: fix shader buffer size caps to use 65536
using max(Uniform|Storage)BufferRange yields some insane values that aren't
consistent with reality

affects PIPE_CAP_MAX_SHADER_BUFFER_SIZE and PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6981>
2020-10-02 13:07:42 +00:00
Hoe Hao Cheng b2d042b621 zink: remove old extension infrastructure
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/6789>
2020-09-28 15:03:56 +00:00
Hoe Hao Cheng 08d51e92ae zink: use the new, generated extension infrastructure
this is just a find-and-replace from screen->... to screen->info.

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/6789>
2020-09-28 15:03:56 +00:00
Hoe Hao Cheng 79c0023d19 zink: use the new extension infrastructure in device creation
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/6789>
2020-09-28 15:03:56 +00:00
Hoe Hao Cheng 0ed17a212c zink: hook zink_device_info.py to build system
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/6789>
2020-09-28 15:03:56 +00:00
Mike Blumenkrantz 818bd61099 zink: implement ARB_instanced_arrays
this is just a simple case of connecting up the vertex state to the pipeline
state

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6270>
2020-09-24 20:40:39 +00:00
Eric Anholt ab6a09f25b zink: Fix unused var warnings in release build from assertions.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>
2020-08-28 22:45:08 +00:00
Mike Blumenkrantz 37872edf6f zink: print error when getprocaddr fails for extension functions
make this more visible on errors

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6271>
2020-08-12 13:19:23 +00:00
Mike Blumenkrantz 54c68498d4 zink: set primitive restart cap
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>
2020-08-07 11:17:04 +00:00
Rob Clark c4e0cae90c gallium: replace 16BIT_TEMPS cap with 16BIT_CONSTS
All drivers that support mediump lowering should support 16BIT_TEMPS,
but some do not also want 16b consts to be lowered.  Replace the pipe
cap in preperation to remove LowerPrecisionTemporaries.

Note: also updates reference checksums for the arm64_a630_traces job,
due to lowering more to 16b

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>
2020-08-05 21:00:44 +00:00
Mike Blumenkrantz cd1c21f8e5 zink: implement handling for VK_EXT_calibrated_timestamps
just the extension setup; we need this to handle device timestamp
queries outside of batches

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5913>
2020-08-03 14:22:39 +00:00
Mike Blumenkrantz 8930b19676 zink: store valid timestamp bits onto zink_screen
we need this for converting timestamp ticks to nonoseconds

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5913>
2020-08-03 14:22:39 +00:00
Mike Blumenkrantz 3e6366be68 zink: handle VK_EXT_vertex_attribute_divisor setup
this just enables the extension

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5913>
2020-08-03 14:22:39 +00:00
Mike Blumenkrantz 99b44536bf zink: clamp PIPE_SHADER_CAP_MAX_SHADER_BUFFERS to PIPE_MAX_SHADER_BUFFERS
this value gets split between ssbos and abos, so clamping to 8 here causes
a number of tests to fail just because there's not enough buffers available

other gallium drivers return 32 here, so this seems pretty safe

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5913>
2020-08-03 14:22:39 +00:00
Mike Blumenkrantz 01d6220cff zink: implement VK_EXT_robustness2
this adds support for null descriptors, which is necessary for full
compliance with ARB_texture_buffer_object

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5913>
2020-08-03 14:22:39 +00:00
Mike Blumenkrantz 5e9cd64f70 zink: enable tgsi texcoord pipe cap
this requires some modifications to the ntv slot remapping, as we definitely
don't want to reserve another 25% of the available slots for the (deprecated)
texcoord varyings

now we remap VARYING_SLOT_TEX[n] to the last available slots, which lets us avoid
needing to do permanent reservation, and we check to make sure that we haven't
seen the corresponding texcoord varying any time we emit a non-texcoord varying in
that slot

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5551>
2020-07-14 20:48:17 +00:00
Erik Faye-Lund 44da0f067c zink: expose depth-clip if supported
We already set up the state as needed, so it should only be a matter of
exposing it.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5495>
2020-07-08 14:43:02 +00:00
Marek Olšák 75b59bb1d6 gallium: add PIPE_SHADER_CAP_GLSL_16BIT_TEMPS for LowerPrecisionTemporaries
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>
2020-07-07 22:02:06 -04:00
Mike Blumenkrantz f2f57ef9f7 zink: implement Vk_EXT_index_type_uint8
this is a simple extension that enables using uint8-sized index buffers,
which lets us avoid having those go through primconvert

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5712>
2020-07-02 07:11:27 +00:00
Mike Blumenkrantz e8ad52f7b0 zink: enable xfb extension in screen creation
switch around the feature enabling as well since extensions need the related
feature to also be enabled in order to function

fixes mesa/mesa#2868

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
2020-06-17 20:42:01 +00:00
Mike Blumenkrantz e5e657768c zink: switch to passing VkPhysicalDeviceFeatures2 in VkDeviceCreateInfo
extensions need to have their feature structs passed in pNext to be enabled,
so switch to using the feature struct here in preparation for that

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
2020-06-17 20:42:01 +00:00
Mike Blumenkrantz 1983609212 zink: set PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED and remove POS special casing
this cap creates a different varying output which remains constant to be
emitted by xfb, allowing us to drop the special-casing code in ntv

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
2020-06-17 20:42:01 +00:00
Mike Blumenkrantz 37778fcd9a zink: implement transform feedback support to finish off opengl 3.0
this adds:
* context hooks for gallium stream output methods
* handling for xfb-related queries
* barrier management for pausing and resuming xfb

loosely based on patches originally written by Dave Airlie <airlied@redhat.com>

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
2020-06-17 20:42:01 +00:00
Mike Blumenkrantz f841d11c9f zink: use '2' variants for device props/feats, check features for ext enabling
technically both the extension and feature should be checked when enabling
extensions, and some features cannot be properly enabled without using
the more descriptive versions of these APIs

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
2020-06-17 20:42:00 +00:00
Erik Faye-Lund 6785d8c460 zink: expose GLSL 1.30
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5479>
2020-06-16 09:14:56 +00:00
Erik Faye-Lund 9bf2f4d411 zink: enable cull-distance if supported
This is already implemented, and we just need to flip the switch to turn
it on.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5479>
2020-06-16 09:14:56 +00:00
Erik Faye-Lund 10f07495f6 zink: only report device-local memory as video-memory
While the definition of "video memory" isn't super clear, I think it's
pretty reasonable to assume host-memory isn't meant to be included. So
let's only count dedicated memory here.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3107
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5409>
2020-06-10 08:58:09 +00:00
Marek Olšák 1af8fe4ed5 gallium: add shader caps INT16 and FP16_DERIVATIVES
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002>
2020-06-02 20:01:18 +00:00
Erik Faye-Lund cd1639cbe3 zink: expose PIPE_CAP_TEXTURE_MULTISAMPLE
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5159>
2020-05-26 07:55:17 +00:00
Erik Faye-Lund ed95f69dd5 zink: correct PIPE_SHADER_CAP_MAX_SHADER_IMAGES
We don't support shader-images yet, so this is premature to expose.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5024>
2020-05-14 15:58:43 +00:00
Erik Faye-Lund 50ebe5a991 zink: do not expose real value for PIPE_CAP_MAX_VIEWPORTS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5024>
2020-05-14 15:58:43 +00:00
Marek Olšák d6287a94b6 gallium: rename 'state tracker' to 'frontend'
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
2020-05-13 13:46:53 -04:00
Dave Airlie 5743fa6e70 zink: enable conditional rendering if available
This doesn't seem to work perfect, but I'm not sure what is possible
in GL vs Vulkan here

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2867
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4835>
2020-05-11 09:09:34 +00:00
Erik Faye-Lund 5c7dea394f zink: add a GET_PROC_ADDR macro to simplify load_device_extensions
This doesn't do much for now, but it will keep thing cleaner in the next
commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4835>
2020-05-11 09:09:34 +00:00
Erik Faye-Lund b8fd70eef2 zink: load vk_GetMemoryFdKHR while creating screen
We're about to load some more extension-pointers as well, so let's
create a separate place for doing this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4835>
2020-05-11 09:09:34 +00:00
Erik Faye-Lund b7e966dc7f zink: do not report texture-samplers for unsupported stages
This caused the max combined samplers to be reported as artificially
high.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3826>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3826>
2020-02-17 10:00:18 +00:00
Erik Faye-Lund eb0195358c zink: only inspect dual-src limit if feature enabled
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3689>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3689>
2020-02-10 11:01:47 +00:00
Erik Faye-Lund 8405e1bef0 zink: implement support for derivative-control
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3645>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3645>
2020-01-31 08:56:55 +00:00
Erik Faye-Lund f12b844e7c zink: implement load_instance_id
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3644>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3644>
2020-01-31 08:40:24 +00:00
Erik Faye-Lund c0ced1e79b zink: enable texture-buffer objects
This seems to work as-is, and just need enabling. There's a few piglit
failures, but those seems to be problems with the tests, where they
don't handle lacking GL3-support.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3647>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3647>
2020-01-31 08:23:07 +00:00
Erik Faye-Lund af65bfb38f zink: implement nir_texop_txd
This lets us enable PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD, which in turns
gives us ARB_shader_texture_lod.

Still fails one piglit test on ANV, namely
spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgradcube,
but with 33 new passing tests, I think this is worth it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3140>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3140>
2019-12-19 13:14:29 +01:00
Erik Faye-Lund b31d1b73bc zink: enable PIPE_CAP_MIXED_COLORBUFFER_FORMATS
This just works in Vulkan, there's no work neeed to enable it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3148>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3148>
2019-12-19 10:08:13 +01:00
Erik Faye-Lund 655b9aa711 zink: reject invalid sample-counts
Vulkan only allows power-of-two sample counts. We already kinda checked
for this, but forgot to validate the result in the end. Let's check the
result and error properly.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2019-11-29 08:58:05 +01:00
Erik Faye-Lund 927363e0b9 zink: use true/false instead of TRUE/FALSE
Reviewed-by: Dave Airlie <airlied@redhat.com>
2019-11-29 08:57:33 +01:00
Eric Anholt 882ca6dfb0 util: Move gallium's PIPE_FORMAT utils to /util/format/
To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to
move their helpers out of gallium.  Since u_format used
util_copy_rect(), I moved that in there, too.

I've put it in a separate directory in util/ because it's a big chunk
of related code, and it's not clear to me whether we might want it as
a separate library from libmesa_util at some point.

Closes: #1905
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-11-14 10:47:20 -08:00
Erik Faye-Lund 36f3902213 zink: move format-checking to separate source
This code is more or less stand-alone, and this keeps the formats array
a bit more encapsulated.
2019-11-13 09:12:36 +01:00
Erik Faye-Lund b4d47e21d7 zink: correct depth-stencil format
When using packed vulkan-formats on little-endian systems, we need to
swap the components for the gallium formats. And since Zink isn't
big-endian safe yet, little-endian is the only endianess we care about
right now.

This fixes a bunch of piglit tests, amongs others:
- spec@arb_depth_texture@depth-level-clamp
- spec@arb_depth_texture@depthstencil-render-miplevels * d=z24
- spec@arb_depth_texture@fbo-depth-gl_depth_component24-blit
- spec@arb_depth_texture@fbo-depth-gl_depth_component24-copypixels
- spec@arb_depth_texture@fbo-depth-gl_depth_component24-drawpixels
- spec@arb_depth_texture@fbo-depth-gl_depth_component24-readpixels

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 8d46e35d16 ("zink: introduce opengl over vulkan")
2019-11-11 14:35:53 +00:00
Erik Faye-Lund bc80900b6c zink: do advertize integer support in shaders
This is supported, so let's correct this.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2019-11-06 13:43:14 +01:00
Erik Faye-Lund b385ad0c75 zink: disable fragment-shader texture-lod
We don't support nir_texop_txd, which is required by this cap. So let's
disable it for now.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 8d46e35d16 ("zink: introduce opengl over vulkan")
2019-11-06 11:37:36 +00:00
Erik Faye-Lund a32a92f53a zink: do not advertize coherent mapping
We do not support them yet, so let's not pretend.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 8d46e35d16 ("zink: introduce opengl over vulkan")
2019-11-06 11:37:36 +00:00
Erik Faye-Lund 477f019812 zink: only enable KHR_external_memory_fd if supported
While we're at it, make sure we error out if it's not supported when
required.

This brings us a bit closer to being able to test on SwiftShader, which
doesn't currently support KHR_external_memory_fd.
2019-10-30 19:40:50 +00:00
Erik Faye-Lund 810fc75dab zink: emulate optional depth-formats
The Vulkan spec says that an implementation has to support one of
VK_FORMAT_X8_D24_UNORM_PACK32 and VK_FORMAT_D32_SFLOAT, as well of
one of VK_FORMAT_D24_UNORM_S8_UINT and VK_FORMAT_D32_SFLOAT_S8_UINT.

So let's keep track which one is supported of earch pair, and emulate
one on top of the other one.

This won't give the exact result for comparisons, or when mapping and
unmapping the resources. But it's better than flat out failing to create
the resource, and we can fix the map/unmap issue later if needed.

Tested-by: Duncan Hopkins <duncan@thefoundry.co.uk>
2019-10-28 17:57:49 +00:00
Erik Faye-Lund e6ea350fb0 zink: error if VK_KHR_maintenance1 isn't supported
While we're at it, remove the VK_-prefix from the extension bool; all
extensions have this so it's kinda superfluous.
2019-10-28 17:57:49 +00:00
Erik Faye-Lund 65fbb1836a zink: use VK_FORMAT_B8G8R8A8_UNORM for PIPE_FORMAT_B8G8R8X8_UNORM
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:48 +00:00
Erik Faye-Lund c7bcb6e5dc zink: lower two-sided coloring
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:48 +00:00
Erik Faye-Lund 1f3d2b9f80 zink/spirv: implement load_front_face
We're now adding interface-types during code-emitting, so we need to
defer emitting the entry-point. No biggie, spirv_builder is prepares for
this.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:48 +00:00
Erik Faye-Lund 3ef3ab2d54 zink: lower point-size
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:47 +00:00
Erik Faye-Lund f24e14cc08 zink: add missing sRGB DXT-formats
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:47 +00:00
Erik Faye-Lund d50ec9f798 zink: disable PIPE_CAP_QUERY_TIME_ELAPSED for now
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:47 +00:00
Erik Faye-Lund 7ebdf5be15 zink: disable timestamp-queries
We don't implement the get_timestamp context-method, so this is just
going to crash if anyone tries to use it. Let's implement it later.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:47 +00:00
Erik Faye-Lund 967e570511 zink: add note about enabling PIPE_CAP_CLIP_HALFZ
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:46 +00:00
Erik Faye-Lund 7004afcd24 zink: remove insecure comment
This isn't as inaccurate as the comment says, the Vulkan documentation
even seems to suggest this is the same. Let's drop the comment.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:46 +00:00
Erik Faye-Lund a10d43d845 zink: avoid texelFetch until it's implemented
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:46 +00:00
Erik Faye-Lund 10439594ec zink: only consider format-desc if checking details
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:46 +00:00
Dave Airlie 4480aefc38 zink: attempt to get multisample resource creation right
Use the exposed vulkan limits to fill out supported formats.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:45 +00:00
Erik Faye-Lund 8edd357795 zink: request ucp-lowering
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:45 +00:00
Dave Airlie 5dbfb02459 zink: add support for compressed formats
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:45 +00:00
Erik Faye-Lund 6ae8686bff zink: request alpha-test lowering
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:45 +00:00
Duncan Hopkins d850e2a3f2 zink: clamped limits to INT_MAX when stored as uint32_t.
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:45 +00:00
Dave Airlie 6d96578912 zink: query support (v2)
This at least passes piglit occlusion_query test for me here now.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:43 +00:00
Dave Airlie 9fa7400564 zink: add dri loader
export MESA_LOADER_DRIVER_OVERRIDE=zink should now work without using
swrast paths

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:43 +00:00
Erik Faye-Lund 4249e4a598 zink/spirv: implement point-sprites
This passes glsl-fs-pointcoord_gles2 from piglit.

Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:43 +00:00
Dave Airlie c3bd0274c6 zink: ask for flatshade lowering
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:43 +00:00
Erik Faye-Lund 48f1f20a9d zink: detect presence of VK_KHR_maintenance1
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:43 +00:00
Erik Faye-Lund 8d46e35d16 zink: introduce opengl over vulkan
Here's zink, a so far pretty simple vulkan-gallium driver that is able
to translate some applications from OpenGL to Vulkan.

The compiler is quite limited for now, this will be improved on later.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2019-10-28 08:51:43 +00:00