Title: [239854] trunk/Source/WebCore
Revision
239854
Author
mmaxfi...@apple.com
Date
2019-01-10 19:54:43 -0800 (Thu, 10 Jan 2019)

Log Message

Fix the build after r239844
https://bugs.webkit.org/show_bug.cgi?id=192991

Unreviewed.

* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (239853 => 239854)


--- trunk/Source/WebCore/ChangeLog	2019-01-11 02:12:57 UTC (rev 239853)
+++ trunk/Source/WebCore/ChangeLog	2019-01-11 03:54:43 UTC (rev 239854)
@@ -1,3 +1,23 @@
+2019-01-10  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Fix the build after r239844
+        https://bugs.webkit.org/show_bug.cgi?id=192991
+
+        Unreviewed.
+
+        * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
+        (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
+        (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
+        * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
+        (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
+        (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
+        * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
+        (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
+        (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
+        * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
+        (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
+        (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
+
 2019-01-10  Justin Fan  <justin_...@apple.com>
 
         [WebGPU] WebGPUBindGroup and device::createBindGroup prototype

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp (239853 => 239854)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp	2019-01-11 02:12:57 UTC (rev 239853)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp	2019-01-11 03:54:43 UTC (rev 239854)
@@ -37,6 +37,74 @@
 
 namespace AST {
 
+bool BuiltInSemantic::isAcceptableType(const UnnamedType&, const Intrinsics&) const
+{
+    // FIXME: Implement this
+    return true;
+}
+
+bool BuiltInSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition& functionDefinition) const
+{
+    switch (*functionDefinition.entryPointType()) {
+    case FunctionDeclaration::EntryPointType::Vertex:
+        switch (direction) {
+        case ShaderItemDirection::Input:
+            switch (m_variable) {
+            case Variable::SVInstanceID:
+            case Variable::SVVertexID:
+                return true;
+            default:
+                return false;
+            }
+        case ShaderItemDirection::Output:
+            switch (m_variable) {
+            case Variable::PSize:
+            case Variable::SVPosition:
+                return true;
+            default:
+                return false;
+            }
+        }
+    case FunctionDeclaration::EntryPointType::Fragment:
+        switch (direction) {
+        case ShaderItemDirection::Input:
+            switch (m_variable) {
+            case Variable::SVIsFrontFace:
+            case Variable::SVPosition:
+            case Variable::SVSampleIndex:
+            case Variable::SVInnerCoverage:
+                return true;
+            default:
+                return false;
+            }
+        case ShaderItemDirection::Output:
+            switch (m_variable) {
+            case Variable::SVTarget:
+            case Variable::SVDepth:
+            case Variable::SVCoverage:
+                return true;
+            default:
+                return false;
+            }
+        }
+    case FunctionDeclaration::EntryPointType::Compute:
+        switch (direction) {
+        case ShaderItemDirection::Input:
+            switch (m_variable) {
+            case Variable::SVDispatchThreadID:
+            case Variable::SVGroupID:
+            case Variable::SVGroupIndex:
+            case Variable::SVGroupThreadID:
+                return true;
+            default:
+                return false;
+            }
+        case ShaderItemDirection::Output:
+            return false;
+        }
+    }
+}
+
 } // namespace AST
 
 }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp (239853 => 239854)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp	2019-01-11 02:12:57 UTC (rev 239853)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp	2019-01-11 03:54:43 UTC (rev 239854)
@@ -38,6 +38,17 @@
 
 namespace AST {
 
+bool ResourceSemantic::isAcceptableType(const UnnamedType&, const Intrinsics&) const
+{
+    // FIXME: Implement this
+    return true;
+}
+
+bool ResourceSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition&) const
+{
+    return direction == ShaderItemDirection::Input;
+}
+
 } // namespace AST
 
 }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp (239853 => 239854)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp	2019-01-11 02:12:57 UTC (rev 239853)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp	2019-01-11 03:54:43 UTC (rev 239854)
@@ -36,6 +36,22 @@
 
 namespace AST {
 
+bool SpecializationConstantSemantic::isAcceptableType(const UnnamedType& unnamedType, const Intrinsics&) const
+{
+    if (!is<TypeReference>(unnamedType))
+        return false;
+    auto& typeReference = downcast<TypeReference>(unnamedType);
+    ASSERT(typeReference.resolvedType());
+    if (!is<NativeTypeDeclaration>(*typeReference.resolvedType()))
+        return false;
+    return downcast<NativeTypeDeclaration>(*typeReference.resolvedType()).isNumber();
+}
+
+bool SpecializationConstantSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition&) const
+{
+    return direction == ShaderItemDirection::Input;
+}
+
 } // namespace AST
 
 }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp (239853 => 239854)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp	2019-01-11 02:12:57 UTC (rev 239853)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp	2019-01-11 03:54:43 UTC (rev 239854)
@@ -39,6 +39,37 @@
 
 namespace AST {
 
+bool StageInOutSemantic::isAcceptableType(const UnnamedType& unnamedType, const Intrinsics&) const
+{
+    if (is<ArrayType>(unnamedType))
+        return true;
+    if (!is<TypeReference>(unnamedType))
+        return false;
+    auto& typeReference = downcast<TypeReference>(unnamedType);
+    ASSERT(typeReference.resolvedType());
+    auto& resolvedType = *typeReference.resolvedType();
+    if (is<EnumerationDefinition>(resolvedType))
+        return true;
+    if (!is<NativeTypeDeclaration>(resolvedType))
+        return false;
+    auto& nativeTypeDeclaration = downcast<NativeTypeDeclaration>(*typeReference.resolvedType());
+    return nativeTypeDeclaration.isNumber()
+        || nativeTypeDeclaration.isVector()
+        || nativeTypeDeclaration.isMatrix();
+}
+
+bool StageInOutSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition& functionDefinition) const
+{
+    switch (*functionDefinition.entryPointType()) {
+    case FunctionDeclaration::EntryPointType::Vertex:
+        return true;
+    case FunctionDeclaration::EntryPointType::Fragment:
+        return direction == ShaderItemDirection::Input;
+    case FunctionDeclaration::EntryPointType::Compute:
+        return false;
+    }
+}
+
 } // namespace AST
 
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to