Java Code Examples for com.jogamp.opengl.GL4#glGenQueries()

The following examples show how to use com.jogamp.opengl.GL4#glGenQueries() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Gl_450_query_statistics_arb.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(Statistics.MAX, queryName);

        int[] queryCounterBits = new int[Statistics.MAX];

        gl4.glGetQueryiv(GL_VERTICES_SUBMITTED_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.VERTICES_SUBMITTED);
        gl4.glGetQueryiv(GL_PRIMITIVES_SUBMITTED_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.PRIMITIVES_SUBMITTED);
        gl4.glGetQueryiv(GL_VERTEX_SHADER_INVOCATIONS_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.VERTEX_SHADER_INVOCATIONS);
        gl4.glGetQueryiv(GL_TESS_CONTROL_SHADER_PATCHES_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.TESS_CONTROL_SHADER_PATCHES);
        gl4.glGetQueryiv(GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.TESS_EVALUATION_SHADER_INVOCATIONS);
        gl4.glGetQueryiv(GL_GEOMETRY_SHADER_INVOCATIONS, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.GEOMETRY_SHADER_INVOCATIONS);
        gl4.glGetQueryiv(GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.GEOMETRY_SHADER_PRIMITIVES_EMITTED);
        gl4.glGetQueryiv(GL_FRAGMENT_SHADER_INVOCATIONS_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.FRAGMENT_SHADER_INVOCATIONS);
        gl4.glGetQueryiv(GL_COMPUTE_SHADER_INVOCATIONS_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.COMPUTE_SHADER_INVOCATIONS);
        gl4.glGetQueryiv(GL_CLIPPING_INPUT_PRIMITIVES_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.CLIPPING_INPUT_PRIMITIVES);
        gl4.glGetQueryiv(GL_CLIPPING_OUTPUT_PRIMITIVES_ARB, GL_QUERY_COUNTER_BITS, queryCounterBits,
                Statistics.CLIPPING_OUTPUT_PRIMITIVES);

        boolean validated = true;
        for (int i = 0; i < queryCounterBits.length; ++i) {
            validated = validated && queryCounterBits[i] >= 18;
        }

        return validated;
    }
 
Example 2
Source File: Gl_500_primitive_shading_nv.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(1, queryName);

        IntBuffer queryBitsBuffer = GLBuffers.newDirectIntBuffer(1);
        gl4.glGetQueryiv(GL_PRIMITIVES_GENERATED, GL_QUERY_COUNTER_BITS, queryBitsBuffer);
        int queryBits = queryBitsBuffer.get(0);
        BufferUtils.destroyDirectBuffer(queryBitsBuffer);

        return queryBits >= 32;
    }
 
Example 3
Source File: Gl_430_query_conditional.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(1, queryName);

        int[] queryBits = {0};
        gl4.glGetQueryiv(GL_ANY_SAMPLES_PASSED_CONSERVATIVE, GL_QUERY_COUNTER_BITS, queryBits, 0);

        boolean validated = queryBits[0] >= 1;

        return validated && checkError(gl4, "initQuery");
    }
 
Example 4
Source File: Gl_430_query_occlusion.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(1, queryName);

        int[] queryBits = {0};
        gl4.glGetQueryiv(GL_ANY_SAMPLES_PASSED_CONSERVATIVE, GL_QUERY_COUNTER_BITS, queryBits, 0);

        boolean validated = queryBits[0] >= 1;

        return validated;
    }
 
Example 5
Source File: Gl_450_query_conditional.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(1, queryName);

        int[] queryBits = {0};
        gl4.glGetQueryiv(GL_ANY_SAMPLES_PASSED_CONSERVATIVE, GL_QUERY_COUNTER_BITS, queryBits, 0);

        return queryBits[0] >= 1;
    }
 
Example 6
Source File: Gl_450_transform_feedback_arb.java    From jogl-samples with MIT License 3 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(1, queryName);

        int[] queryBits = {0};
        gl4.glGetQueryiv(GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB, GL_QUERY_COUNTER_BITS, queryBits, 0);

        return queryBits[0] >= 1;
    }
 
Example 7
Source File: Gl_440_query_occlusion.java    From jogl-samples with MIT License 2 votes vote down vote up
private boolean initQuery(GL4 gl4) {

        gl4.glGenQueries(queryName.capacity(), queryName);

        return checkError(gl4, "initQuery");
    }