[fixed] adding a set*ShaderConstant int* interface

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

[fixed] adding a set*ShaderConstant int* interface

Post by hendu »

While integers were only added in OpenGL 3.0, you need to send ints to set GLSL texture samplers currently.

Having to cast that to float* for Irr means the client code can't use strict aliasing, and is a bit ugly.


Requesting an interface be added that takes int* instead of float*. You should be able to trust the user and send it straight to Driver->extGlUniform1iv if the user says they are ints. It's a fairly straight copy-paste job of the existing setPixelShaderConstant function for GLSL.

Any comments?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Request for adding a set*ShaderConstant int* interface

Post by hendu »

Ping. I'm willing to post patches, but please give me a yea/nay.

I also have no Windows in the house, so I can only do the GL implementation.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Request for adding a set*ShaderConstant int* interface

Post by Radikalizm »

I second this request
Wouldn't be needed for DX though, integers aren't supported in SM3 shaders, and as far as I know there's no way to use SM4 or SM5 in DX9
Might come in handy for the future though when a decision might be made to include DX10/11 support
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Request for adding a set*ShaderConstant int* interface

Post by hybrid »

Yes, that's one where I should have a patch already. Anyway, should be faster if you send in one for this as well.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Request for adding a set*ShaderConstant int* interface

Post by hendu »

Ping as the holidays are over.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Request for adding a set*ShaderConstant int* interface

Post by hendu »

Ping on this too. It's working quite well here.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Request for adding a set*ShaderConstant int* interface

Post by hybrid »

Yeah, I know. But these API changes need a second thought, as there are also other data types which may need to be automatically converted. So I'd like to have at least a few minutes to go through the current code, the patch, and the hardware driver APIs to get a better impression of the whole scene. And I didn't have enough time so far. But it will be in 1.8 for sure.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Request for adding a set*ShaderConstant int* interface

Post by hendu »

So I'd like to have at least a few minutes to go through the current code, the patch, and the hardware driver APIs to get a better impression of the whole scene. And I didn't have enough time so far.
It's been two months since the last post, so I thought I wasn't harassing you too much ;)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Request for adding a set*ShaderConstant int* interface

Post by Nadro »

Patch which include methods for all drivers (D3D8, D3D9, OGL) is already on a tracker (compatible with trunk r4105). I also improved code style in Cg files ('p' in a methods parameters was replaced by Irrlicht style).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Request for adding a set*ShaderConstant int* interface

Post by hendu »

The Cg 'p' changes are unrelated, a separate patch for those would be better IMHO.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Request for adding a set*ShaderConstant int* interface

Post by Nadro »

Patch is already applied in a trunk :)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply