Texture creation from dynamic plugin fails in alpha28 ex9

hello devvvvs,

thanks for the ex9 build! It seems though that output to a texture from a dynamic plugin is currently broken. (i also noticed the same in alpha27.2 ex9 builds) Can be easily verified by looking at Template (EX9.Texture) help patch. jsyk… ;)

ahja, forgot about those.
in dx9ex there is no MANAGED pool anymore for resources. all has to be set to use pool DEFAULT. and usage DYNAMIC has to be set for resources that are being changed at runtime. fixed that for the template in latest build.

so all seems fine now for 32bit textures, but what about float textures?

following tonfilms advice from https://discourse.vvvv.org/t/6482 combined with your remarks i set my texture up like this:

protected override Texture CreateTexture(int Slice, Device device)
			FLogger.Log(LogType.Debug, "Creating new texture (" + Math.Max(FWidthIn[Slice](Slice), 1).ToString() + "x" + Math.Max(FHeightIn[Slice](Slice), 1).ToString() + ") at slice: " + Slice);
			return new Texture(device, Math.Max(FWidthIn[Slice](Slice), 1), Math.Max(FHeightIn[Slice](Slice), 1), 1, Usage.Dynamic, Format.A32B32G32R32F, Pool.Default);


afterwards i fill the texture like this if it needs to be updated:

private unsafe void FillPosTexture(Texture tx)
			Surface srf = tx.GetSurfaceLevel(0);
			DataRectangle rect = srf.LockRectangle(LockFlags.None);
			if (rect.Data.CanWrite) {
				FLogger.Log(LogType.Debug,"filling texture");
				for (int i = 0; i < IPointsTotal; i++) {
					Write some Data here..
				IOUTSpreadCount[0](0) = IPointsTotal;

everything else is is more or less derived form Template(Texture.EX9)and runs fine on 27.2 builds which are non EX9 ones. (haven’t tested with non EX9 alpha28 builds yet)

any ideas?

edit: fixed code for readability and redundant lines ;)

mkay. all i did to the example you mailed me was changing Usage to Dynamic, Pool to Default and i added a line:
at the end of FillPosTexture(Texture tx)

seems to me the old non-dx9ex was not so picky about the missing UnlockRectangle() as the new dx9ex is.


I even had that line in there at some time and as you said: it did not seem to make a difference under 27.2. doh…

Thanks for having a look!