To deepen my knowledge of these APIs.
Here I will post some misc questions on "cross-API" wrapper. They are supposed to be associated with each other, so I decided unite all in single topic (if moderators will accept this).
My main purpose is to get as much as possible of the features of both APIs using single aproach in my wrapper architecture.
At this moment im trying to find common things in OGL and D3D11 buffer representation.
First issue is binding point. In OGL, parameter "target" may be set as:
GL_ARRAY_BUFFER
GL_ELEMENT_ARRAY_BUFFER
GL_UNIFORM_BUFFER
GL_COPY_READ_BUFFER - what's proper equivalent in d3d11?
GL_COPY_WRITE_BUFFER - what's proper equivalent in d3d11?
GL_PIXEL_PACK_BUFFER - what's proper equivalent in d3d11?
GL_PIXEL_UNPACK_BUFFER - what's proper equivalent in d3d11?
GL_TRANSFORM_FEEDBACK_BUFFER - what's proper equivalent in d3d11? To simplify task I could use special transform feedback object in OGL 4.1+.
GL_TEXTURE_BUFFER - this we omit, it's used with special function glTexBuffer - am I right???
In D3D11 we have D3D11_BUFFER_DESC which has two elements with similar meaning - D3D11_BIND_FLAG and D3D11_RESOURCE_MISC_FLAG (I will get to this much much later, but still)
possible values of D3D11_BIND_FLAG are:
D3D11_BIND_VERTEX_BUFFER
D3D11_BIND_INDEX_BUFFER
D3D11_BIND_CONSTANT_BUFFER
D3D11_BIND_SHADER_RESOURCE
D3D11_BIND_STREAM_OUTPUT
D3D11_BIND_RENDER_TARGET
D3D11_BIND_DEPTH_STENCIL
D3D11_BIND_UNORDERED_ACCESS
D3D11_BIND_DECODER
D3D11_BIND_VIDEO_ENCODER
I ignore last three. They are seemed to be quite tricky and I dont know well how they are working.
Problem is that these flags can be combined, except D3D11_BIND_CONSTANT_BUFFER. But if we do this, we disallow GPU to do smart managing with this buffer. Can I afford this? Are there so many cases when someone prefer to use several flags?
Next thing about buffers is "usage".
D3D11_USAGE_DEFAULT - no problem with this, glBufferData
D3D11_USAGE_IMMUTABLE - this buffer cant be changed after creation. Does glBufferStorage with proper flags do the same? And do these flags really add to performance?
D3D11_USAGE_DYNAMIC - in OGL i would use GL_DYNAMIC_DRAW, however it can be ignored by OGL. Anything elese?
D3D11_USAGE_STAGING - could i use this for transform feedback?