Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset the PixelUnpackState for replay serialisation of glTexImage* APIs #3113

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

Zorro666
Copy link
Collaborator

@Zorro666 Zorro666 commented Nov 6, 2023

Description

Reset the PixelUnpackState for replay serialisation of the following APIs:

  • glTexImage1D
  • glTexImage2D
  • glTexImage3D
  • glCompressedTexImage1D
  • glCompressedTexImage2D
  • glCompressedTexImage3D

Did NOT add support for non-zero pixels parameter being used as an offset to GL_PIXEL_UNPACK_BUFFER

Notes

Could extend this work by:

  1. support non-zero pixels parameter used as an offset to GL_PIXEL_UNPACK_BUFFER (it looks like it would need capture changes to serialize extra data)
  2. Extend the testing to include more formats, mipmaps, more values of UNPACK_ROW_LENGTH and to cover the glCompressedTexImage?D APIs

Testing

Added a basic test for to gl_texture_zoo for non-zero UNPACK_ROW_LENGTH for the following APIs:

  • glTexImage1D
  • glTexImage2D
  • glTexImage3D

The test fails before the code change and passes afterwards.

Background

Looking at GL APIs related to storing pixel data into textures discovered the following:

GL APIs affected by glPixelStore

  • glTexImage1D
  • glTexImage2D
  • glTexImage3D
  • glCompressedTexImage1D
  • glCompressedTexImage2D
  • glCompressedTexImage3D
  • glTexSubImage1D
  • glTexSubImage2D
  • glTexSubImage3D
  • glCompressedTexSubImage1D
  • glCompressedTexSubImage2D
  • glCompressedTexSubImage1D

APIs that handle glPixelStore parameters during RenderDoc replay

  • glTexSubImage1D
  • glTexSubImage2D
  • glTexSubImage3D
  • glCompressedTexSubImage1D
  • glCompressedTexSubImage2D
  • glCompressedTexSubImage1D

These APIs also DO support pixels being an offset into GL_PIXEL_UNPACK_BUFFER

APIs that do not handle glPixelStore parameters during RenderDoc replay

  • glTexImage1D
  • glTexImage2D
  • glTexImage3D
  • glCompressedTexImage1D
  • glCompressedTexImage2D
  • glCompressedTexImage3D

These APIs also DO NOT support the pixels parameter being a non-zero offset into GL_PIXEL_UNPACK_BUFFER (which is supported by the replay serialisation of the other GL texture storage APIs).

Covers:
glTexImage1D
glTexImage2D
glTexImage3D
The pixel data has been serialized as pure bytes with no padding or packing.

It was already handled in:
glTexSubImage1D
glTexSubImage2D
glTexSubImage3D

glCompressedTexSubImage1D
glCompressedTexSubImage2D
glCompressedTexSubImage1D

Apply the same handling to:
glTexImage1D
glTexImage2D
glTexImage3D

glCompressedTexImage1D
glCompressedTexImage2D
glCompressedTexImage3D

These APIs do not handle a non-zero offset with the GL_PIXEL_UNPACK_BUFFER
@Zorro666 Zorro666 merged commit b804e99 into baldurk:v1.x Nov 6, 2023
16 checks passed
@Zorro666 Zorro666 deleted the small-fixes branch November 6, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant