mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Update VK_CBuffer_Zoo test to account for glslang regression
* glslang now requires and uses scalar block layout for hlsl cbuffer packing
This commit is contained in:
@@ -332,7 +332,8 @@ layout(set = 0, binding = 0) cbuffer consts
|
||||
float4 dummy1;
|
||||
|
||||
float o[4]; // should cover 4 float4s = 48, <..>, 52, <..>, 56, <..>, 60
|
||||
float p; // can't be packed in with above array = 64, <65, 66, 67>
|
||||
float p; // with glslang regression to scalar packing, is packed after = 61
|
||||
float3 glslang_regression;
|
||||
float4 dummy2;
|
||||
float4 gldummy;
|
||||
|
||||
@@ -393,7 +394,8 @@ layout(set = 0, binding = 0) cbuffer consts
|
||||
// row1: {197, 201}
|
||||
// <198, 202>
|
||||
// <199, 203>
|
||||
float z; // doesn't overlap in final row = 204, <205, 206, 207>
|
||||
float z; // with glslang regression to scalar packing, is packed after = 202
|
||||
float3 glslang_regression2;
|
||||
|
||||
// SPIR-V can't represent single-dimension matrices properly at the moment
|
||||
/*
|
||||
@@ -572,6 +574,10 @@ float4 main() : SV_Target0
|
||||
devExts.push_back(VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME);
|
||||
optDevExts.push_back(VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME);
|
||||
|
||||
// new glslang has a regression that requires scalar block layout for hlsl and does not support
|
||||
// generating non-scalar layout hlsl packing
|
||||
devExts.push_back(VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME);
|
||||
|
||||
VulkanGraphicsTest::Prepare(argc, argv);
|
||||
|
||||
static VkPhysicalDeviceInlineUniformBlockFeaturesEXT inlineFeats = {
|
||||
@@ -584,6 +590,19 @@ float4 main() : SV_Target0
|
||||
inlineFeats.pNext = (void *)devInfoNext;
|
||||
devInfoNext = &inlineFeats;
|
||||
}
|
||||
|
||||
static VkPhysicalDeviceScalarBlockLayoutFeaturesEXT scalarFeatures = {
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT,
|
||||
};
|
||||
|
||||
getPhysFeatures2(&scalarFeatures);
|
||||
|
||||
if(!scalarFeatures.scalarBlockLayout)
|
||||
Avail = "Scalar block layout feature 'scalarBlockLayout' not available";
|
||||
|
||||
scalarFeatures.pNext = (void *)devInfoNext;
|
||||
|
||||
devInfoNext = &scalarFeatures;
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
@@ -529,8 +529,11 @@ class VK_CBuffer_Zoo(rdtest.TestCase):
|
||||
3: lambda x: x.rows(1).cols(1).value([60.0]),
|
||||
})
|
||||
|
||||
# float p; with std140 vulkan packing
|
||||
var_check.check('p').rows(1).cols(1).value([64.0])
|
||||
# float p; with forced scalar vulkan packing due to glslang regression
|
||||
var_check.check('p').rows(1).cols(1).value([61.0])
|
||||
|
||||
# float3 glslang_regression;
|
||||
var_check.check('glslang_regression')
|
||||
|
||||
# float4 dummy2;
|
||||
var_check.check('dummy2')
|
||||
@@ -608,7 +611,10 @@ class VK_CBuffer_Zoo(rdtest.TestCase):
|
||||
197.0, 201.0])
|
||||
|
||||
# float z;
|
||||
var_check.check('z').rows(1).cols(1).value([204.0])
|
||||
var_check.check('z').rows(1).cols(1).value([202.0])
|
||||
|
||||
# float3 glslang_regression2;
|
||||
var_check.check('glslang_regression2')
|
||||
|
||||
# Temporarily until SPIR-V support for degenerate HLSL matrices is determined
|
||||
var_check.check('dummy9')
|
||||
|
||||
Reference in New Issue
Block a user