OK, I have a JPG loaded into a WPF Image (I've got a WriteableBitmap which I use as the Image.Source). This JPG is 10,000 x 5,000 pixels. I also have the ability to scale up the image to 200%, so effectively, I'm up to 20,000 x 10,000 pixels, i.e. a 200MP image. For my application, which deals with photographic scans, these sizes are not totally out of the ordinary.
Around my Image, I've got 10 Grids, each of which have an Effect applied. The Effects are compiled as PS 3.0, so should run on the GPU. However, I also have one Effect compiled as PS 2.0, so can only run in software.
Simple thing is, with a 200MP image, my program pretty much stops, it's so slow as to be unusable. The funny thing is, the GPU Effects don't really seem to be any faster than the CPU Effect. I upgraded from my Intel HD 4600 GPU to a GeForce GTX 750 to see if that would help, but again, not really appreciably faster.
The GTX 750 rates about 5 times faster than the Intel 4600 for pixel shading, so I seem to be missing something somewhere.
My CPU is Core i5 4570 @ 3.2GHz. I get that maybe a software shader would run faster on this than on a low-end graphics card, but I'd have thought the GTX 750 should at least be very noticeably faster than the Intel HD 4600.
My GTX 750 has 2GB memory, so can hold a pretty big image in graphics memory, and looking at GPU-Z, it certainly can fill up on opening a big image.
Somewhere along the line though, I feel I'm bottlenecked somewhere. If this graphics card can apply shaders to a 1920x1080 screen 70 frames a second, I'm thinking it should be able to apply shaders to a 20,000 x 10,000 image faster than every minute?
Sorry for the long post, but I wanted to try to articulate exactly what my problem is. Am I missing something? Should I be getting more performance, despite the images being so large?
Thanks
Garry
Code:
sampler2D inputSampler : register(S0);
/// <summary>The gamma correction exponent.</summary>
/// <minValue>0.5</minValue>
/// <maxValue>2</maxValue>
/// <defaultValue>0.8</defaultValue>
float Gamma : register(C3);
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 c = tex2D(inputSampler, uv);
c.rgb = pow(c.rgb, Gamma);
return c;
}