sample_resource的问题

2 views
Skip to first unread message

traits zhang

unread,
Mar 24, 2009, 3:07:18 AM3/24/09
to amd...@googlegroups.com
各位:
下面这段是cal中的一个例子。

static const CALchar* ILKernel =
"il_ps_2_0 \n"
"dcl_input_interp(linear) v0.xy__ \n"
"dcl_output_generic o0 \n"
"dcl_cb cb0[1] \n"
"dcl_resource_id(0)_type(2d,unnorm)_fmtx(float)_fmty(float)_fmtz(float)_fmtw(float)
\n"
"sample_resource(0)_sampler(0) r0, v0.xyxx \n"
"dmul o0, r0, cb0[0] \n"
"end \n";

sample_resource(0)_sampler(0) 这句中,_resource(0)是表示对第0个资源采样,
那么_sampler(0) 是什么含义,那个数字表示什么?我在手册中没找到。

此外,我绑定的内存是double的2维空间,那么采样读取到r0中的是1个double ,还
是2个double?如果是1个,那么应该是位于r0.xy?

谢谢

Xianyi


Jiawei Ou

unread,
Mar 24, 2009, 3:40:33 AM3/24/09
to amd...@googlegroups.com
CAL_FORMAT_DOUBLE_1? 这样是一个double,放在xy。
CAL_FORMAT_DOUBLE_2是两个double,放在xyzw。

Jiawei OU, School of Software Engineering, Tongji University

程宏路

unread,
Mar 24, 2009, 9:45:27 AM3/24/09
to amd...@googlegroups.com
sample_resource(0)_sampler(0)
第一个 sample是采样指令 resource0 是采样的位置 sampler(0) 是一种采样规则 这个应该是定义好在cal里面的就是按二维坐标来采样得
似乎可以定义别的采样规则具体怎样就不知晓了
Reply all
Reply to author
Forward
0 new messages