mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 06:08:30 +09:00
[Test] (DirectVulkan): ask each unbound-descriptor case only for the limit its own resource kind needs
This commit is contained in:
@@ -187,16 +187,16 @@ void main() {
|
|||||||
glViewport(0, 0, Gl().Width(), Gl().Height());
|
glViewport(0, 0, Gl().Width(), Gl().Height());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Every case needs image or buffer-texture uniforms in a particular stage, and a host
|
// Each case needs exactly one kind of opaque uniform in one stage, and a host with
|
||||||
// that has none of them would report a failure that is about the host, not the fix.
|
// none of that kind there would report a failure that is about the host, not the fix.
|
||||||
bool StageSupports(GLenum imageUniformLimit, GLenum textureImageUnitLimit) const {
|
// Asked for by the limit that governs the kind under test and no other: a guard that
|
||||||
GLint images = 0;
|
// over-asks turns into a silent skip of the very thing the case exists for.
|
||||||
GLint units = 0;
|
static bool LimitIsAtLeastOne(GLenum limit) {
|
||||||
glGetIntegerv(imageUniformLimit, &images);
|
GLint value = 0;
|
||||||
glGetIntegerv(textureImageUnitLimit, &units);
|
glGetIntegerv(limit, &value);
|
||||||
while (glGetError() != GL_NO_ERROR) {
|
while (glGetError() != GL_NO_ERROR) {
|
||||||
}
|
}
|
||||||
return images >= 1 && units >= 1;
|
return value >= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int MakeComputeProgram(const char* source) {
|
unsigned int MakeComputeProgram(const char* source) {
|
||||||
@@ -302,7 +302,7 @@ void main() {
|
|||||||
|
|
||||||
TEST_F(UnboundImageDescriptorScenario, ADeclaredButUnboundSamplerBufferDoesNotLoseTheDispatch) {
|
TEST_F(UnboundImageDescriptorScenario, ADeclaredButUnboundSamplerBufferDoesNotLoseTheDispatch) {
|
||||||
if (!Ready() || IsSkipped()) return;
|
if (!Ready() || IsSkipped()) return;
|
||||||
if (!StageSupports(GL_MAX_COMPUTE_IMAGE_UNIFORMS, GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS)) {
|
if (!LimitIsAtLeastOne(GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS)) {
|
||||||
GTEST_SKIP() << "the compute stage has no texture image units";
|
GTEST_SKIP() << "the compute stage has no texture image units";
|
||||||
}
|
}
|
||||||
ExpectDispatchStillRuns(kSamplerBufferComputeSource, "samplerBuffer");
|
ExpectDispatchStillRuns(kSamplerBufferComputeSource, "samplerBuffer");
|
||||||
@@ -337,7 +337,7 @@ void main() {
|
|||||||
|
|
||||||
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImageBufferLeftUnboundDoesNotLoseTheDispatch) {
|
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImageBufferLeftUnboundDoesNotLoseTheDispatch) {
|
||||||
if (!Ready() || IsSkipped()) return;
|
if (!Ready() || IsSkipped()) return;
|
||||||
if (!StageSupports(GL_MAX_COMPUTE_IMAGE_UNIFORMS, GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS)) {
|
if (!LimitIsAtLeastOne(GL_MAX_COMPUTE_IMAGE_UNIFORMS)) {
|
||||||
GTEST_SKIP() << "the compute stage has no image uniforms";
|
GTEST_SKIP() << "the compute stage has no image uniforms";
|
||||||
}
|
}
|
||||||
ExpectDispatchStillRuns(kImageBufferComputeSource, "imageBuffer");
|
ExpectDispatchStillRuns(kImageBufferComputeSource, "imageBuffer");
|
||||||
@@ -345,7 +345,7 @@ void main() {
|
|||||||
|
|
||||||
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImageBufferLeftUnboundDoesNotLoseTheDraw) {
|
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImageBufferLeftUnboundDoesNotLoseTheDraw) {
|
||||||
if (!Ready() || IsSkipped()) return;
|
if (!Ready() || IsSkipped()) return;
|
||||||
if (!StageSupports(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, GL_MAX_TEXTURE_IMAGE_UNITS)) {
|
if (!LimitIsAtLeastOne(GL_MAX_FRAGMENT_IMAGE_UNIFORMS)) {
|
||||||
GTEST_SKIP() << "the fragment stage has no image uniforms";
|
GTEST_SKIP() << "the fragment stage has no image uniforms";
|
||||||
}
|
}
|
||||||
ExpectDrawStillRuns(kImageBufferFragmentSource, "imageBuffer");
|
ExpectDrawStillRuns(kImageBufferFragmentSource, "imageBuffer");
|
||||||
@@ -355,7 +355,7 @@ void main() {
|
|||||||
|
|
||||||
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImage2DLeftUnboundDoesNotLoseTheDispatch) {
|
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImage2DLeftUnboundDoesNotLoseTheDispatch) {
|
||||||
if (!Ready() || IsSkipped()) return;
|
if (!Ready() || IsSkipped()) return;
|
||||||
if (!StageSupports(GL_MAX_COMPUTE_IMAGE_UNIFORMS, GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS)) {
|
if (!LimitIsAtLeastOne(GL_MAX_COMPUTE_IMAGE_UNIFORMS)) {
|
||||||
GTEST_SKIP() << "the compute stage has no image uniforms";
|
GTEST_SKIP() << "the compute stage has no image uniforms";
|
||||||
}
|
}
|
||||||
ExpectDispatchStillRuns(kImage2DComputeSource, "image2D");
|
ExpectDispatchStillRuns(kImage2DComputeSource, "image2D");
|
||||||
@@ -363,7 +363,7 @@ void main() {
|
|||||||
|
|
||||||
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImage2DLeftUnboundDoesNotLoseTheDraw) {
|
TEST_F(UnboundImageDescriptorScenario, AWriteonlyImage2DLeftUnboundDoesNotLoseTheDraw) {
|
||||||
if (!Ready() || IsSkipped()) return;
|
if (!Ready() || IsSkipped()) return;
|
||||||
if (!StageSupports(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, GL_MAX_TEXTURE_IMAGE_UNITS)) {
|
if (!LimitIsAtLeastOne(GL_MAX_FRAGMENT_IMAGE_UNIFORMS)) {
|
||||||
GTEST_SKIP() << "the fragment stage has no image uniforms";
|
GTEST_SKIP() << "the fragment stage has no image uniforms";
|
||||||
}
|
}
|
||||||
ExpectDrawStillRuns(kImage2DFragmentSource, "image2D");
|
ExpectDrawStillRuns(kImage2DFragmentSource, "image2D");
|
||||||
@@ -371,7 +371,7 @@ void main() {
|
|||||||
|
|
||||||
TEST_F(UnboundImageDescriptorScenario, AFormatlessWriteonlyImage2DLeftUnboundDoesNotLoseTheDispatch) {
|
TEST_F(UnboundImageDescriptorScenario, AFormatlessWriteonlyImage2DLeftUnboundDoesNotLoseTheDispatch) {
|
||||||
if (!Ready() || IsSkipped()) return;
|
if (!Ready() || IsSkipped()) return;
|
||||||
if (!StageSupports(GL_MAX_COMPUTE_IMAGE_UNIFORMS, GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS)) {
|
if (!LimitIsAtLeastOne(GL_MAX_COMPUTE_IMAGE_UNIFORMS)) {
|
||||||
GTEST_SKIP() << "the compute stage has no image uniforms";
|
GTEST_SKIP() << "the compute stage has no image uniforms";
|
||||||
}
|
}
|
||||||
ExpectDispatchStillRuns(kFormatlessImage2DComputeSource, "format-less image2D");
|
ExpectDispatchStillRuns(kFormatlessImage2DComputeSource, "format-less image2D");
|
||||||
|
|||||||
Reference in New Issue
Block a user