-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix locked array error on texture cleanup #388
base: master
Are you sure you want to change the base?
Fix locked array error on texture cleanup #388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fellow citizen of Nix, one of the admins verify this pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…pth stencils since it's probably more performant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -271,7 +289,7 @@ End Sub | |||
Public Function CreateTextureFromData(ByRef Bytes() As Byte, ByVal Size As Long, ByVal Width As Long, ByVal Height As Long) As Direct3DTexture8 | |||
On Error GoTo ErrHandler | |||
Dim Texture As Direct3DTexture8 | |||
Set Texture = mD3D.CreateTextureFromFileInMemoryEx(device, Bytes(0), UBound(Bytes) + 1, Width, Height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, D3DX_FILTER_LINEAR, D3DX_FILTER_LINEAR, &HFF000000, ByVal 0, ByVal 0) | |||
Set Texture = mD3D.CreateTextureFromFileInMemoryEx(device, Bytes(0), UBound(Bytes) + 1, Width, Height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_FILTER_LINEAR, D3DX_FILTER_LINEAR, &HFF000000, ByVal 0, ByVal 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hay que primero llamar mD3D.CreateTextureFromFileInMemoryEx( ... D3DPOOL_DEFAULT)
y si eso falla llamar con mD3D.CreateTextureFromFileInMemoryEx( ... D3DPOOL_MANAGED)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morgolock cuál sería el razonamiento de esta sugerencia?
Issue relacionado: ao-org/argentum-online-server#578.
En los logs podemos ver que uno de los problemas es que se intenta modificar el array mientras está en uso; esto es porque los bloques
With
toman una referencia del arreglo (en este casosurfaceEntry
), el cual más adelante (enRemoveLRU
) estamos intentando redimensionar.Por otro lado, no hay ninguna razón* para usar
D3DPOOL_DEFAULT
en lugar deD3DPOOL_MANAGED
(referencia), así que lo cambié en los lugares que se estaba usando.* En el caso de las texturas. Para los vertex buffers e index buffers, como usan D3DUSAGE_DYNAMIC, no se puede.