mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-14 18:30:26 +00:00
remove subroutines from GLSL kernels.
This commit is contained in:
parent
7b65b5b178
commit
1e9ca564b0
@ -118,8 +118,6 @@ public:
|
||||
|
||||
glDeleteShader(shader);
|
||||
|
||||
_subStencilKernel = glGetSubroutineIndex(_program, GL_COMPUTE_SHADER, "computeStencil");
|
||||
|
||||
// set uniform locations for compute kernels
|
||||
_uniformSizes = glGetUniformLocation(_program, "sterncilSizes");
|
||||
_uniformOffsets = glGetUniformLocation(_program, "sterncilOffsets");
|
||||
@ -140,9 +138,6 @@ public:
|
||||
void ApplyStencilTableKernel(int offset, int numCVs,
|
||||
int start, int end) const {
|
||||
|
||||
// select stencil GLSL subroutine
|
||||
glUniformSubroutinesuiv(GL_COMPUTE_SHADER, 1, &_subStencilKernel);
|
||||
|
||||
dispatchCompute(offset, numCVs, start, end);
|
||||
}
|
||||
|
||||
@ -191,8 +186,6 @@ private:
|
||||
|
||||
GLuint _program;
|
||||
|
||||
GLuint _subStencilKernel; // stencil compute kernel GLSL subroutine
|
||||
|
||||
GLuint _uniformSizes, // uniform paramaeters for kernels
|
||||
_uniformOffsets,
|
||||
_uniformIndices,
|
||||
|
@ -22,9 +22,6 @@
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
|
||||
subroutine void computeKernelType();
|
||||
subroutine uniform computeKernelType computeKernel;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
uniform int batchStart = 0;
|
||||
@ -76,8 +73,7 @@ void addWithWeight(inout Vertex v, const Vertex src, float weight) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
subroutine(computeKernelType)
|
||||
void computeStencil() {
|
||||
void main() {
|
||||
|
||||
int current = int(gl_GlobalInvocationID.x) + batchStart;
|
||||
|
||||
@ -90,7 +86,7 @@ void computeStencil() {
|
||||
|
||||
int offset = _offsets[current],
|
||||
size = int(_sizes[current]);
|
||||
|
||||
|
||||
for (int i=0; i<size; ++i) {
|
||||
addWithWeight(dst, readVertex( _indices[offset+i] ), _weights[offset+i]);
|
||||
}
|
||||
@ -101,11 +97,3 @@ void computeStencil() {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void main()
|
||||
{
|
||||
// call subroutine
|
||||
computeKernel();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -181,9 +181,6 @@ public:
|
||||
|
||||
glDeleteShader(shader);
|
||||
|
||||
_subStencilKernel = glGetSubroutineIndex(
|
||||
_program, GL_VERTEX_SHADER, "computeStencil");
|
||||
|
||||
// set uniform locations for compute kernels
|
||||
_primvarBuffer = glGetUniformLocation(_program, "vertexBuffer");
|
||||
|
||||
@ -255,8 +252,6 @@ public:
|
||||
int offset, int numCVs,
|
||||
int start, int end) const {
|
||||
|
||||
glUniformSubroutinesuiv(GL_VERTEX_SHADER, 1, &_subStencilKernel);
|
||||
|
||||
TransformPrimvarBuffer(primvarBuffer,
|
||||
offset, numCVs, start, end);
|
||||
}
|
||||
@ -277,8 +272,6 @@ private:
|
||||
|
||||
GLuint _program;
|
||||
|
||||
GLuint _subStencilKernel; // stencil compute kernel GLSL subroutine
|
||||
|
||||
GLint _primvarBuffer;
|
||||
|
||||
GLint _uniformSizes, // uniform paramaeters for kernels
|
||||
|
@ -22,9 +22,6 @@
|
||||
// language governing permissions and limitations under the Apache License.
|
||||
//
|
||||
|
||||
subroutine void computeKernelType();
|
||||
subroutine uniform computeKernelType computeKernel;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
uniform samplerBuffer vertexBuffer;
|
||||
@ -81,8 +78,7 @@ void writeVertex(Vertex v) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
subroutine(computeKernelType)
|
||||
void computeStencil() {
|
||||
void main() {
|
||||
|
||||
int current = gl_VertexID + batchStart;
|
||||
|
||||
@ -108,11 +104,3 @@ void computeStencil() {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void main() {
|
||||
|
||||
// call subroutine
|
||||
computeKernel();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user