Logo by mjk1093 - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 29, 2024, 01:37:53 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 [2]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: shader function or instruction cost (performance)  (Read 24326 times)
0 Members and 5 Guests are viewing this topic.
eiffie
Guest
« Reply #15 on: June 12, 2015, 08:49:39 PM »

The glslang tool seems like it would have many uses (not just the validation it was intended for). Thanks for putting this together.
Logged
eiffie
Guest
« Reply #16 on: June 14, 2015, 09:01:27 PM »

Even though Truth-ila isn't planning on developing it further it does work nicely. I'm just going to document some compile issues if anyone is building this or glslang on VS. I used the 2010 versions of the StandAlone and glslang and had to rip out the Bison precompile step. Just run it manually once. You also have to add a SPIRV project and build that lib. Once that compiles create the ShaderTune project exactly the same as StandAlone. I only had a couple issues with ShaderTune. If you have .frag files with /r/n line endings you need to adjust the code in loadAndCalc because size and read will not be equal. I also had to move the code from ShaderParser.CPP to CostCalcuator::CostCalculator or that shader data would simply go out of scope.
Logged
TruthSerum
Guest
« Reply #17 on: June 15, 2015, 12:27:50 AM »

Woops, that was a bad error. I should have simply streamed small chunks of the file into an std::string, instead of trying to allocate the whole thing up-front based on the byte-size of the file, which has line endings converted by the "r" flag to fread(). Perhaps the glslang parser supports \r\n line endings, in which case simply changing the fread() flags to "rb" will fix it. As for the scoping issues, not sure exactly what you meant by that.
Logged
eiffie
Guest
« Reply #18 on: June 15, 2015, 03:57:04 PM »

I think "rb" would work fine or just use if(read>0)buffer[read]=0. In StandAlone they find the character length reading the whole file char at a time then repositioning to the beginning. It is all the same - these are small files.

Here is a better explanation of the other error.

In CostCalculator...
Shader shader=Shader::parsefile(blah blah); //I don't remember the exact syntax

In ShaderParser.cpp ...
Shader::parsefile(blah blah){
  Shader shader;
  ...
  shader.parse(blah blah);//everything is fine after this line, shader has been loaded and the InfoSink and Tree are loaded.
  return shader;
}//everything is lost here as the variable shader goes out of scope with the end of the function

I tried ...

static Shader shader; //and that helped a bit but I still got an error later in the cost calcs so I just dumped the code into CostCalculator and everything was fine. huh?
Logged
TruthSerum
Guest
« Reply #19 on: June 15, 2015, 05:48:17 PM »

I see, looks like I forgot to implement copy/assignment members of the Shader object. It worked for me with the compiler generated copy methods.
Logged
Pages: 1 [2]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
DirectX 11 compute shader / Directx 10 Pixel shader implementation Mandelbulb Implementation cbuchner1 2 13722 Last post November 29, 2009, 12:32:26 AM
by cbuchner1
3D fractals using shader 2 3D Fractal Generation David Makin 4 6803 Last post October 14, 2010, 06:10:59 PM
by David Makin
Under Divine Instruction Mandelbulb3D Gallery CO99A5 0 869 Last post April 11, 2015, 03:04:56 AM
by CO99A5
shader project - glsl DE function collection Let's collaborate on something! cKleinhuis 3 4651 Last post June 09, 2015, 11:51:32 AM
by cKleinhuis
rdrand cpu instruction Programming ker2x 13 2080 Last post September 06, 2016, 08:28:00 AM
by ker2x

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.146 seconds with 22 queries. (Pretty URLs adds 0.007s, 2q)