Hash :
d3bd0ad3
Author :
Date :
2010-08-30T18:55:36
Implemented GL_NV_fence extension. I believe I have implemented all features according to the spec. The application is to allow the Chrome command buffer scheduler to be smarter about deciding which command buffer to process. For example, if a WebGL app issued a call to ReadPixels, the scheduler will issue a fence and defer executing the ReadPixels until the status goes true. It can continue to work on other command buffers in the meantime. I tested by modifying the vertex shader demo. After issuing the SwapBuffers i made issue a fence and loop until the status went true and verified it looped several times. I also tested that by calling FinishFence before going into the loop that is did not loop at all. Review URL: http://codereview.appspot.com/1965043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@405 736b8ea6-26fd-11df-bfd4-992fa37f6226
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Fence.h: Defines the gl::Fence class, which supports the GL_NV_fence extension.
#ifndef LIBGLESV2_FENCE_H_
#define LIBGLESV2_FENCE_H_
#define GL_APICALL
#include <GLES2/gl2.h>
#include <d3d9.h>
#include "common/angleutils.h"
namespace gl
{
class Fence
{
public:
Fence();
virtual ~Fence();
GLboolean isFence();
void setFence(GLenum condition);
GLboolean testFence();
void finishFence();
void getFenceiv(GLenum pname, GLint *params);
private:
DISALLOW_COPY_AND_ASSIGN(Fence);
IDirect3DQuery9* mQuery;
GLenum mCondition;
GLboolean mStatus;
};
}
#endif // LIBGLESV2_FENCE_H_