MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030119Open CASCADE[OCCT] OCCT:Visualizationpublic2018-09-10 11:482018-09-11 11:02
Reportermnv 
Assigned Tomnv 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030119: Visualization - implement mechanism for generating in/out section of shader programs.
DescriptionIt's desired to have functionality for generating source code for in/out section of shader programs, which will be collect var names and generate target source code in one place.
Steps To ReproduceNot required
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0079079)
git (administrator)
2018-09-10 11:58

Branch CR30119 has been created by mnv.

SHA-1: c0c56870aa54d56e98a6d6053e24d9a0bf09c2b8


Detailed log of new commits:

Author: mnv
Date: Fri Sep 7 10:18:46 2018 +0300

    0030119: Visualization - implement mechanism for generating in/out section of shader programs.
    
    Added function which generate in/out part of shaders source code from prepared list of variables.
(0079085)
git (administrator)
2018-09-10 14:42

Branch CR30119 has been updated forcibly by mnv.

SHA-1: 7b1e3aacc7b2cb460eef4308bd4e7f02d698b80a
(0079089)
git (administrator)
2018-09-10 15:34

Branch CR30119 has been updated forcibly by mnv.

SHA-1: 3d6d57d57262fee535392aad129c32c98cf4964c
(0079108)
mnv (developer)
2018-09-11 08:56

Patch is ready for review
(0079111)
kgv (developer)
2018-09-11 11:02

+//! List of variable of shader program.
+typedef NCollection_Vector<TCollection_AsciiString> OpenGl_ShaderVarList;

I still don't see an answer to the question, why NCollection_Vector is used here.

+  Standard_EXPORT void prepareShadersOutSrc (TCollection_AsciiString&    theSrcVertOut,
+                                             TCollection_AsciiString&    theSrcFragOut,
+                                             const OpenGl_ShaderVarList& theVarList);

Should be static or const method.

-      aSrcVertExtraOut +=
-        EOL"THE_SHADER_OUT vec2 ScreenSpaceCoord;";
+      aVarList.Append ("vec2 ScreenSpaceCoord");
       aSrcFragExtraOut +=
-        EOL"THE_SHADER_IN  vec2 ScreenSpaceCoord;"
         EOL"uniform int   uPattern;"
         EOL"uniform float uFactor;";

Please generalize approach to cover uniform variables as well (probably, these can be specified per-stage).

+  if (!aVarList.IsEmpty())
+  {
+    prepareShadersOutSrc (aSrcVertExtraOut, aSrcFragExtraOut, aVarList);
+  }

This looks awkward to keep dedicated variables for that - aSrcVertExtraOut and aSrcFragExtraOut are probably should gone away.

prepareShadersOutSrc() can be redefined to be called per-shader stage (take enumeration).
Or even better, Graphic3d_ShaderObject::CreateFromSource() can be wrapped by OpenGl_ShaderObject/OpenGl_ShaderManager to take additional arguments (in/out variables, uniform variables).

- Issue History
Date Modified Username Field Change
2018-09-10 11:48 mnv New Issue
2018-09-10 11:48 mnv Assigned To => kgv
2018-09-10 11:48 mnv Assigned To kgv => mnv
2018-09-10 11:48 mnv Status new => assigned
2018-09-10 11:58 git Note Added: 0079079
2018-09-10 14:42 git Note Added: 0079085
2018-09-10 15:34 git Note Added: 0079089
2018-09-11 08:56 mnv Note Added: 0079108
2018-09-11 08:56 mnv Assigned To mnv => kgv
2018-09-11 08:56 mnv Status assigned => resolved
2018-09-11 08:56 mnv Steps to Reproduce Updated View Revisions
2018-09-11 11:02 kgv Note Added: 0079111
2018-09-11 11:02 kgv Assigned To kgv => mnv
2018-09-11 11:02 kgv Status resolved => assigned


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker