렌더의 모든 셀을 렌더러의 다른 할당으로 복사하려고했습니다. 로이드 현상 API 참조에서 이런 방법 그의 서명지원되지 않는 메소드 호출 rsAllocationCopy1DRange in android.support.v8.renderscript
공극 rsAllocationCopy1DRange이다 (rs_allocation의 dstAlloc가 dstOff uint32_t, dstMip uint32_t, srcMip uint32_t, srcOff uint32_t, rs_allocation의 srcAlloc 카운트 uint32_t) rsAllocationCopy1DRange을 얻었다;
.
방법에 대한 구글의 참조 링크는 https://developer.android.com/guide/topics/renderscript/reference/rs_allocation_data.html
하지만 난이 스크립트를 실행할 때 그것은
내 RS 스크립트
이하 android.support.v8.renderscript 오류가 지원되지 않는 방법 rsAllocationCopy1DRange에 전화를 보여줍니다#pragma version(1)
#pragma rs java_package_name(com.ravikant.rs)
#pragma rs_fp_relaxed
int width;
int height;
rs_allocation stateArr;
rs_allocation stateNextArr;
void __attribute__((kernel)) _copy(int32_t in)
{
int len=width*height;
rsAllocationCopy1DRange(stateArr,0,0,len,stateNextArr,0,0);
}
및 자바 코드는
float[] sideArr=new float[width*height};
Arrays.fill(sideArr,1);
Allocation stateArrAlloc = Allocation.createSized(rs, Element.F32(rs), sideArr.length);
Allocation stateNextArrAlloc = Allocation.createSized(rs, Element.F32(rs), sideArr.length);
stateArrAlloc.copyFrom(sideArr);
stateNextArrAlloc.copyFrom(sideArr);
scriptC_copycells.set_width(width);
scriptC_copycells.set_height(height);
scriptC_copycells.set_stateArr(stateArrAlloc);
scriptC_copycells.set_stateNextArr(stateNextArrAlloc);
scriptC_copycells.forEach__copy(stateArrAlloc);
,536,913,632입니다 10 오류에 대한 로그캣 출력은
E/AndroidRuntime: FATAL EXCEPTION: RSMessageThread
Process: com.ravikant.rs, PID: 2321
android.support.v8.renderscript.RSRuntimeException: Fatal error 4097,
details: Error: Call to unsupported function rsAllocationCopy1DRange in kernel at android.support.v8.renderscript.RenderScript$MessageThread.run(RenderScript.java:1313)
해결 방법이 있습니까? 나도 같은 문제에 직면 해있다. –