Ok,
I shuffed the mtf ints into the gpgpu tutorial:
I did two runs while fx composer 2.5 was slightly running as well:
First run ( 32 bit ints are at the bottom):
program started
TEXRECT - float_ARB - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 3615
ReleaseDC successfull.
program finished
program started
TEXRECT - float_ARB - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 7154
ReleaseDC successfull.
program finished
program started
tex2D - float_ARB - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 3613
ReleaseDC successfull.
program finished
program started
tex2D - float_ARB - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 7190
ReleaseDC successfull.
program finished
program started
tex2D - float_ARB - RGBA - 32 - ints
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 3477
ReleaseDC successfull.
program finished
Second run:
program started
TEXRECT - float_ARB - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 3608
ReleaseDC successfull.
program finished
program started
TEXRECT - float_ARB - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 7186
ReleaseDC successfull.
program finished
program started
tex2D - float_ARB - RGBA - 32
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 3613
ReleaseDC successfull.
program finished
program started
tex2D - float_ARB - RGBA - 16
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 7200
ReleaseDC successfull.
program finished
program started
tex2D - float_ARB - RGBA - 32 - ints
, N=16000000, numIter=200
CreateDC successfull.
CreateRenderingContext successfull.
MFLOP/s for N=16000000: 3483
ReleaseDC successfull.
program finished
The ints version does seem to be a bit slower... could be because of the
conversion... could also be because of possible overflows or so... not sure
about that.
But it doesn't seem to be too bad...
Here is example code which did work:
twod_arb_rgba_32_ints.name := 'tex2D - float_ARB - RGBA - 32 - ints';
twod_arb_rgba_32_ints.texTarget := GL_TEXTURE_2D;
twod_arb_rgba_32_ints.texInternalFormat := GL_RGBA32F_ARB;
twod_arb_rgba_32_ints.texFormat := GL_RGBA;
twod_arb_rgba_32_ints.shader_source :=
'int4 saxpy (' +
'in float2 coords: TEXCOORD0, ' +
'uniform sampler2D textureY, ' +
'uniform sampler2D textureX, ' +
'uniform int alpha ) : COLOR { ' +
'int4 y = tex2D (textureY, coords); ' +
'int4 x = tex2D (textureX, coords); ' +
'return y+alpha*x; }';
Apperently it's as easy as simple replacing the floats with ints...
However there might be only little problem... tex2D still expects floats ?!
So had to leave the "in" in float2...
Could be an indication that texture coordinates must be in 0..1 or always
are inside the shader ?
Me not sure about that.
All the other shader code looks similiar though... none of them do anything
to the texture coordinates...
Yet some are normalized and some are not... making me believe that
unnormalized text coordinates should somehow be possible ?!
Hmm...
Bye,
Skybuck.