16 " int numBoundaryEdges;\n" 20 "struct VertexGraphData\n" 26 "buffer vertexGraph { ivec3 data[]; } vertexGraphSB;\n" 27 "buffer vertexGraphData { VertexGraphData data[]; } vertexGraphDataSB;\n" 28 "buffer orderedVertices { int data[]; } orderedVerticesSB;\n" 29 "buffer inTCoords { Real2 data[]; } inTCoordsSB;\n" 30 "buffer outTCoords { Real2 data[]; } outTCoordsSB;\n" 32 "layout (local_size_x = NUM_X_THREADS, local_size_y = NUM_Y_THREADS, local_size_z = 1) in;\n" 35 " ivec2 t = ivec2(gl_GlobalInvocationID.xy);\n" 36 " int index = t.x + bound.x * t.y;\n" 37 " if (step(index, numInputs-1) == 1)\n" 39 " int v = orderedVerticesSB.data[numBoundaryEdges + index];\n" 40 " ivec2 range = vertexGraphSB.data[v].yz;\n" 41 " Real2 tcoord = Real2(0, 0);\n" 42 " Real weightSum = 0;\n" 43 " for (int j = 0; j < range.y; ++j)\n" 45 " VertexGraphData vgd = vertexGraphDataSB.data[range.x + j];\n" 46 " weightSum += vgd.weight;\n" 47 " tcoord += vgd.weight * inTCoordsSB.data[vgd.adjacent];\n" 49 " tcoord /= weightSum;\n" 50 " outTCoordsSB.data[v] = tcoord;\n" 58 " int numBoundaryEdges;\n" 62 "struct VertexGraphData\n" 68 "StructuredBuffer<int3> vertexGraph;\n" 69 "StructuredBuffer<VertexGraphData> vertexGraphData;\n" 70 "StructuredBuffer<int> orderedVertices;\n" 71 "StructuredBuffer<Real2> inTCoords;\n" 72 "RWStructuredBuffer<Real2> outTCoords;\n" 74 "[numthreads(NUM_X_THREADS, NUM_Y_THREADS, 1)]\n" 75 "void CSMain(int2 t : SV_DispatchThreadID)\n" 77 " int index = t.x + bound.x * t.y;\n" 78 " if (step(index, numInputs-1))\n" 80 " int v = orderedVertices[numBoundaryEdges + index];\n" 81 " int2 range = vertexGraph[v].yz;\n" 82 " Real2 tcoord = Real2(0, 0);\n" 83 " Real weightSum = 0;\n" 84 " for (int j = 0; j < range.y; ++j)\n" 86 " VertexGraphData data = vertexGraphData[range.x + j];\n" 87 " weightSum += data.weight;\n" 88 " tcoord += data.weight * inTCoords[data.adjacent];\n" 90 " tcoord /= weightSum;\n" 91 " outTCoords[v] = tcoord;\n" static std::string const msHLSLSource
static std::string const * msSource[]
GLsizei const GLchar *const * string
static std::string const msGLSLSource