Commit 92070e8f by Ben Clayton

Add new debug macro UNSUPPORTED().

Plumb this into regres. Bug: b/131243109 Change-Id: Ie82cab71aca0e6b1648852dad8f4a0acd0856e70 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/29928Tested-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 970e4f0d
...@@ -89,11 +89,22 @@ namespace vk ...@@ -89,11 +89,22 @@ namespace vk
DABORT("ASSERT(%s)\n", #expression); \ DABORT("ASSERT(%s)\n", #expression); \
} } while(0) } } while(0)
// A macro to indicate unimplemented functionality. // A macro to indicate functionality currently unimplemented for a feature
// advertised as supported. For unsupported features not advertised as supported
// use UNSUPPORTED().
#undef UNIMPLEMENTED #undef UNIMPLEMENTED
#define UNIMPLEMENTED(format, ...) DABORT("UNIMPLEMENTED: " format, ##__VA_ARGS__) #define UNIMPLEMENTED(format, ...) DABORT("UNIMPLEMENTED: " format, ##__VA_ARGS__)
// A macro for code which is not expected to be reached under valid assumptions. // A macro to indicate unsupported functionality.
// This should be called when a Vulkan / SPIR-V feature is attempted to be used,
// but is not currently implemented by SwiftShader.
// Note that in a well-behaved application these should not be reached as the
// application should be respecting the advertised features / limits.
#undef UNSUPPORTED
#define UNSUPPORTED(format, ...) DABORT("UNSUPPORTED: " format, ##__VA_ARGS__)
// A macro for code which should never be reached, even with misbehaving
// applications.
#undef UNREACHABLE #undef UNREACHABLE
#define UNREACHABLE(format, ...) DABORT("UNREACHABLE: " format, ##__VA_ARGS__) #define UNREACHABLE(format, ...) DABORT("UNREACHABLE: " format, ##__VA_ARGS__)
......
...@@ -1035,6 +1035,7 @@ func compare(old, new *CommitTestResults) string { ...@@ -1035,6 +1035,7 @@ func compare(old, new *CommitTestResults) string {
{" Fail", testlist.Fail}, {" Fail", testlist.Fail},
{" Timeout", testlist.Timeout}, {" Timeout", testlist.Timeout},
{" UNIMPLEMENTED()", testlist.Unimplemented}, {" UNIMPLEMENTED()", testlist.Unimplemented},
{" UNSUPPORTED()", testlist.Unsupported},
{" UNREACHABLE()", testlist.Unreachable}, {" UNREACHABLE()", testlist.Unreachable},
{" ASSERT()", testlist.Assert}, {" ASSERT()", testlist.Assert},
{" ABORT()", testlist.Abort}, {" ABORT()", testlist.Abort},
...@@ -1118,6 +1119,8 @@ var ( ...@@ -1118,6 +1119,8 @@ var (
deqpRE = regexp.MustCompile(`(Fail|Pass|NotSupported|CompatibilityWarning|QualityWarning) \(([^\)]*)\)`) deqpRE = regexp.MustCompile(`(Fail|Pass|NotSupported|CompatibilityWarning|QualityWarning) \(([^\)]*)\)`)
// Regular expression to parse a test that failed due to UNIMPLEMENTED() // Regular expression to parse a test that failed due to UNIMPLEMENTED()
unimplementedRE = regexp.MustCompile(`[^\n]*UNIMPLEMENTED:[^\n]*`) unimplementedRE = regexp.MustCompile(`[^\n]*UNIMPLEMENTED:[^\n]*`)
// Regular expression to parse a test that failed due to UNSUPPORTED()
unsupportedRE = regexp.MustCompile(`[^\n]*UNSUPPORTED\([^\)]*\):[^\n]*`)
// Regular expression to parse a test that failed due to UNREACHABLE() // Regular expression to parse a test that failed due to UNREACHABLE()
unreachableRE = regexp.MustCompile(`[^\n]*UNREACHABLE:[^\n]*`) unreachableRE = regexp.MustCompile(`[^\n]*UNREACHABLE:[^\n]*`)
// Regular expression to parse a test that failed due to ASSERT() // Regular expression to parse a test that failed due to ASSERT()
...@@ -1159,6 +1162,7 @@ nextTest: ...@@ -1159,6 +1162,7 @@ nextTest:
s testlist.Status s testlist.Status
}{ }{
{unimplementedRE, testlist.Unimplemented}, {unimplementedRE, testlist.Unimplemented},
{unsupportedRE, testlist.Unsupported},
{unreachableRE, testlist.Unreachable}, {unreachableRE, testlist.Unreachable},
{assertRE, testlist.Assert}, {assertRE, testlist.Assert},
{abortRE, testlist.Abort}, {abortRE, testlist.Abort},
......
...@@ -161,6 +161,8 @@ const ( ...@@ -161,6 +161,8 @@ const (
Crash = Status("CRASH") Crash = Status("CRASH")
// Unimplemented is the status of a test that failed with UNIMPLEMENTED(). // Unimplemented is the status of a test that failed with UNIMPLEMENTED().
Unimplemented = Status("UNIMPLEMENTED") Unimplemented = Status("UNIMPLEMENTED")
// Unsupported is the status of a test that failed with UNSUPPORTED().
Unsupported = Status("UNSUPPORTED")
// Unreachable is the status of a test that failed with UNREACHABLE(). // Unreachable is the status of a test that failed with UNREACHABLE().
Unreachable = Status("UNREACHABLE") Unreachable = Status("UNREACHABLE")
// Assert is the status of a test that failed with ASSERT() or ASSERT_MSG(). // Assert is the status of a test that failed with ASSERT() or ASSERT_MSG().
...@@ -182,6 +184,7 @@ var Statuses = []Status{ ...@@ -182,6 +184,7 @@ var Statuses = []Status{
Timeout, Timeout,
Crash, Crash,
Unimplemented, Unimplemented,
Unsupported,
Unreachable, Unreachable,
Assert, Assert,
Abort, Abort,
...@@ -195,6 +198,11 @@ func (s Status) Failing() bool { ...@@ -195,6 +198,11 @@ func (s Status) Failing() bool {
switch s { switch s {
case Fail, Timeout, Crash, Unimplemented, Unreachable, Assert: case Fail, Timeout, Crash, Unimplemented, Unreachable, Assert:
return true return true
case Unsupported:
// This may seem surprising that this should be a failure, however these
// should not be reached, as dEQP should not be using features that are
// not advertised.
return true
default: default:
return false return false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment