Changeset 245759 in webkit
- Timestamp:
- May 24, 2019, 4:38:18 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webgpu/whlsl-arbitrary-vertex-attribute-locations-expected.html (added)
-
LayoutTests/webgpu/whlsl-arbitrary-vertex-attribute-locations.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h (modified) (1 diff)
-
Source/WebCore/Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245751 r245759 1 2019-05-24 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [WHLSL] Allow vertex attributes to have arbitrary names in the shader 4 https://bugs.webkit.org/show_bug.cgi?id=198235 5 6 Reviewed by Dean Jackson and Justin Fan. 7 8 * webgpu/whlsl-arbitrary-vertex-attribute-locations-expected.html: Added. 9 * webgpu/whlsl-arbitrary-vertex-attribute-locations.html: Added. 10 1 11 2019-05-24 Shawn Roberts <sroberts@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r245753 r245759 1 2019-05-24 Myles C. Maxfield <mmaxfield@apple.com> 2 3 [WHLSL] Allow vertex attributes to have arbitrary names in the shader 4 https://bugs.webkit.org/show_bug.cgi?id=198235 5 6 Reviewed by Dean Jackson and Justin Fan. 7 8 Metal doesn't allow arbitrary vertex attribute IDs. If you try to create a vertex attribute > 16, 9 the Metal validation layer will assert. So, we need to have a mapping from whatever the WebGPU 10 API says the vertex attribute IDs should be to the internally-used vertex attribute IDs. 11 12 Test: webgpu/whlsl-arbitrary-vertex-attribute-locations.html 13 14 * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: 15 (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): 16 * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: 17 * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: 18 (WebCore::WHLSL::matchVertexAttributes): 19 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: 20 (WebCore::convertRenderPipelineDescriptor): 21 (WebCore::trySetInputStateForPipelineDescriptor): 22 1 23 2019-05-24 Timothy Hatcher <timothy@apple.com> 2 24 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp
r245680 r245759 284 284 namedStageIn.indexInEntryPointItems = keyValuePair.value; 285 285 namedStageIn.elementName = m_typeNamer.generateNextStructureElementName(); 286 namedStageIn.attributeIndex = keyValuePair.key-> name;286 namedStageIn.attributeIndex = keyValuePair.key->metalLocation; 287 287 m_namedStageIns.uncheckedAppend(WTFMove(namedStageIn)); 288 288 } -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h
r245680 r245759 45 45 struct VertexAttribute { 46 46 VertexFormat vertexFormat; 47 unsigned name; 47 unsigned shaderLocation; 48 unsigned metalLocation; 48 49 }; 49 50 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp
r243091 r245759 165 165 continue; 166 166 auto& stageInOutSemantic = WTF::get<AST::StageInOutSemantic>(semantic); 167 if (stageInOutSemantic.index() != vertexAttribute. name)167 if (stageInOutSemantic.index() != vertexAttribute.shaderLocation) 168 168 continue; 169 169 if (!isAcceptableFormat(vertexAttribute.vertexFormat, *item.unnamedType, intrinsics)) -
trunk/Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm
r245680 r245759 182 182 183 183 for (size_t i = 0; i < descriptor.inputState.attributes.size(); ++i) 184 whlslDescriptor.vertexAttributes.append({ convertVertexFormat(descriptor.inputState.attributes[i].format), static_cast<unsigned>(i) });184 whlslDescriptor.vertexAttributes.append({ convertVertexFormat(descriptor.inputState.attributes[i].format), descriptor.inputState.attributes[i].shaderLocation, static_cast<unsigned>(i) }); 185 185 186 186 for (size_t i = 0; i < descriptor.colorStates.size(); ++i) { … … 338 338 339 339 for (size_t i = 0; i < attributes.size(); ++i) { 340 auto location = attributes[i].shaderLocation;340 auto location = static_cast<unsigned>(i); 341 341 // Maximum number of vertex attributes to be supported by Web GPU. 342 342 if (location >= 16) {
Note:
See TracChangeset
for help on using the changeset viewer.