HLSL: add .mips[][] operator for texture types
This implements mytex.mips[mip][coord] for texture types. There is some error testing, but not comprehensive. The constructs can be nested, e.g in this case the inner .mips is parsed before the completion of the outer [][] operator. tx.mips[tx.mips[a][b].x][c]
This commit is contained in:
parent
c70bbc831c
commit
726bf96a72
10 changed files with 446 additions and 11 deletions
14
Test/hlsl.mip.operator.frag
Normal file
14
Test/hlsl.mip.operator.frag
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Texture2DArray g_tTex2df4a;
|
||||
Texture2D g_tTex2df4;
|
||||
|
||||
float4 main() : SV_Target0
|
||||
{
|
||||
return g_tTex2df4.mips[2][uint2(3, 4)] +
|
||||
|
||||
// test float->uint cast on the mip arg
|
||||
g_tTex2df4a.mips[5.2][uint3(6, 7, 8)] +
|
||||
|
||||
// Test nesting involving .mips operators:
|
||||
// ....outer operator mip level...... .....outer operator coordinate....
|
||||
g_tTex2df4.mips[ g_tTex2df4.mips[9][uint2(10,11)][0] ][ g_tTex2df4.mips[13][uint2(14,15)].xy ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue