texture/sampler array support?
- kingeric1992
- Topic Author
Less
More
11 years 1 month ago - 11 years 1 month ago #1
by kingeric1992
texture/sampler array support? was created by kingeric1992
just wondering... and proper syntax?
Last edit: 11 years 1 month ago by kingeric1992.
Please Log in or Create an account to join the conversation.
- crosire
Less
More
As in
or in
?
Code:
sampler mySamplers[50];
Code:
samplerArray mySamplers;
The following user(s) said Thank You: kingeric1992
Please Log in or Create an account to join the conversation.
- kingeric1992
- Topic Author
Less
More
11 years 1 month ago - 11 years 1 month ago #3
by kingeric1992
Replied by kingeric1992 on topic texture/sampler array support?
I'm thinking the first one. but I suppose that wouldn't matters at all without branching by the index.
anyway, how about array = array ?
I can construct a function that returns a array of float2 like this
but unable to retrieve it later with
and report: error X3013: no matching function overload for 'test'
anyway, how about array = array ?
I can construct a function that returns a array of float2 like this
Code:
void test (out float2 a[8], float2 b[8])
{
a[0] = b[0];
a[1] = b[1];
...
a[7] = b[7];
};
Code:
float2 r[8] = {float2(0,0), float2(1,1), ....float2(7,7)};
r = test(r);
Last edit: 11 years 1 month ago by kingeric1992.
Please Log in or Create an account to join the conversation.
- crosire
Less
More
Should be:kingeric1992 wrote: but unable to retrieve it later with
and report: error X3013: no matching function overload for 'test'Code:float2 r[8] = {float2(0,0), float2(1,1), ....float2(7,7)}; r = test(r);
Code:
float2 a[8] = { ... };
float2 b[8] = { ... };
test(a, b);
Samplers arrays are a similar story. They would only be possible if the array index is known at compile time:
Code:
sampler samplers[5];
tex2D(samplers[2], ...);
Code:
sampler samplers[5];
int i = ...;
tex2D(samplers[i], ...);
Please Log in or Create an account to join the conversation.
- kingeric1992
- Topic Author
Less
More
11 years 1 month ago #5
by kingeric1992
Replied by kingeric1992 on topic texture/sampler array support?
Thanks, that works.
sadly the result is not as expected...as expected.
more debugging then. (≧∀≦)ゞ
sadly the result is not as expected...as expected.
more debugging then. (≧∀≦)ゞ
Please Log in or Create an account to join the conversation.