turnip: fix invalid VK_ERROR_OUT_OF_POOL_MEMORY

When VK_DESCRIPTOR_TYPE_SAMPLER is provided, it doesn't need to be
counted as a buffer count. Otherwise it leads to mismatch of allocated
buffer size, hitting VK_ERROR_OUT_OF_POOL_MEMORY finally.

Fixes: c39afe68f0

Also fixes amber tests:
./tests/cases/address_modes_float.amber
./tests/cases/address_modes_int.amber
./tests/cases/magfilter_linear.amber
./tests/cases/magfilter_nearest.amber

Reviewed-by: Jonathan Marek <jonathan@marek.ca>
(cherry picked from commit 26d93a7495)
This commit is contained in:
Hyunjun Ko 2020-01-17 07:23:03 +00:00 committed by Dylan Baker
parent 1ba22bfe3e
commit a1524cc3a8
2 changed files with 4 additions and 1 deletions

View file

@ -2038,7 +2038,7 @@
"description": "turnip: fix invalid VK_ERROR_OUT_OF_POOL_MEMORY",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "c39afe68f0390d45130c1317b3b7e65f55542c36"
},

View file

@ -157,6 +157,9 @@ tu_CreateDescriptorSetLayout(
unsigned binding_buffer_count = 1;
switch (binding->descriptorType) {
case VK_DESCRIPTOR_TYPE_SAMPLER:
binding_buffer_count = 0;
break;
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
assert(!(pCreateInfo->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));