WebKit Bugzilla
Attachment 370595 Details for
Bug 198235
: [WHLSL] Allow vertex attributes to have arbitrary names in the shader
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
bug-198235-20190524152717.patch (text/plain), 4.61 KB, created by
Myles C. Maxfield
on 2019-05-24 15:27:18 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2019-05-24 15:27:18 PDT
Size:
4.61 KB
patch
obsolete
>Subversion Revision: 245751 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 572b81f7e6e7e17c52c71e8ba9c38fe7d763630e..f17486adf4a9e1aecb1c4d4e236253bb02cb58b0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2019-05-24 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [WHLSL] Allow vertex attributes to have arbitrary names in the shader >+ https://bugs.webkit.org/show_bug.cgi?id=198235 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: >+ (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): >+ * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: >+ * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: >+ (WebCore::WHLSL::matchVertexAttributes): >+ * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: >+ (WebCore::convertRenderPipelineDescriptor): >+ > 2019-05-24 Youenn Fablet <youenn@apple.com> > > Make sure completion handler is always called in SWServer::startSuspension >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp b/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp >index 549d5dcf1b37afca3ce6811c45f3c9c4aba72266..21974eb87d652ab453adee4c20dbcd1ac14c6870 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp >@@ -283,7 +283,7 @@ VertexEntryPointScaffolding::VertexEntryPointScaffolding(AST::FunctionDefinition > NamedStageIn namedStageIn; > namedStageIn.indexInEntryPointItems = keyValuePair.value; > namedStageIn.elementName = m_typeNamer.generateNextStructureElementName(); >- namedStageIn.attributeIndex = keyValuePair.key->name; >+ namedStageIn.attributeIndex = keyValuePair.key->metalLocation; > m_namedStageIns.uncheckedAppend(WTFMove(namedStageIn)); > } > >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h >index 5bb666591937454b8eb0c38a37dd2b9ebc2093aa..f8f1745d3f2279c8a43cfef0b572d6468aef07c3 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h >@@ -44,7 +44,8 @@ enum class VertexFormat : uint8_t { > > struct VertexAttribute { > VertexFormat vertexFormat; >- unsigned name; >+ unsigned shaderLocation; >+ unsigned metalLocation; > }; > > using VertexAttributes = Vector<VertexAttribute>; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp >index f6145677763e920fc8108a56f54daff5774a35b0..7a551bf28028626e0a9fd00e82823518a36fbb8e 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp >@@ -164,7 +164,7 @@ static Optional<HashMap<VertexAttribute*, size_t>> matchVertexAttributes(Vector< > if (!WTF::holds_alternative<AST::StageInOutSemantic>(semantic)) > continue; > auto& stageInOutSemantic = WTF::get<AST::StageInOutSemantic>(semantic); >- if (stageInOutSemantic.index() != vertexAttribute.name) >+ if (stageInOutSemantic.index() != vertexAttribute.shaderLocation) > continue; > if (!isAcceptableFormat(vertexAttribute.vertexFormat, *item.unnamedType, intrinsics)) > return WTF::nullopt; >diff --git a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm >index e0292b8f544d4eacdba179fc0b234e4ec3aa73fd..4b93a2e42654967705b2539253e730d7f0c0b4fe 100644 >--- a/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm >+++ b/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm >@@ -181,7 +181,7 @@ static Optional<WHLSL::RenderPipelineDescriptor> convertRenderPipelineDescriptor > return WTF::nullopt; > > for (size_t i = 0; i < descriptor.inputState.attributes.size(); ++i) >- whlslDescriptor.vertexAttributes.append({ convertVertexFormat(descriptor.inputState.attributes[i].format), static_cast<unsigned>(i) }); >+ whlslDescriptor.vertexAttributes.append({ convertVertexFormat(descriptor.inputState.attributes[i].format), descriptor.inputState.attributes[i].shaderLocation, static_cast<unsigned>(i) }); > > for (size_t i = 0; i < descriptor.colorStates.size(); ++i) { > if (auto format = convertTextureFormat(descriptor.colorStates[i].format))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198235
:
370595
|
370599