Closed azul3d-bot closed 8 years ago
Issue by slimsag Sunday Dec 28, 2014 at 20:58 GMT Originally opened as https://github.com/azul3d/gfx/issues/83
As of right now State is a ~140 byte structure. Most gfx.Object will utilize the same state (as it lowers the number of state changes).
State
gfx.Object
If we turn Object.State into a pointer instead of a value -- we get the following benefits:
Object.State
gfx.State
sync.Pool
We would turn gfx.State into more traditional objects:
gfx.DefaultState
gfx.NewState()
State.Destroy()
State.Compare
State.Copy
Overall I think this will be a big plus.
Fixed/merged as part of https://github.com/azul3d/engine/issues/1
Issue by slimsag Sunday Dec 28, 2014 at 20:58 GMT Originally opened as https://github.com/azul3d/gfx/issues/83
As of right now
State
is a ~140 byte structure. Mostgfx.Object
will utilize the same state (as it lowers the number of state changes).If we turn
Object.State
into a pointer instead of a value -- we get the following benefits:gfx.State
object's using async.Pool
We would turn
gfx.State
into more traditional objects:gfx.DefaultState
would be replaced bygfx.NewState()
State.Destroy()
would put the object back in thesync.Pool
.State.Compare
) would become pointer receivers.State.Copy
method.Overall I think this will be a big plus.