mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-26 20:01:17 +00:00
ARB_dsa part 2 - Implement Texture* family of functions
* Since this would be another duplicated set of code, move the variants into common functions - each of the variants (ARB_dsa, EXT_dsa, non-DSA and possibly MultiTex) calls into a common function just with a different resource record. * Handling the ARB/EXT dsa differences on the texture calls, the target parameter is set to GL_NONE for the ARB dsa calls (which lack a target parameter). Then in the serialise replay part, if the target is GL_NONE we use the ARB variant and otherwise use the EXT variant. See the comments at the top of gl_texture_funcs.cpp * For functions with common code that needs to happen on replay, we pass the resource's ID instead of its record, to be compatible with replay where there are no records. To save time & unnecessary queries, also force all internal texture creates on replay to happen through the DSA interfaces so we don't have to go looking up the texture via selectors.
This commit is contained in:
@@ -163,6 +163,7 @@ enum GLChunkType
|
||||
BIND_TEXTURE,
|
||||
BIND_TEXTURES,
|
||||
BIND_MULTI_TEX,
|
||||
BIND_TEXTURE_UNIT,
|
||||
BIND_IMAGE_TEXTURE,
|
||||
BIND_IMAGE_TEXTURES,
|
||||
ACTIVE_TEXTURE,
|
||||
|
||||
@@ -336,7 +336,7 @@ void GLReplay::InitDebugData()
|
||||
gl.glGenTextures(1, &DebugData.pickPixelTex);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, DebugData.pickPixelTex);
|
||||
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, eGL_RGBA32F, 1, 1);
|
||||
gl.glTextureStorage2DEXT(DebugData.pickPixelTex, eGL_TEXTURE_2D, 1, eGL_RGBA32F, 1, 1);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -1511,7 +1511,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, TextureDisplayOverlay overl
|
||||
DebugData.overlayTexWidth = texDetails.width;
|
||||
DebugData.overlayTexHeight = texDetails.height;
|
||||
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, eGL_RGBA16, texDetails.width, texDetails.height);
|
||||
gl.glTextureStorage2DEXT(DebugData.overlayTex, eGL_TEXTURE_2D, 1, eGL_RGBA16, texDetails.width, texDetails.height);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -1622,7 +1622,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, TextureDisplayOverlay overl
|
||||
|
||||
gl.glGenTextures(1, &depthCopy);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, depthCopy);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, fmt, DebugData.overlayTexWidth, DebugData.overlayTexHeight);
|
||||
gl.glTextureStorage2DEXT(depthCopy, eGL_TEXTURE_2D, 1, fmt, DebugData.overlayTexWidth, DebugData.overlayTexHeight);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -1642,7 +1642,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, TextureDisplayOverlay overl
|
||||
|
||||
gl.glGenTextures(1, &stencilCopy);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, stencilCopy);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, fmt, DebugData.overlayTexWidth, DebugData.overlayTexHeight);
|
||||
gl.glTextureStorage2DEXT(stencilCopy, eGL_TEXTURE_2D, 1, fmt, DebugData.overlayTexWidth, DebugData.overlayTexHeight);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -1763,7 +1763,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, TextureDisplayOverlay overl
|
||||
|
||||
// image for quad usage
|
||||
gl.glBindTexture(eGL_TEXTURE_2D_ARRAY, quadtexs[2]);
|
||||
gl.glTexStorage3D(eGL_TEXTURE_2D_ARRAY, 1, eGL_R32UI, texDetails.width>>1, texDetails.height>>1, 4);
|
||||
gl.glTextureStorage3DEXT(quadtexs[2], eGL_TEXTURE_2D_ARRAY, 1, eGL_R32UI, texDetails.width>>1, texDetails.height>>1, 4);
|
||||
|
||||
// temporarily attach to FBO to clear it
|
||||
GLint zero = 0;
|
||||
@@ -1777,7 +1777,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, TextureDisplayOverlay overl
|
||||
gl.glClearBufferiv(eGL_COLOR, 0, &zero);
|
||||
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, quadtexs[0]);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, eGL_RGBA8, texDetails.width, texDetails.height);
|
||||
gl.glTextureStorage2DEXT(quadtexs[0], eGL_TEXTURE_2D, 1, eGL_RGBA8, texDetails.width, texDetails.height);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -1785,7 +1785,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, TextureDisplayOverlay overl
|
||||
gl.glFramebufferTexture(eGL_FRAMEBUFFER, eGL_COLOR_ATTACHMENT0, quadtexs[0], 0);
|
||||
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, quadtexs[1]);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, eGL_DEPTH32F_STENCIL8, texDetails.width, texDetails.height);
|
||||
gl.glTextureStorage2DEXT(quadtexs[1], eGL_TEXTURE_2D, 1, eGL_DEPTH32F_STENCIL8, texDetails.width, texDetails.height);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
|
||||
@@ -47,6 +47,7 @@ const char *GLChunkNames[] =
|
||||
"glBindTexture",
|
||||
"glBindTextures",
|
||||
"glBindMultiTexture",
|
||||
"glBindTextureUnit",
|
||||
"glBindImageTexture",
|
||||
"glBindImageTextures",
|
||||
"glActiveTexture",
|
||||
@@ -794,11 +795,11 @@ void WrappedOpenGL::Initialise(GLInitParams ¶ms)
|
||||
|
||||
if(params.multiSamples > 1)
|
||||
{
|
||||
gl.glTexStorage2DMultisample(target, params.multiSamples, colfmt, params.width, params.height, true);
|
||||
gl.glTextureStorage2DMultisampleEXT(m_FakeBB_Color, target, params.multiSamples, colfmt, params.width, params.height, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl.glTexStorage2D(target, 1, colfmt, params.width, params.height);
|
||||
gl.glTextureStorage2DEXT(m_FakeBB_Color, target, 1, colfmt, params.width, params.height);
|
||||
gl.glTexParameteri(target, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(target, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(target, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -847,9 +848,9 @@ void WrappedOpenGL::Initialise(GLInitParams ¶ms)
|
||||
gl.glObjectLabel(eGL_TEXTURE, m_FakeBB_DepthStencil, -1, "Backbuffer Depth");
|
||||
|
||||
if(params.multiSamples > 1)
|
||||
gl.glTexStorage2DMultisample(target, params.multiSamples, depthfmt, params.width, params.height, true);
|
||||
gl.glTextureStorage2DMultisampleEXT(m_FakeBB_DepthStencil, target, params.multiSamples, depthfmt, params.width, params.height, true);
|
||||
else
|
||||
gl.glTexStorage2D(target, 1, depthfmt, params.width, params.height);
|
||||
gl.glTextureStorage2DEXT(m_FakeBB_DepthStencil, target, 1, depthfmt, params.width, params.height);
|
||||
|
||||
if(stencil)
|
||||
gl.glFramebufferTexture(eGL_FRAMEBUFFER, eGL_DEPTH_STENCIL_ATTACHMENT, m_FakeBB_DepthStencil, 0);
|
||||
@@ -2323,6 +2324,9 @@ void WrappedOpenGL::ProcessChunk(uint64_t offset, GLChunkType context)
|
||||
case BIND_MULTI_TEX:
|
||||
Serialise_glBindMultiTextureEXT(eGL_NONE, eGL_NONE, 0);
|
||||
break;
|
||||
case BIND_TEXTURE_UNIT:
|
||||
Serialise_glBindTextureUnit(0, 0);
|
||||
break;
|
||||
case BIND_IMAGE_TEXTURE:
|
||||
Serialise_glBindImageTexture(0, 0, 0, 0, 0, eGL_NONE, eGL_NONE);
|
||||
break;
|
||||
|
||||
@@ -1094,6 +1094,52 @@ class WrappedOpenGL
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glDeleteVertexArrays(GLsizei n, const GLuint *arrays));
|
||||
|
||||
// EXT_direct_state_access
|
||||
|
||||
// there's a lot of duplicated code in some of these variants, between
|
||||
// EXT_dsa, ARB_dsa, non-dsa and for textures the MultiTex variants etc.
|
||||
// So we make a Common_ function similar to the Serialise_ function based
|
||||
// on the EXT_dsa interface, which takes the function parameters and a
|
||||
// GLResourceRecord* which does all the common tasks between all of these
|
||||
// functions.
|
||||
|
||||
void Common_glGenerateTextureMipmapEXT(GLResourceRecord *record, GLenum target);
|
||||
|
||||
void Common_glCopyTextureImage1DEXT(GLResourceRecord *record, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void Common_glCopyTextureImage2DEXT(GLResourceRecord *record, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void Common_glCopyTextureSubImage1DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void Common_glCopyTextureSubImage2DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void Common_glCopyTextureSubImage3DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void Common_glTextureBufferEXT(ResourceId id, GLenum target, GLenum internalformat, GLuint buffer);
|
||||
void Common_glTextureBufferRangeEXT(ResourceId id, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
||||
|
||||
void Common_glTextureImage1DEXT(ResourceId id, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
void Common_glTextureImage2DEXT(ResourceId id, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
void Common_glTextureImage3DEXT(ResourceId id, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
void Common_glCompressedTextureImage1DEXT(ResourceId id, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits);
|
||||
void Common_glCompressedTextureImage2DEXT(ResourceId id, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits);
|
||||
void Common_glCompressedTextureImage3DEXT(ResourceId id, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits);
|
||||
|
||||
void Common_glTextureStorage1DEXT(ResourceId id, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
void Common_glTextureStorage2DEXT(ResourceId id, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void Common_glTextureStorage3DEXT(ResourceId id, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
void Common_glTextureStorage2DMultisampleEXT(ResourceId id, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
|
||||
void Common_glTextureStorage3DMultisampleEXT(ResourceId id, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
|
||||
|
||||
void Common_glTextureSubImage1DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels);
|
||||
void Common_glTextureSubImage2DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
||||
void Common_glTextureSubImage3DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
|
||||
void Common_glCompressedTextureSubImage1DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits);
|
||||
void Common_glCompressedTextureSubImage2DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits);
|
||||
void Common_glCompressedTextureSubImage3DEXT(GLResourceRecord *record, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits);
|
||||
|
||||
void Common_glTextureParameterfEXT(GLResourceRecord *record, GLenum target, GLenum pname, GLfloat param);
|
||||
void Common_glTextureParameterfvEXT(GLResourceRecord *record, GLenum target, GLenum pname, const GLfloat *params);
|
||||
void Common_glTextureParameteriEXT(GLResourceRecord *record, GLenum target, GLenum pname, GLint param);
|
||||
void Common_glTextureParameterivEXT(GLResourceRecord *record, GLenum target, GLenum pname, const GLint *params);
|
||||
void Common_glTextureParameterIivEXT(GLResourceRecord *record, GLenum target, GLenum pname, const GLint *params);
|
||||
void Common_glTextureParameterIuivEXT(GLResourceRecord *record, GLenum target, GLenum pname, const GLuint *params);
|
||||
|
||||
IMPLEMENT_FUNCTION_SERIALISED(GLenum, glCheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits));
|
||||
IMPLEMENT_FUNCTION_SERIALISED(void, glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits));
|
||||
|
||||
@@ -164,7 +164,7 @@ void GLReplay::CreateOutputWindowBackbuffer(OutputWindow &outwin, bool depth)
|
||||
gl.glGenTextures(1, &outwin.BlitData.backbuffer);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, outwin.BlitData.backbuffer);
|
||||
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, eGL_SRGB8, outwin.width, outwin.height);
|
||||
gl.glTextureStorage2DEXT(outwin.BlitData.backbuffer, eGL_TEXTURE_2D, 1, eGL_SRGB8, outwin.width, outwin.height);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -176,7 +176,7 @@ void GLReplay::CreateOutputWindowBackbuffer(OutputWindow &outwin, bool depth)
|
||||
gl.glGenTextures(1, &outwin.BlitData.depthstencil);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, outwin.BlitData.depthstencil);
|
||||
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, eGL_DEPTH_COMPONENT24, outwin.width, outwin.height);
|
||||
gl.glTextureStorage2DEXT(outwin.BlitData.depthstencil, eGL_TEXTURE_2D, 1, eGL_DEPTH_COMPONENT24, outwin.width, outwin.height);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MIN_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_MAG_FILTER, eGL_NEAREST);
|
||||
gl.glTexParameteri(eGL_TEXTURE_2D, eGL_TEXTURE_WRAP_S, eGL_CLAMP_TO_EDGE);
|
||||
@@ -2228,9 +2228,9 @@ byte *GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip,
|
||||
gl.glGenTextures(1, &tempTex);
|
||||
gl.glBindTexture(newtarget, tempTex);
|
||||
if(newtarget == eGL_TEXTURE_3D)
|
||||
gl.glTexStorage3D(newtarget, 1, finalFormat, width, height, depth);
|
||||
gl.glTextureStorage3DEXT(tempTex, newtarget, 1, finalFormat, width, height, depth);
|
||||
else
|
||||
gl.glTexStorage2D(newtarget, 1, finalFormat, width, height);
|
||||
gl.glTextureStorage2DEXT(tempTex, newtarget, 1, finalFormat, width, height);
|
||||
|
||||
// create temp framebuffer
|
||||
GLuint fbo = 0;
|
||||
@@ -2310,7 +2310,7 @@ byte *GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip,
|
||||
// create temporary texture of width/height in same format to render to
|
||||
gl.glGenTextures(1, &tempTex);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, tempTex);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, 1, intFormat, width, height);
|
||||
gl.glTextureStorage2DEXT(tempTex, eGL_TEXTURE_2D, 1, intFormat, width, height);
|
||||
|
||||
// create temp framebuffers
|
||||
GLuint fbos[2] = { 0 };
|
||||
@@ -2354,7 +2354,7 @@ byte *GLReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip,
|
||||
// with the same number of array slices as multi samples.
|
||||
gl.glGenTextures(1, &tempTex);
|
||||
gl.glBindTexture(eGL_TEXTURE_2D_ARRAY, tempTex);
|
||||
gl.glTexStorage3D(eGL_TEXTURE_2D_ARRAY, 1, intFormat, width, height, arraysize*samples);
|
||||
gl.glTextureStorage3DEXT(tempTex, eGL_TEXTURE_2D_ARRAY, 1, intFormat, width, height, arraysize*samples);
|
||||
|
||||
// copy multisampled texture to an array
|
||||
CopyTex2DMSToArray(tempTex, texname, width, height, arraysize, samples, intFormat);
|
||||
@@ -2702,56 +2702,56 @@ ResourceId GLReplay::CreateProxyTexture(FetchTexture templateTex)
|
||||
case eResType_Texture1D:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_1D, tex);
|
||||
gl.glTexStorage1D(eGL_TEXTURE_1D, templateTex.mips, intFormat, templateTex.width);
|
||||
gl.glTextureStorage1DEXT(tex, eGL_TEXTURE_1D, templateTex.mips, intFormat, templateTex.width);
|
||||
break;
|
||||
}
|
||||
case eResType_Texture1DArray:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_1D_ARRAY, tex);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_1D_ARRAY, templateTex.mips, intFormat, templateTex.width, templateTex.arraysize);
|
||||
gl.glTextureStorage2DEXT(tex, eGL_TEXTURE_1D_ARRAY, templateTex.mips, intFormat, templateTex.width, templateTex.arraysize);
|
||||
break;
|
||||
}
|
||||
case eResType_TextureRect:
|
||||
case eResType_Texture2D:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_2D, tex);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_2D, templateTex.mips, intFormat, templateTex.width, templateTex.height);
|
||||
gl.glTextureStorage2DEXT(tex, eGL_TEXTURE_2D, templateTex.mips, intFormat, templateTex.width, templateTex.height);
|
||||
break;
|
||||
}
|
||||
case eResType_Texture2DArray:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_2D_ARRAY, tex);
|
||||
gl.glTexStorage3D(eGL_TEXTURE_2D_ARRAY, templateTex.mips, intFormat, templateTex.width, templateTex.height, templateTex.arraysize);
|
||||
gl.glTextureStorage3DEXT(tex, eGL_TEXTURE_2D_ARRAY, templateTex.mips, intFormat, templateTex.width, templateTex.height, templateTex.arraysize);
|
||||
break;
|
||||
}
|
||||
case eResType_Texture2DMS:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_2D_MULTISAMPLE, tex);
|
||||
gl.glTexStorage2DMultisample(eGL_TEXTURE_2D_MULTISAMPLE, templateTex.msSamp, intFormat, templateTex.width, templateTex.height, GL_TRUE);
|
||||
gl.glTextureStorage2DMultisampleEXT(tex, eGL_TEXTURE_2D_MULTISAMPLE, templateTex.msSamp, intFormat, templateTex.width, templateTex.height, GL_TRUE);
|
||||
break;
|
||||
}
|
||||
case eResType_Texture2DMSArray:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_2D_MULTISAMPLE_ARRAY, tex);
|
||||
gl.glTexStorage3DMultisample(eGL_TEXTURE_2D_MULTISAMPLE_ARRAY, templateTex.msSamp, intFormat, templateTex.width, templateTex.height, templateTex.arraysize, GL_TRUE);
|
||||
gl.glTextureStorage3DMultisampleEXT(tex, eGL_TEXTURE_2D_MULTISAMPLE_ARRAY, templateTex.msSamp, intFormat, templateTex.width, templateTex.height, templateTex.arraysize, GL_TRUE);
|
||||
break;
|
||||
}
|
||||
case eResType_Texture3D:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_3D, tex);
|
||||
gl.glTexStorage3D(eGL_TEXTURE_3D, templateTex.mips, intFormat, templateTex.width, templateTex.height, templateTex.depth);
|
||||
gl.glTextureStorage3DEXT(tex, eGL_TEXTURE_3D, templateTex.mips, intFormat, templateTex.width, templateTex.height, templateTex.depth);
|
||||
break;
|
||||
}
|
||||
case eResType_TextureCube:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_CUBE_MAP, tex);
|
||||
gl.glTexStorage2D(eGL_TEXTURE_CUBE_MAP, templateTex.mips, intFormat, templateTex.width, templateTex.height);
|
||||
gl.glTextureStorage2DEXT(tex, eGL_TEXTURE_CUBE_MAP, templateTex.mips, intFormat, templateTex.width, templateTex.height);
|
||||
break;
|
||||
}
|
||||
case eResType_TextureCubeArray:
|
||||
{
|
||||
gl.glBindTexture(eGL_TEXTURE_CUBE_MAP_ARRAY, tex);
|
||||
gl.glTexStorage3D(eGL_TEXTURE_CUBE_MAP_ARRAY, templateTex.mips, intFormat, templateTex.width, templateTex.height, templateTex.arraysize);
|
||||
gl.glTextureStorage3DEXT(tex, eGL_TEXTURE_CUBE_MAP_ARRAY, templateTex.mips, intFormat, templateTex.width, templateTex.height, templateTex.arraysize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ struct GLResourceRecord : public ResourceRecord
|
||||
void VerifyDataType(GLenum target)
|
||||
{
|
||||
#if !defined(RELEASE)
|
||||
if(target == eGL_NONE) return; // target == GL_NONE means ARB_dsa, target was omitted
|
||||
if(datatype == eGL_NONE)
|
||||
datatype = TextureBinding(target);
|
||||
else
|
||||
|
||||
@@ -136,6 +136,7 @@ void EmulateUnsupportedFunctions(GLHookSet *hooks)
|
||||
EMULATE_UNSUPPORTED(glClearNamedFramebufferfv)
|
||||
EMULATE_UNSUPPORTED(glClearNamedFramebufferfi)
|
||||
EMULATE_UNSUPPORTED(glBlitNamedFramebuffer)
|
||||
EMULATE_UNSUPPORTED(glVertexArrayElementBuffer);
|
||||
EMULATE_UNSUPPORTED(glVertexArrayVertexBuffers)
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user