Igalia / vkrunner

A shader script tester for Vulkan. Moved to https://gitlab.freedesktop.org/mesa/vkrunner
Other
43 stars 14 forks source link

Support configuring either std140 or std430 layouts for test commands #47

Closed bpeel closed 5 years ago

bpeel commented 5 years ago

As described in issue #32, this adds commands to set the buffer layouts. The commands are:

push layout (std140|std430)
ssbo layout (std140|std430)
ubo layout (std140|std430)

Each of them sets the layouts expected for subsequent push constants, SSBOs and UBOs respectively.

There is also a patch to change the defaults for push constants and SSBOs to std430 so that it matches the defaults in GLSL. This makes writing scripts easier. However it also means that existing scripts using SSBOs might break.

Any comments would be appreciated.

dj2 commented 5 years ago

Should the commands be uniform layout, ssbo layout and uniform ubo layout to match what will be used to set the data later in the script?

bpeel commented 5 years ago

@dj2 I think I prefer “(ubo|ssbo|push) layout”. If there was a “uniform layout” it wouldn’t be very intuitive and people might think it sets the layout for all uniforms, ie both push constants and UBOs.

Calling the commands “uniform” and “uniform ubo” was an attempt to make the VkRunner scripts closer to the format Piglit uses. Perhaps one day it would be better to add alternative names for these commands like this:

push _type_ _offset_ _values_…
ubo _binding_ subdata _type_ _offset_ _values_…

We could keep the old names too for compatibility.

bpeel commented 5 years ago

I’ve pushed the patches that add the internal implementation and change the defaults to use std430 for push constants and SSBOs. There seemed to be agreement for this in the other issue. The patches that actually add the commands to change the layouts are left in this pull request in case there is further discussion.

samuelig commented 5 years ago

Please rebase. The change LGTM.

bpeel commented 5 years ago

Thanks, I’ve rebased and merged the branch.