x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Material Dot product error on Mac with Metal

I'm using the Dot product node in a material but receive the following error on a Mac:

Error [SM4] ../../../Engine/Intermediate/ShaderIn7A8D346B4A4515152116A5ADFC94D605.metal(0): ../../../Engine/Intermediate/ShaderIn7A8D346B4A4515152116A5ADFC94D605.metal:273:8: error: call to 'dot' is ambiguous f15 = dot(f14,v13.z); ^~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:14:18: note: candidate function METAL_ASM half dot(vec x, vec y) __asm("air.dot.v2f16"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:54:18: note: candidate function METAL_ASM half dot(vec x, vec y) __asm("air.dot.v3f16"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:94:18: note: candidate function METAL_ASM half dot(vec x, vec y) __asm("air.dot.v4f16"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:142:19: note: candidate function METAL_ASM float dot(vec x, vec y) __asm("air.dot.v2f32"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:257:19: note: candidate function METAL_ASM float dot(vec x, vec y) __asm("air.dot.v3f32"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:372:19: note: candidate function METAL_ASM float dot(vec x, vec y) __asm("air.dot.v4f32"); ^ ../../../Engine/Intermediate/ShaderIn7A8D346B4A4515152116A5ADFC94D605.metal:307:8: error: call to 'dot' is ambiguous f29 = dot(f28,v27.z); ^~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:14:18: note: candidate function METAL_ASM half dot(vec x, vec y) __asm("air.dot.v2f16"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:54:18: note: candidate function METAL_ASM half dot(vec x, vec y) __asm("air.dot.v3f16"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:94:18: note: candidate function METAL_ASM half dot(vec x, vec y) __asm("air.dot.v4f16"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:142:19: note: candidate function METAL_ASM float dot(vec x, vec y) __asm("air.dot.v2f32"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:257:19: note: candidate function METAL_ASM float dot(vec x, vec y) __asm("air.dot.v3f32"); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin/../lib/clang/3.5/include/metal/metal_geometric:372:19: note: candidate function METAL_ASM float dot(vec x, vec y) __asm("air.dot.v4f32"); ^ 2 errors generated.

Product Version: UE 4.12
Tags:
more ▼

asked Jul 12 '16 at 08:54 AM in Rendering

avatar image

DannRees
245 18 28 40

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You've found an inconsistency here between the material's generated HLSL and the resulting Metal shader we generate from it: you are passing scalar floats into the dot product intrinsic but in Metal that intrinsic only accepts vectors.

You'll need to use a 'multiply' op in your material when the input values are floats to avoid this (at least for now).

more ▼

answered Jul 12 '16 at 02:24 PM

avatar image

marksatt-pitbull STAFF
1k 31 4 44

avatar image DannRees Jul 12 '16 at 05:10 PM

Oh right. Thanks, I'll try that!

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question