Skip to content

Commit

Permalink
Merge vk-gl-cts/vulkan-cts-1.3.10 into vk-gl-cts/main
Browse files Browse the repository at this point in the history
Change-Id: I7d81e1ffc496c0a2351f55ccf2002bba03fe2b2c
  • Loading branch information
lordalcol committed Oct 10, 2024
2 parents 8f8b9e1 + 13f2fe9 commit c9a54ef
Show file tree
Hide file tree
Showing 28 changed files with 356 additions and 23,787 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,6 @@ void TessellationShaderTests::addTessellationShaderVertexSpacingTest(TestCaseGro
return;
}

deqp::GLExtTokens m_glExtTokens;
m_glExtTokens.init(m_context.getRenderContext().getType());

const glw::Functions &gl = m_context.getRenderContext().getFunctions();

/* Retrieve GL_MAX_TESS_GEN_LEVEL_EXT value */
glw::GLint gl_max_tess_gen_level_value;
gl.getIntegerv(m_glExtTokens.MAX_TESS_GEN_LEVEL, &gl_max_tess_gen_level_value);
GLU_EXPECT_NO_ERROR(gl.getError(), "glGetIntegerv() call failed for GL_MAX_TESS_GEN_LEVEL_EXT pname");

const _tessellation_shader_vertex_spacing vs_modes[] = {
TESSELLATION_SHADER_VERTEX_SPACING_EQUAL, TESSELLATION_SHADER_VERTEX_SPACING_FRACTIONAL_EVEN,
TESSELLATION_SHADER_VERTEX_SPACING_FRACTIONAL_ODD, TESSELLATION_SHADER_VERTEX_SPACING_DEFAULT};
Expand All @@ -116,39 +106,16 @@ void TessellationShaderTests::addTessellationShaderVertexSpacingTest(TestCaseGro
TESSELLATION_SHADER_PRIMITIVE_MODE_QUADS};
const unsigned int n_primitive_modes = sizeof(primitive_modes) / sizeof(primitive_modes[0]);

size_t test_index = 0;
/* Iterate through all primitive modes */
for (unsigned int n_primitive_mode = 0; n_primitive_mode < n_primitive_modes; ++n_primitive_mode)
{
_tessellation_primitive_mode primitive_mode = primitive_modes[n_primitive_mode];

/* Generate tessellation level set for current primitive mode */
_tessellation_levels_set tess_levels_set;

tess_levels_set = TessellationShaderUtils::getTessellationLevelSetForPrimitiveMode(
primitive_mode, gl_max_tess_gen_level_value,
TESSELLATION_LEVEL_SET_FILTER_INNER_AND_OUTER_LEVELS_USE_DIFFERENT_VALUES);

/* Iterate through all vertex spacing modes */
for (unsigned int n_vs_mode = 0; n_vs_mode < n_vs_modes; ++n_vs_mode)
{
_tessellation_shader_vertex_spacing vs_mode = vs_modes[n_vs_mode];
_tessellation_primitive_mode primitive_mode = primitive_modes[n_primitive_mode];

/* Iterate through all tessellation level combinations */
for (_tessellation_levels_set_const_iterator tess_levels_set_iterator = tess_levels_set.begin();
tess_levels_set_iterator != tess_levels_set.end(); tess_levels_set_iterator++)
{
if (primitive_mode == TESSELLATION_SHADER_PRIMITIVE_MODE_QUADS &&
vs_mode == TESSELLATION_SHADER_VERTEX_SPACING_FRACTIONAL_ODD &&
((*tess_levels_set_iterator).inner[0] <= 1 || (*tess_levels_set_iterator).inner[1] <= 1))
{
continue;
}

vertexGroup->addChild(new TessellationShaderVertexSpacing(
m_context, m_extParams, primitive_mode, vs_mode, *tess_levels_set_iterator, test_index));
test_index++;
}
vertexGroup->addChild(new TessellationShaderVertexSpacing(m_context, m_extParams, primitive_mode, vs_mode));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,15 @@ bool TessellationShaderVertexSpacing::_tess_coordinate_cartesian::operator==(
**/
TessellationShaderVertexSpacing::TessellationShaderVertexSpacing(Context &context, const ExtParameters &extParams,
_tessellation_primitive_mode primitive_mode,
_tessellation_shader_vertex_spacing vs_mode,
_tessellation_levels tess_levels, size_t test_index)
_tessellation_shader_vertex_spacing vs_mode)
: TestCaseBase(context, extParams, "vertex_spacing", "Verifies vertex spacing qualifier behaves as specified")
, m_gl_max_tess_gen_level_value(0)
, m_vao_id(0)
, m_utils(nullptr)
, m_primitive_mode(primitive_mode)
, m_vs_mode(vs_mode)
, m_tess_levels(tess_levels)
{
TestCaseBase::m_name.append("_test_index_" + std::to_string(test_index) + "_primitive_mode_" +
TestCaseBase::m_name.append("_primitive_mode_" +
TessellationShaderUtils::getESTokenForPrimitiveMode(m_primitive_mode) + "_vs_mode_" +
TessellationShaderUtils::getESTokenForVertexSpacingMode(m_vs_mode));
}
Expand Down Expand Up @@ -925,67 +923,86 @@ void TessellationShaderVertexSpacing::initTest()
gl.getIntegerv(m_glExtTokens.MAX_TESS_GEN_LEVEL, &m_gl_max_tess_gen_level_value);
GLU_EXPECT_NO_ERROR(gl.getError(), "glGetIntegerv() call failed for GL_MAX_TESS_GEN_LEVEL_EXT pname");

_run run;
/* Fill run descriptor */
memcpy(run.inner, m_tess_levels.inner, sizeof(run.inner));
memcpy(run.outer, m_tess_levels.outer, sizeof(run.outer));
_tessellation_levels_set tess_levels_set;
tess_levels_set = TessellationShaderUtils::getTessellationLevelSetForPrimitiveMode(
m_primitive_mode, m_gl_max_tess_gen_level_value,
TESSELLATION_LEVEL_SET_FILTER_INNER_AND_OUTER_LEVELS_USE_DIFFERENT_VALUES);

run.primitive_mode = m_primitive_mode;
run.vertex_spacing = m_vs_mode;
/* Iterate through all tessellation level combinations */
for (_tessellation_levels_set_const_iterator tess_levels_set_iterator = tess_levels_set.begin();
tess_levels_set_iterator != tess_levels_set.end(); tess_levels_set_iterator++)
{
const _tessellation_levels &tess_levels = *tess_levels_set_iterator;

/* Retrieve vertex data for both passes */
run.n_vertices = m_utils->getAmountOfVerticesGeneratedByTessellator(
run.primitive_mode, run.inner, run.outer, run.vertex_spacing, true); /* is_point_mode_enabled */
if (m_primitive_mode == TESSELLATION_SHADER_PRIMITIVE_MODE_QUADS &&
m_vs_mode == TESSELLATION_SHADER_VERTEX_SPACING_FRACTIONAL_ODD &&
(tess_levels.inner[0] <= 1 || tess_levels.inner[1] <= 1))
{
continue;
}

if (run.n_vertices == 0)
{
std::string primitive_mode_string = TessellationShaderUtils::getESTokenForPrimitiveMode(m_primitive_mode);
std::string vs_mode_string = TessellationShaderUtils::getESTokenForVertexSpacingMode(m_vs_mode);

m_testCtx.getLog() << tcu::TestLog::Message
<< "No vertices were generated by tessellator for: "
"inner tess levels:"
"["
<< run.inner[0] << ", " << run.inner[1]
<< "]"
", outer tess levels:"
"["
<< run.outer[0] << ", " << run.outer[1] << ", " << run.outer[2] << ", " << run.outer[3]
<< "]"
", primitive mode: "
<< primitive_mode_string << ", vertex spacing: " << vs_mode_string
<< tcu::TestLog::EndMessage;

TCU_FAIL("Zero vertices were generated by tessellator");
}
_run run;
/* Fill run descriptor */
memcpy(run.inner, tess_levels.inner, sizeof(run.inner));
memcpy(run.outer, tess_levels.outer, sizeof(run.outer));

/* Retrieve the data buffers */
run.data = m_utils->getDataGeneratedByTessellator(run.inner, true, /* is_point_mode_enabled */
run.primitive_mode, TESSELLATION_SHADER_VERTEX_ORDERING_CCW,
run.vertex_spacing, run.outer);
run.primitive_mode = m_primitive_mode;
run.vertex_spacing = m_vs_mode;

/* 'triangles' tessellation data is expressed in barycentric coordinates. Before we can
* continue, we need to convert the data to Euclidean space */
if (run.primitive_mode == TESSELLATION_SHADER_PRIMITIVE_MODE_TRIANGLES)
{
run.data_cartesian.resize(run.n_vertices * 2 /* components */);
/* Retrieve vertex data for both passes */
run.n_vertices = m_utils->getAmountOfVerticesGeneratedByTessellator(
run.primitive_mode, run.inner, run.outer, run.vertex_spacing, true); /* is_point_mode_enabled */

if (run.n_vertices == 0)
{
std::string primitive_mode_string = TessellationShaderUtils::getESTokenForPrimitiveMode(m_primitive_mode);
std::string vs_mode_string = TessellationShaderUtils::getESTokenForVertexSpacingMode(m_vs_mode);

m_testCtx.getLog() << tcu::TestLog::Message
<< "No vertices were generated by tessellator for: "
"inner tess levels:"
"["
<< run.inner[0] << ", " << run.inner[1]
<< "]"
", outer tess levels:"
"["
<< run.outer[0] << ", " << run.outer[1] << ", " << run.outer[2] << ", " << run.outer[3]
<< "]"
", primitive mode: "
<< primitive_mode_string << ", vertex spacing: " << vs_mode_string
<< tcu::TestLog::EndMessage;

TCU_FAIL("Zero vertices were generated by tessellator");
}

for (unsigned int n_vertex = 0; n_vertex < run.n_vertices; ++n_vertex)
/* Retrieve the data buffers */
run.data = m_utils->getDataGeneratedByTessellator(run.inner, true, /* is_point_mode_enabled */
run.primitive_mode, TESSELLATION_SHADER_VERTEX_ORDERING_CCW,
run.vertex_spacing, run.outer);

/* 'triangles' tessellation data is expressed in barycentric coordinates. Before we can
* continue, we need to convert the data to Euclidean space */
if (run.primitive_mode == TESSELLATION_SHADER_PRIMITIVE_MODE_TRIANGLES)
{
const float *barycentric_vertex_data = (const float *)(&run.data[0]) + n_vertex * 3; /* components */
float *cartesian_vertex_data = (float *)(&run.data_cartesian.at(n_vertex * 2)); /* components */
run.data_cartesian.resize(run.n_vertices * 2 /* components */);

for (unsigned int n_vertex = 0; n_vertex < run.n_vertices; ++n_vertex)
{
const float *barycentric_vertex_data = (const float *)(&run.data[0]) + n_vertex * 3; /* components */
float *cartesian_vertex_data = (float *)(&run.data_cartesian.at(n_vertex * 2)); /* components */

TessellationShaderUtils::convertBarycentricCoordinatesToCartesian(barycentric_vertex_data,
cartesian_vertex_data);
TessellationShaderUtils::convertBarycentricCoordinatesToCartesian(barycentric_vertex_data,
cartesian_vertex_data);
}
} /* if (run.primitive_mode == TESSELLATION_SHADER_PRIMITIVE_MODE_TRIANGLES) */
else
{
run.data_cartesian.clear();
}
} /* if (run.primitive_mode == TESSELLATION_SHADER_PRIMITIVE_MODE_TRIANGLES) */
else
{
run.data_cartesian.clear();
}

/* Store the run data */
m_runs.emplace_back(std::move(run));
/* Store the run data */
m_runs.emplace_back(std::move(run));
}
}

/** Executes the test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class TessellationShaderVertexSpacing : public TestCaseBase
/* Public methods */
TessellationShaderVertexSpacing(Context &context, const ExtParameters &extParams,
_tessellation_primitive_mode primitive_mode,
_tessellation_shader_vertex_spacing vs_mode, _tessellation_levels tess_levels,
size_t test_index);
_tessellation_shader_vertex_spacing vs_mode);

virtual ~TessellationShaderVertexSpacing(void)
{
Expand Down Expand Up @@ -352,7 +351,6 @@ class TessellationShaderVertexSpacing : public TestCaseBase

_tessellation_primitive_mode m_primitive_mode;
_tessellation_shader_vertex_spacing m_vs_mode;
_tessellation_levels m_tess_levels;
};

} // namespace glcts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,14 @@ void checkSupport(Context &context, ConditionalTestSpec testSpec)
testSpec.command == DRAW_COMMAND_TYPE_DRAW_MULTI_INDEXED_EXT)
context.requireDeviceFunctionality("VK_EXT_multi_draw");

if (!context.getTransformFeedbackFeaturesEXT().geometryStreams)
TCU_THROW(NotSupportedError, "geometryStreams feature not supported");
if (context.getTransformFeedbackPropertiesEXT().transformFeedbackDraw == VK_FALSE)
TCU_THROW(NotSupportedError, "transformFeedbackDraw feature not supported");
if (context.getTransformFeedbackPropertiesEXT().maxTransformFeedbackBuffers < 4)
TCU_THROW(NotSupportedError, "maxTransformFeedbackBuffers is less than required");
if (context.getTransformFeedbackPropertiesEXT().maxTransformFeedbackStreams < 4)
TCU_THROW(NotSupportedError, "maxTransformFeedbackStreams is less than required");
}

ConditionalTransformFeedbackDraw::ConditionalTransformFeedbackDraw(Context &context, ConditionalTestSpec testSpec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@ tcu::TestStatus conditionalPreprocessRun(Context &context, ConditionalPreprocess
ctx.vkd.cmdBindPipeline(cmdBuffer, bindPoint, *normalPipeline);
}

// Conditional rendering state must match between preprocess and execute.
beginConditionalRendering(ctx.vkd, cmdBuffer, *conditionBuffer, params.inverted);
ctx.vkd.cmdExecuteGeneratedCommandsNV(cmdBuffer, VK_TRUE, &cmdsInfo);
ctx.vkd.cmdEndConditionalRenderingEXT(cmdBuffer);

endCommandBuffer(ctx.vkd, cmdBuffer);
submitCommandsAndWait(ctx.vkd, ctx.device, queue, cmdBuffer);

Expand All @@ -594,8 +598,9 @@ tcu::TestStatus conditionalPreprocessRun(Context &context, ConditionalPreprocess
invalidateAlloc(ctx.vkd, ctx.device, outputBufferAlloc);
deMemcpy(&outputValue, outputBufferData, sizeof(outputValue));

// In these cases, we expect conditional rendering to not affect preprocessing.
const auto expectedValue = pcValue;
// Note the expected value is a logical xor of the condition value and the inverted flag.
const auto expectedValue = ((params.conditionValue != params.inverted) ? pcValue : 0u);

if (outputValue != expectedValue)
{
std::ostringstream msg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,8 @@ tcu::TestStatus LogicOpTestInstance::verifyImage(void)
Allocator &allocator = m_context.getDefaultAllocator();
auto &log = m_context.getTestContext().getLog();

const auto result = readColorAttachment(vk, vkDevice, queue, queueFamilyIndex, allocator, m_colorImage->get(),
m_params.format, m_renderSize)
.release();
const auto result = readColorAttachment(vk, vkDevice, queue, queueFamilyIndex, allocator, m_colorImage->get(),
m_params.format, m_renderSize);
const auto resultAccess = result->getAccess();
const int iWidth = static_cast<int>(m_renderSize.x());
const int iHeight = static_cast<int>(m_renderSize.y());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3632,10 +3632,25 @@ tcu::TestStatus OutOfBoundsStrideInstance::iterate(void)
de::dataOrNull(dynamicStates), // const VkDynamicState* pDynamicStates;
};

const void *pNext = nullptr;

#ifndef CTS_USES_VULKANSC
const VkPipelineRobustnessCreateInfoEXT pipelineRobustnessCreateInfo = {
VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT, //VkStructureType sType;
nullptr, //const void *pNext;
VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT, //VkPipelineRobustnessBufferBehaviorEXT storageBuffers;
VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT, //VkPipelineRobustnessBufferBehaviorEXT uniformBuffers;
VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT, //VkPipelineRobustnessBufferBehaviorEXT vertexInputs;
VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT, //VkPipelineRobustnessImageBehaviorEXT images;
};

pNext = &pipelineRobustnessCreateInfo;
#endif // CTS_USES_VULKANSC

const auto pipeline = makeGraphicsPipeline(
vkd, device, pipelineLayout.get(), vertModule.get(), VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE,
fragModule.get(), renderPass.get(), viewports, scissors, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 0u, 0u,
&inputStateCreateInfo, nullptr, nullptr, nullptr, nullptr, &dynamicStateCreateInfo);
&inputStateCreateInfo, nullptr, nullptr, nullptr, nullptr, &dynamicStateCreateInfo, pNext);

// Command pool and buffer.
const CommandPoolWithBuffer cmd(vkd, device, qfIndex);
Expand Down

0 comments on commit c9a54ef

Please sign in to comment.