Villacaleb / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

No way to set an int2,int3,int4 effect variable? #833

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Maybe I am missing something, but EffectVectorVariable.Set(int[] value); does 
not appear to work as intended.

I havnt investigated this in depth, I have just switched to a float vector 
instead, since performance was not critical.

Original issue reported on code.google.com by dbl...@fastmail.fm on 12 Sep 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Set(int[]) calls SetIntVectorArray, which sets an array of four-component 
vectors containing integer data. This bug isn't clear enough to be actionable.

Original comment by josh.petrie on 16 Sep 2011 at 3:07

GoogleCodeExporter commented 9 years ago
I think the problem here is that we don't ever expose SetIntVector or 
SetBoolVector, only the array variants. If you have a non-array variable for 
one of those two, can you still set it using the *Array method?

Original comment by Mike.Popoloski on 16 Sep 2011 at 3:37

GoogleCodeExporter commented 9 years ago
Even if using the *Array method is possible(I have a feeling I tried all the 
overloads) then this is far from ideal, since it leads to garbage and/or 
convoluted code. 

Much better would be a minimal IntVector* struct and a Set() method to take 
this. Alternativly Set(int x, int y, int z) would work.

I would think this is quite a common op, and will become more common, for 
example setting sizes, offsets etc for shaders.

Original comment by dbl...@fastmail.fm on 16 Sep 2011 at 11:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm still not sure what you are referring to as being less than ideal; the 
limitation that the array must be a multiple of four comes from D3D, though. 
It's something we can do anything about. If, on the other hand, it's just the 
fact that the non-array overloads are missing, we can fix that.

Original comment by josh.petrie on 17 Sep 2011 at 7:08

GoogleCodeExporter commented 9 years ago
Yeah, there's no way to set less than four elements, even with the non-array 
version. I assume the extra elements are just ignored for variables of smaller 
size.

Anyway, adding the overloads should be easy enough.

Original comment by Mike.Popoloski on 17 Sep 2011 at 7:44

GoogleCodeExporter commented 9 years ago
Yeah I meant overloads which dont require any memory allocation during or 
before the call.

Not sure what you are refering to wrt multiple of 4(needing to pass all 
elements of the vector register to D3D)? In any case, it would probably be 
fairly easy to construct a buffer with padding...

Original comment by dbl...@fastmail.fm on 17 Sep 2011 at 8:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2153.

Original comment by Mike.Popoloski on 15 Nov 2011 at 5:06