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

dxCreateRenderTarget consumes more video memory than it should be #3394

Closed
1 task done
MortimerSapkowski opened this issue May 17, 2024 · 1 comment
Closed
1 task done
Labels
bug Something isn't working

Comments

@MortimerSapkowski
Copy link

MortimerSapkowski commented May 17, 2024

Describe the bug

Creating render target of size 1024*1024 with 32bit (surfaceFormat = a8r8g8b8) per pixel should consume 4MB of video memory. And for 8bit per pixel (surfaceFormat = 8a) should take 1MB
But in fact 32bit takes 8MB and 8bit takes 5MB

Steps to reproduce

local mem_used = dxGetStatus().VideoMemoryUsedByRenderTargets
dxCreateRenderTarget(1024, 1024, "a8")
print(tostring(dxGetStatus().VideoMemoryUsedByRenderTargets - mem_used) .. " MB")

mem_used = dxGetStatus().VideoMemoryUsedByRenderTargets
dxCreateRenderTarget(1024, 1024, "a8r8g8b8")
print(tostring(dxGetStatus().VideoMemoryUsedByRenderTargets - mem_used) .. " MB")

Version

Client: Multi Theft Auto v1.6-release-22388
Server: v1.6-release-22388

Additional context

image

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@MortimerSapkowski MortimerSapkowski added the bug Something isn't working label May 17, 2024
@tederis
Copy link
Collaborator

tederis commented May 24, 2024

That's because internally MTA creates a depth-stencil texture for each RT. So, in case of 1024x1024 texture you will have extra 4 MB in an optimistic scenario and plus 2 MB in the pessimistic one.

@tederis tederis closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants