|
|

楼主 |
发表于 2009-6-26 21:08:00
|
显示全部楼层
Re: 求教一个关于SM3 ISA中Texture Sampling指令的问题。
还有一个问题是关于Dynamic Control Flow和Derivative Operation的。众所周知,如果要对MIPMAP作Sampling操作的话,必须要求导,以便计算LOD。但是DX的硬件规范手册上有下面这样的规定。这个比较令人费解~~
(a) The following uses of sample or derivative instructions are not permitted inside varying flow control:
· sample, sample_b, or sample_c, when the texture address is a shader-computed temporary.
· deriv_rtx and deriv_rty, when the input is a shader-computed temporary.
(b) Other uses of sample or derivative instructions have no restrictions with flow control. Examples are:
· sample, sample_b, or sample_c, when the texture address is a shader input (regardless of interpolation mode) or statically indexed constant.
· deriv_rtx and deriv_rty, when the input operand is a shader input (regardless of interpolation mode) or statically indexed constant, though the latter is not useful.
· sample_l: here the application provides LOD as an operand, so no derivative calculation is required, and there is no issue with flow control.
· sample_d: here the application provides derivatives as input operands, so there is no issue with flow control.
· sample_c_lz: here the LOD is fixed at 0, so no derivative calculation is required, and there is no issue with flow control.
Regardless of the restriction above, shader authors still must ensure that before computing any derivative (or performing a texture sample that implicitly computes a derivative) where permitted, the register containing the source data must have been initialized for all execution paths beforehand. Initialization of temporary registers is not validated or enforced in general.
我依稀感觉这是个是为硬件简化,但是从硬件设计角度来看,并没有看到这个特性能为减小我们的HW复杂度提供什么帮助。不知道在SW上有什么玄妙之处? |
|