Added support for GL_QCOM_texture_foveated

This commit is contained in:
Jimmy Lee
2018-10-24 16:49:35 -07:00
committed by Baldur Karlsson
parent 7fd5ab923e
commit 9ffcd0a9e0
7 changed files with 3903 additions and 3822 deletions
+2
View File
@@ -2064,6 +2064,8 @@ enum class GLChunk : uint32_t
ContextConfiguration,
glTextureFoveationParametersQCOM,
Max,
};
+3
View File
@@ -666,6 +666,9 @@ struct GLDispatchTable
// OVR_multiview_multisampled_render_to_texture
PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC glFramebufferTextureMultisampleMultiviewOVR;
// QCOM_texture_foveated
PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC glTextureFoveationParametersQCOM;
// ARB_parallel_shader_compile
PFNGLMAXSHADERCOMPILERTHREADSKHRPROC glMaxShaderCompilerThreadsKHR; // aliases glMaxShaderCompilerThreadsARB
File diff suppressed because it is too large Load Diff
+4
View File
@@ -479,6 +479,7 @@ void WrappedOpenGL::BuildGLESExtensions()
m_GLESExtensions.push_back("GL_OVR_multiview");
m_GLESExtensions.push_back("GL_OVR_multiview2");
m_GLESExtensions.push_back("GL_OVR_multiview_multisampled_render_to_texture");
m_GLESExtensions.push_back("GL_QCOM_texture_foveated");
// advertise EGL extensions in the gl ext string, just in case anyone is checking it for
// this way.
@@ -3347,6 +3348,9 @@ bool WrappedOpenGL::ProcessChunk(ReadSerialiser &ser, GLChunk chunk)
case GLChunk::glFramebufferTextureMultisampleMultiviewOVR:
return Serialise_glFramebufferTextureMultisampleMultiviewOVR(ser, eGL_NONE, eGL_NONE, 0, 0, 0,
0, 0);
case GLChunk::glTextureFoveationParametersQCOM:
return Serialise_glTextureFoveationParametersQCOM(ser, eGL_NONE, 0, 0, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f);
case GLChunk::glFramebufferParameteri:
case GLChunk::glNamedFramebufferParameteri:
case GLChunk::glNamedFramebufferParameteriEXT:
+3
View File
@@ -864,6 +864,9 @@ public:
IMPLEMENT_FUNCTION_SERIALISED(void, glFramebufferTextureMultisampleMultiviewOVR, GLenum target,
GLenum attachment, GLuint texture, GLint level, GLsizei samples,
GLint baseViewIndex, GLsizei numViews);
IMPLEMENT_FUNCTION_SERIALISED(void, glTextureFoveationParametersQCOM, GLuint texture,
GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY,
GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
IMPLEMENT_FUNCTION_SERIALISED(void, glFramebufferParameteri, GLenum target, GLenum pname,
GLint param);
+1
View File
@@ -3736,6 +3736,7 @@ std::string DoStringise(const RDCGLenum &el)
TOSTR_CASE_STRINGIZE_GLENUM(GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM)
TOSTR_CASE_STRINGIZE_GLENUM(GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM)
TOSTR_CASE_STRINGIZE_GLENUM(GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM)
TOSTR_CASE_STRINGIZE_GLENUM(GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM)
TOSTR_CASE_STRINGIZE_GLENUM(GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM)
TOSTR_CASE_STRINGIZE_GLENUM(GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM)
TOSTR_CASE_STRINGIZE_GLENUM(GL_WRITEONLY_RENDERING_QCOM)
@@ -6318,6 +6318,71 @@ void WrappedOpenGL::glMultiTexBufferEXT(GLenum texunit, GLenum target, GLenum in
}
}
template <typename SerialiserType>
bool WrappedOpenGL::Serialise_glTextureFoveationParametersQCOM(SerialiserType &ser,
GLuint textureHandle, GLuint layer,
GLuint focalPoint, GLfloat focalX,
GLfloat focalY, GLfloat gainX,
GLfloat gainY, GLfloat foveaArea)
{
SERIALISE_ELEMENT_LOCAL(texture, TextureRes(GetCtx(), textureHandle));
SERIALISE_ELEMENT(layer);
SERIALISE_ELEMENT(focalPoint);
SERIALISE_ELEMENT(focalX);
SERIALISE_ELEMENT(focalY);
SERIALISE_ELEMENT(gainX);
SERIALISE_ELEMENT(gainY);
SERIALISE_ELEMENT(foveaArea);
SERIALISE_CHECK_READ_ERRORS();
if(IsReplayingAndReading())
{
GL.glTextureFoveationParametersQCOM(texture.name, layer, focalPoint, focalX, focalY, gainX,
gainY, foveaArea);
AddResourceInitChunk(texture);
}
return true;
}
void WrappedOpenGL::glTextureFoveationParametersQCOM(GLuint texture, GLuint layer, GLuint focalPoint,
GLfloat focalX, GLfloat focalY, GLfloat gainX,
GLfloat gainY, GLfloat foveaArea)
{
SERIALISE_TIME_CALL(GL.glTextureFoveationParametersQCOM(texture, layer, focalPoint, focalX,
focalY, gainX, gainY, foveaArea));
if(IsCaptureMode(m_State))
{
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(TextureRes(GetCtx(), texture));
RDCASSERT(record);
USE_SCRATCH_SERIALISER();
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_glTextureFoveationParametersQCOM(ser, record->Resource.name, layer, focalPoint,
focalX, focalY, gainX, gainY, foveaArea);
if(IsActiveCapturing(m_State))
{
GetContextRecord()->AddChunk(scope.Get());
GetResourceManager()->MarkResourceFrameReferenced(record->GetResourceID(), eFrameRef_Read);
}
else
{
record->AddChunk(scope.Get());
record->UpdateCount++;
if(record->UpdateCount > 64)
{
m_HighTrafficResources.insert(record->GetResourceID());
GetResourceManager()->MarkDirtyResource(record->GetResourceID());
}
}
}
}
#pragma endregion
INSTANTIATE_FUNCTION_SERIALISED(void, glGenTextures, GLsizei n, GLuint *textures);
@@ -6425,3 +6490,6 @@ INSTANTIATE_FUNCTION_SERIALISED(void, glTextureBufferRangeEXT, GLuint texture, G
GLsizeiptr size);
INSTANTIATE_FUNCTION_SERIALISED(void, glTextureBufferEXT, GLuint texture, GLenum target,
GLenum internalformat, GLuint buffer);
INSTANTIATE_FUNCTION_SERIALISED(void, glTextureFoveationParametersQCOM, GLuint texture,
GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY,
GLfloat gainX, GLfloat gainY, GLfloat foveaArea);