zengqh / slimdx

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

Direct3D9: SetVertexShaderConstant(int startRegister, float[] data) #334

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the Device implementation of Direct3D9, I think there is a problem with
method SetPixelShaderConstant(int startRegister, float[] data).

This method (within Device.h) calls the SetPixelShaderConstant(int
startRegister, float[] data, int offset, int count) wrongly with count set
to zero. This should be data.Length / 4. 

The workaround by calling the latter method directly (with correct count)
seems to work.

Similar methods exist of SetVertexShaderConstant and
SetPixelShaderConstant: all 'count' parameter should not be equal to 0 when
passing an array of data. 

I am using the binary dll (version 2.0.4.38).

Original issue reported on code.google.com by kol...@gmail.com on 11 Sep 2008 at 10:41

GoogleCodeExporter commented 9 years ago
That's weird. Will fix.

Original comment by Mike.Popoloski on 11 Sep 2008 at 3:14

GoogleCodeExporter commented 9 years ago
Please don't yet, I want to take a look and make some tweaks.

Original comment by promit....@gmail.com on 11 Sep 2008 at 4:07

GoogleCodeExporter commented 9 years ago
Are you sure this is the actual problem you are having? Are you getting an 
exception
when this method is called? The reason I am asking is that these methods, when 
passed
a 0 for length, will look up the correct length automatically. So I don't think
that's a problem here.

Original comment by Mike.Popoloski on 18 Sep 2008 at 7:32

GoogleCodeExporter commented 9 years ago
Fixed, along with updated doc comments.

Original comment by promit....@gmail.com on 18 Sep 2008 at 8:55