mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-27 21:20:30 +00:00
9220dbb078
Reimplement the whole workflow to make that: precise'ness of struct members won't spread to other non-precise members of the same struct instance. Approach: 1. Build the map from symbols to their defining nodes. And for each object node (StructIndex, DirectIndex, Symbol nodes, etc), generates an accesschain path. Different AST nodes that indicating a same object should have the same accesschain path. 2. Along the building phase in step 1, collect the initial set of 'precise' (AST qualifier: 'noContraction') objects' accesschain paths. 3. Start with the initial set of 'precise' accesschain paths, use it as a worklist, do as the following steps until the worklist is empty: 1) Pop an accesschain path from worklist. 2) Get the symbol part from the accesschain path. 3) Find the defining nodes of that symbol. 4) For each defining node, check whether it is defining a 'precise' object, or its assignee has nested 'precise' object. Get the incremental path from assignee to its nested 'precise' object (if any). 5) Traverse the right side of the defining node, obtain the accesschain paths of the corresponding involved 'precise' objects. Update the worklist with those new objects' accesschain paths. Label involved operations with 'noContraction'. In each step, whenever we find the parent object of an nested object is 'precise' (has 'noContraction' qualifier), we let the nested object inherit the 'precise'ness from its parent object.
25 lines
750 B
GLSL
25 lines
750 B
GLSL
#version 310 es
|
|
#extension GL_EXT_tessellation_shader : require
|
|
#extension GL_EXT_gpu_shader5 : require
|
|
|
|
layout(vertices = 3) out;
|
|
|
|
layout(location = 0) in highp vec2 in_tc_position[];
|
|
layout(location = 1) in highp float in_tc_tessParam[];
|
|
|
|
layout(location = 0) out highp vec2 in_te_position[];
|
|
|
|
precise gl_TessLevelOuter;
|
|
|
|
void main (void)
|
|
{
|
|
in_te_position[gl_InvocationID] = in_tc_position[gl_InvocationID];
|
|
|
|
gl_TessLevelInner[0] = 5.0;
|
|
gl_TessLevelInner[1] = 5.0;
|
|
|
|
gl_TessLevelOuter[0] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[1] + in_tc_tessParam[2]);
|
|
gl_TessLevelOuter[1] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[2] + in_tc_tessParam[0]);
|
|
gl_TessLevelOuter[2] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[0] + in_tc_tessParam[1]);
|
|
}
|