xubingyue / softart

Automatically exported from code.google.com/p/softart
Other
0 stars 0 forks source link

Bind global variable and semantic-related variable as a argument of entry function. #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
=Section I: Summary=

Consider a simple shader:

===============================================
float4x4 mvpMatrix;

struct VSO{
  float4 pos: SV_Position;
  float4 tex: SV_Texcoord(0);
};

struct VSI{
  float4 pos: SV_Position;
};

VSO vs_main( VSI input, float4 tex: SV_Texcoord(0) ){
  VSO ret;
  ret.pos = input.pos * mvpMatrix;
  ret.tex = tex;
  return ret;
}
===============================================

Original issue reported on code.google.com by wuye9036 on 9 Mar 2011 at 11:07

GoogleCodeExporter commented 8 years ago
If it is compiled as an LLVM module, mvpMatrix is the global.
Before execution, it should be set an value.

But it isn't reentrant program. If execution is parallel, defects occurs.
We describe a design to resolve it.

Original comment by wuye9036 on 9 Mar 2011 at 11:10

GoogleCodeExporter commented 8 years ago
=Section II: Solution=

In fact, we re-construct the vs_main as following:

void vs_main( InputStruct* in_data, OutputStruct* out_data );

All constant, variable and semantic-related value was stored in InputStruct.
So the input struct is:

struct InputStruct{
  float4* pos; // From VSI.pos
  float4* tex; // From tex that parameter of vs_main
};

And the output struct is treated as same.
Now, it is an reentrant route.

Original comment by wuye9036 on 9 Mar 2011 at 11:14

GoogleCodeExporter commented 8 years ago
Now all things are devided 4 parts:

1. Statistic the semantic, global variable and function entry in semantic 
analysis;
2. Exclude the functions that has non-semantic non-uniform parameter;
3. Generate entry functions.
4. Generate functions invoked by entry directly or indirectly. If any parameter 
in InputStruct is used, append InputStruct pointer as its argument.

Original comment by wuye9036 on 9 Mar 2011 at 11:18

GoogleCodeExporter commented 8 years ago
Revision r464

(Auto-update failed)

Original comment by wuye9036 on 9 Mar 2011 at 12:18

GoogleCodeExporter commented 8 years ago
Revision r465

(Auto-update failed)

Original comment by wuye9036 on 9 Mar 2011 at 12:42

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r466.

=== SASL ===
  Added new auto test case: semantic_fn.

Original comment by wuye9036 on 9 Mar 2011 at 12:46

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r467.

=== SASL ===
Add semantic to storage_si.
semantic.ss could be passed parser and semantic analysis.

Original comment by wuye9036 on 10 Mar 2011 at 12:50

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r468.

SASL:
  Add semantic support to semantic analyser.

Original comment by wuye9036 on 14 Mar 2011 at 4:24

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r469.

SASL:
  Add semantic support to parameter.

Original comment by wuye9036 on 14 Mar 2011 at 12:03

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r470.

SASL:
  Add entrant judge to function_type.
  Parser and semantic analyzer now supports build-in vector and matrix.

Original comment by wuye9036 on 14 Mar 2011 at 1:14

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r471.

SASL:
  Change the type of return of semantic_fn entry function.

Original comment by wuye9036 on 15 Mar 2011 at 2:57

GoogleCodeExporter commented 8 years ago
Shader input and output are splitted to 3 part:
  Stream-input, register-input, register-output.

For e.g.,
  SV_Position is an stream input, and SV_Texcoord also is;
  SV_Position is also an register-output;
  SV_Color is an register-output.

For stream input, we pack the pointers, for register-input/output, we send the 
value structure.

Example, 

struct StreamInput{
  float4* position;
  float4* texcoord;
};

struct RegisterInput{
  float4x4 wvpMatrix;
};

struct RasterInfo{
  float4 position;
  float4 texcoord;
};

void compiled_vs( StreamInput* sInput, RegisterInput* rInput, RasterInfo* 
output ){
  output->position = *(sInput->position) * rInput->wvpMatrix;
  output->texcoord = *(sInput->texcoord);
}

Original comment by wuye9036 on 15 Mar 2011 at 10:43

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r472.

SASL:
  Add storage_info to global_si.
  Rename external to global.

Update issue 56
SASL:
  Try to add vector and matrix llvm type support.

Original comment by wuye9036 on 15 Mar 2011 at 1:33

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r473.

SASL:
  Extract method create_buildin_type.

Original comment by wuye9036 on 16 Mar 2011 at 6:18

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r474.

SASL:
  calculate_storage code completed.
  Fixed error of global.
SALVIA:
  Add languages enum for multi-languages support in future.

Original comment by wuye9036 on 16 Mar 2011 at 12:20

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r475.

SASL:
  Rename global_si to module_si.
  Add entry function type support.
  Rename register_* to buffer_*.
  Remove indexed_semantic.
  Change semantic_fn.ss

Original comment by wuye9036 on 18 Mar 2011 at 5:56

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r476.

SASL:
  Reorganize files.

Original comment by wuye9036 on 18 Mar 2011 at 8:23

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r477.

SASL:
  Separate codegen_context from AST.
  Add ABI analyzer.

Original comment by wuye9036 on 21 Mar 2011 at 3:17

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r480.

SASL:
  Improves ABI analyzer and ABI information.
  Remove storage_info from module_si.

Original comment by wuye9036 on 21 Mar 2011 at 10:19

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 21 Mar 2011 at 10:32

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 21 Mar 2011 at 10:40

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 23 Mar 2011 at 12:50

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r485.

SASL:
  Add auto_entry to abi_analyser.
  Renames and changes signature of semantic and code generation functions.

Original comment by wuye9036 on 23 Mar 2011 at 12:56

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 23 Mar 2011 at 12:57

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 23 Mar 2011 at 1:04

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 24 Mar 2011 at 11:49

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 25 Mar 2011 at 1:28

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 29 Mar 2011 at 9:06

GoogleCodeExporter commented 8 years ago
This issue was updated by revision r510.

SASL:
  input_storage and output_storage of abi_info now are const-qualified.
  Add entry parameter types support.

Original comment by wuye9036 on 6 Apr 2011 at 2:50

GoogleCodeExporter commented 8 years ago
This issue was updated by revision d71ea32e3b5d.

=== SASL ===
  Added new auto test case: semantic_fn.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 57c257bb0b5e.

=== SASL ===
Add semantic to storage_si.
semantic.ss could be passed parser and semantic analysis.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision e6d9cd5c9e35.

SASL:
  Add semantic support to semantic analyser.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 6f58d0773743.

SASL:
  Add semantic support to parameter.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision a34c14798e14.

SASL:
  Add entrant judge to function_type.
  Parser and semantic analyzer now supports build-in vector and matrix.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 654126d4618d.

SASL:
  Change the type of return of semantic_fn entry function.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 0a6e83456f98.

SASL:
  Add storage_info to global_si.
  Rename external to global.

Update issue 56
SASL:
  Try to add vector and matrix llvm type support.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision dfbb75fbf73e.

SASL:
  Extract method create_buildin_type.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 94f386e3019d.

SASL:
  calculate_storage code completed.
  Fixed error of global.
SALVIA:
  Add languages enum for multi-languages support in future.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 1e5da4bbf0f7.

SASL:
  Rename global_si to module_si.
  Add entry function type support.
  Rename register_* to buffer_*.
  Remove indexed_semantic.
  Change semantic_fn.ss

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision cfdefecbc33f.

SASL:
  Reorganize files.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 6721e691c006.

SASL:
  Separate codegen_context from AST.
  Add ABI analyzer.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision fb4e11b71ea5.

SASL:
  Improves ABI analyzer and ABI information.
  Remove storage_info from module_si.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision b2424ed879a4.

SASL:
  Add auto_entry to abi_analyser.
  Renames and changes signature of semantic and code generation functions.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 2252d3fe3976.

SASL:
  input_storage and output_storage of abi_info now are const-qualified.
  Add entry parameter types support.

Original comment by wuye9036 on 21 Apr 2011 at 6:00

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 24 May 2011 at 11:13

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 7 Mar 2012 at 2:52