Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
174 user(s) are online (105 user(s) are browsing Forums)

Members: 0
Guests: 174

more...

Headlines

Forum Index


Board index » All Posts (Karlos)




Re: BSzili port requests
Just popping in
Just popping in


@BSzili

Can you repeat your 2048x2048 texture tests on a 16 bit screenmode?

Go to top


Re: BSzili port requests
Just popping in
Just popping in


@BSzili

Can you repory your system config, including all versions of installed Warp3D components? Another developer is reporting that the same debug driver crashes his system.

Go to top


Re: BSzili port requests
Just popping in
Just popping in


@BSzili

Good.

Can you provide me with the debug output from the driver? I'm keen to see how the allocator is behaving this close to the limits of the underlying bitmap implementation.

The driver should be logging data to the debug buffer.

Cheers

Go to top


Re: BSzili port requests
Just popping in
Just popping in


Just a note regarding my earlier post. If you are using a RadeonHD based graphics card, the updated W3D_Picasso96.library is not relevant to your configuration.

The changes are relevant o R100, R200, Voodoo and Permedia configurations only.

Go to top


Re: BSzili port requests
Just popping in
Just popping in


Hi,

I didn't read the entire thread, but the early posts suggesting problems regarding the use of large textures ( > 1024 pixels wide) might be related to a bug reported here:

http://forum.hyperion-entertainment.biz/viewtopic.php?f=14&t=2955

There is a debug-build version 53.11 W3D_Picasso96.library available here which may (or may not) fix the issue but should help determine what's going on in the low level VRAM allocator for non SI cards (they use their own allocator):

http://extropia.co.uk/warp3d/

Username: warp3dbeta

For the password, PM me.

Go to top


Re: let's deal with remaining bugs in dopus5 together
Just popping in
Just popping in


I tracked down the implementation of the function in question in the source:

void __asm __saveds L_FreeFiletype(register __a0 Cfg_Filetype *type)
{
        
short a;

        if (!
type) return;

        
// Remove filetype from list
        
if (type->node.ln_Succ && type->node.ln_Pred)
                
Remove(&type->node);

        
// Free data
        
L_FreeMemH(type->recognition);
        
L_FreeMemH(type->icon_path);
        if (
type->actions)
        {
                for (
a=0;a<16;a++)
                        
L_FreeMemH(type->actions[a]);
                
L_FreeMemH(type->actions);
        }
        
config_free_functions(&type->function_list);
        
L_FreeMemH(type);
}


As you can see, Remove() is invoked on the node. And, as I suggested my previous post, the kernel does indeed make changes to the node structure. From the Remove() documentation:

*   NOTES
*        As of V50this function modifies the ln_Succ and ln_Pred
*        pointers to prevent disaster from Removing a node twice.
*   
EXAMPLE
*    \* If traversing 'list' with GetHead/GetSucc and nodes may at
*     * some point be Remove()edit is not permitted to read any of
*     * the node linkage fields after it has left the list, as removing
*     * the node invalidates the list pointersthereforeit is 
*     * necessary to determine the successor before removal.
*     * 
Notewhen using these functionsdon't check the 
*     * currentNode->ln_Succ, just for currentNode != NULL.
*     *\



So yes, it's completely illegal to access ln_Succ *after* calling the function. Whatever value they had previously is overwritten by the call to execsg's Remove().

Go to top


Re: let's deal with remaining bugs in dopus5 together
Just popping in
Just popping in


Quote:

LiveForIt wrote:
@Karlos

We need to assume it does what code imply it does, free one node, not a pool of memory. Or else the code is buggy and broken, and some one needs to fix it.


I didn't say it freed a pool of memory. I said it (probably) freed the node. But it could do anything. The point is, the original code took the ln_Succ node's value *before* calling the L_FreeFiletype() on the node and not *after*. The main reason you do something like that before calling any function is because you know that member isn't going to be valid *after*.

Also, the whole argument about multiple threads and what not is irrelevant. Accessing the properties of any structure that has been freed is flat out wrong, regardless of whether you are in the same thread of execution or a different one.

Quote:
If if assume that this ia isolated list where only this program has control of what happens, then we can assume that address of ln_succ will be untouch after the current node is freed.


Resized Image


You can assume no such thing!

What if L_FreeFiletype() zeroes out the member pointers or assigns them some special "marked free for reallocation" value or anything? What if during the process, the kernel fills the space that was allocated with some special value when it's freed? And yes, there are debug builds which do this sort of thing to help developers identify the specific type of lunacy you are suggesting can be assumed ;)

Bottom line: you have no idea that it's safe to access the node after calling L_FreeFiletype() and the only reasonable thing you can infer from the original code is that it isn't.


Edited by Karlos on 2013/6/2 10:31:52
Go to top


Re: let's deal with remaining bugs in dopus5 together
Just popping in
Just popping in


Quote:

tonyw wrote:
@Karlos:

Karl, I was not Removing the node in the snippet of code that I proposed. I do know better than that!

[edit]
Sorry, I didn't realise that "L_FreeFiletype()" might free the Node in the argument.
If it does, then the "Next" node must be saved before the call, as you so rightly point out.
[/edit]


The point is that neither of us know what side effects L_FreeFiletype() have. However, my assumption that it frees the node and thus renders it's structure members invalid is based on what I would say is reasonable inference, when you look at the original code:

// Free filetypes in list 
for (node=list->filetype_list.lh_Head;node->ln_Succ;) 

  
next=node->ln_Succ
  
L_FreeFiletype((Cfg_Filetype *)node); 
  
node=next
}


The comment, function name and "get the successor node before" strategy strongly suggests that this is the case.


Edited by Karlos on 2013/6/2 12:16:40
Go to top


Re: let's deal with remaining bugs in dopus5 together
Just popping in
Just popping in


Quote:

LiveForIt wrote:
@Karlos
Is it dangerous?


Without question.

Quote:
Only if the list is shared, we don't know that from the what is posted here.


You don't need to know whether the list is shared or not to understand that referencing already freed memory is a big mistake. Look at the original code: there is a rock-solid reason that the next pointer is assigned the value of ln_Succ *before* the call to L_FreeFiletype() on the node.

Maybe you'll be lucky most of the time and the ln_Succ member at whatever address/offset the original node existed at a moment ago is still valid but to assume so would be foolhardy at best. Especially when you consider that OS4 is moving away from casual uses of Forbid() to prevent other tasks from pre-empting your code away and implements fast-turnaround slab allocators for structures. The chances that the memory your node was just in a moment ago will be recycled for someone else's use is likely greater than it was in 3.x.


-edit-

Quote:
If its NOT a OS structure it should be protected by Mutex.


I have to ask... really?

Look, Mutexes and Semaphores are there to ensure a resource is properly accessed in a concurrent environment. They are not there to protect you from playing Russian Roulette with pointers.

You have no idea what L_FreeFiletype() is going to do to the memory your node lives in. Probably, it will just free it, but it could do anything. Suppose these nodes are created by an allocator function. For all you know, the code might manage a private pool of them. You have no way of knowing what this function does to the memory occupied by the node. It might re-assign them to some value, resulting in a DSI when you try to dereference the pointer you read back. Or maybe it just zeroes it, in which case, your loop finishes early without processing the rest of the list which results in a memory leak (and perhaps other resources too).


Edited by Karlos on 2013/6/1 20:16:48
Go to top


Re: let's deal with remaining bugs in dopus5 together
Just popping in
Just popping in


Quote:

tonyw wrote:

The loop should read:

for (node = IExec->GetHead(filetype_list;
node != NULL;
node = IExec->GetSucc(node))
{
L_FreeFiletype((Cfg_Filetype *)node);
}


This code is dangerous. You will note that the iteration statement of the for() loop uses the node pointer after you have freed it. Other problems aside, the original code had some protection against this. There are other loop constructs that would be better suited, but for minimal changes:

for (node IExec->GetHead(filetype_list); node != NULL;) {
  
next IExec->GetSucc(node);
  
L_FreeFiletype((Cfg_Filetype *)node);
  
node next;
}


Go to top


Re: radeonHD video hw acceleration
Just popping in
Just popping in


@thellier

W3D_SetDrawRegionTexture() is not implemented and moreover is removed in the latest versions of the main library and drivers. Calling it due to an outdated interface definition is probably not a great idea.

Go to top


Re: radeonHD video hw acceleration
Just popping in
Just popping in


@Thellier

Colourspace conversion from YUV <-> RGB can be achieved with matrices.

For normalized (0.0 - 1.0) values:
|Y|   | 0.29900  0.58700  0.11400 | |R|
|
U| = |-0.14713 -0.28886  0.43600 | |G|
|
V|   | 0.61500 -0.51499 -0.10001 | |B|

|
R|   | 1.00000  0.00000  1.13983 | |Y|
|
G| = | 1.00000 -0.39465 -0.58060 | |U|
|
B|   | 1.00000  2.03211  0.00000 | |V|


It's the sort of thing AltiVec should be able to do pretty well if used properly.

Go to top


Re: AmigaOS4 Updates (Warp3D) & AmiDARK Engine : Anisotropic Filter
Just popping in
Just popping in


@freddix

It will require an API change for Warp3D. I've submitted an RFC for the necessary changes (which includes adding developer support for 16-bit Z buffer selection) and I'm waiting to hear back. I can't just change the API because I feel like it.

Go to top


Re: AmigaOS4 Updates (Warp3D) & AmiDARK Engine : Anisotropic Filter
Just popping in
Just popping in


Quote:

freddix wrote:

float anisotropy;glGetFloatv (GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &anisotropy);
and
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)AnisotropicVal );



In Warp3D, the anisotropy value will most likely be an enumeration that describes the maximum number of samples, rather than a GL-style floating point value, perhaps something like this:

enum {
W3D_ANISOTROPY_1X,
W3D_ANISOTROPY_2X,
W3D_ANISOTROPY_4X,
W3D_ANISOTROPY_8X,
W3D_ANISOTROPY_16X
};

It will be MiniGL's job to worry about float -> enum selection.

Go to top


Re: AmigaOS4 Updates (Warp3D) & AmiDARK Engine : Anisotropic Filter
Just popping in
Just popping in


Quote:

freddix wrote:
After several test and checkings, these shots don't show the Anisotropic filtering in actions.
In fact the latest MiniGL doesnt handle Anisotropic Filtering.
That's a true pain.
I can turn it on/off using the OpenGL commands for but, they have no impact on render.
(that mean that these informations are not sent to Warp3D or not handled this way).

I had to make a workaround that modify the ENV file "on the fly" to turn it on/off and it's a TRUE PAIN!
We need MiniGL to be updated with the new Warp3D capabilities :)


Actually, to put this feature under developer control will require an update to the Warp3D API*, not just MiniGL.

*addition of new MinFilter enumeration values for anisotropic filtering
*addition of a method to set the degree of anisotropy for a given W3D_Texture

Go to top



TopTop
« 1 (2)




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project