cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

nishihei
Journeyman III

Problem (Bug?) with Function Call with Constant Buffer

I cannot compile the attached brook+ code. The error message is following:

WARNING: ASSERT(GetResultSymbol().IsValid() + mDataTypeValue.IsValid() >= 1) failed
While processing <buffer>:182
In compiler at AST::DelayedLookup::ResolveSymbols()[astdelayedlookup.cpp:139]
  *mName = __gatherStreamShape_b
Message: unknown symbol

WARNING: ASSERT(GetResultSymbol().IsValid() + mDataTypeValue.IsValid() >= 1) failed
While processing <buffer>:182
In compiler at AST::DelayedLookup::ResolveSymbols()[astdelayedlookup.cpp:139]
  *mName = __gatherBufferShape_b
Message: unknown symbol

ERROR: ASSERT(errorCount==0) failed
While processing <buffer>:199
In compiler at AST::Root::CompileShaderToStream()[astroot.cpp:157]
  errorCount = 2
Message: Unknown Symbols exist
Aborting...
Problem with compiling C:\Users\nishihei\AppData\Local\Temp\brc1DE4.tmp\Temp_bad_addr.hlsl
Error--:cal back end failed to compile kernel "bad"

This problem happens when a program calls a function with a constant buffer parameter. How can I do in order to avoid this problem?

kernel float4 inner(float4 b[1], float i) { return b; } kernel void bad(out float4 a<>, float4 b[1]) { a = inner(b, indexof(a).x); }

0 Likes
2 Replies
the729
Journeyman III

Hi

Not sure if brook+ supports using pointers (or arrays) as function parameters. Do you see any working examples of that? If not, probably it is not supported at all.

 

0 Likes

Hello, the729.

 

When I use non-constant arrays such as the attached code, the compilation succeeds. And when constantnesses of the caller and the callee are different, the following error happens:

Line (10) : ERROR--1: Problem with call expression in kernel: Mismatched resource type of gather array for argument 0

    Statement: inner(b, (indexof(a)).x) in a = inner(b, (indexof(a)).x)

***Semantic check found 1 errors

kernel float4 inner(float4 b[], float i) { return b; } kernel void bad(out float4 a<>, float4 b[]) { a = inner(b, indexof(a).x); }

0 Likes