User:ElFarto/OpenGLBM

From OpenGL Wiki
< User:ElFarto
Revision as of 14:26, 27 September 2011 by ElFarto (talk | contribs)
Jump to navigation Jump to search

This is my idea for an new OpenGL API. It's not real, nor is it ever likely to be.

int64 memorySize = bmGetInteger64(BM_MEMORY_SIZE); int maxTextureUnits = bmGetInteger(BM_TEXTURE_UNITS);

//textures bmTextureParameters(unit, format, layout, remap, mipmap, dimensions, width, height, depth, pitch, address); bmTextureAddressParameters(unit, xwrap, ywrap, zwrap, depthCompare); bmTextureFilterParameters(unit, minFilter, maxFilter, maxAnisotropy);

//surfaces bmColourSurface(index, type, format, width, height, antialiasing, address, pitch); bmDepthSurface(type, format, width, height, antialiasing, address, pitch);

bmBlendMode(index, enabled, rgbEquation, srcRGB, dstRGB, alphaEquation, srcAlpha, dstAlpha); bmStencilOp(frontStencilFail, frontDepthFail, frontDepthPass, backStencilFail, backDepthFail, backDepthPass); bmStencilFunc(frontFunc, frontRef, frontMask, backFunc, backRef, backMask);

bmDepthFunc(enabled, func); bmDepthRange(viewportIndex, near, far);

bmAlphaFunc(enabled, func, ref);//does hardware still have this?

//utility functions bmCalculateSize(format, layout, width, height, depth, mipmaps, antialias, *size, *pitch, *alignment); //do we need a separate function for depth?


anti-aliasing levels (0 = 1 sample, 1 = 2 samples, 2 = 4 samples, 3 = 32x CSAA, etc...)


vertex arrays

bmVertexAttrib(index, components, stride, type, normalise, divisor); bmVertexAttribI(index, components, stride, type, divisor); bmVertexAttribAddress(index, offset); bmElementArray(type, offset); bmEnableAttribs(bitmap); //0b101 enables attribute 0 and 2 only


drawing

bmDrawElements(primtype, count, instances, baseVertex, baseInstance); bmDrawArrays(primtype, count, instances, baseInstance); //indirect functions

shaders

BMShader sh = glCompileShader(shaderType, sourceType, size, *string); glGetShaderUCode(sh, &size, &ucodePtr); glSetShader(type, offset); //functions for getting and setting uniforms //functions for shader subroutines

memory

bmCopyToGPU(void *src, size, int64 dst); //+async version bmCopyFromGPU(int64 src, size, void *dst); //+async version void* bmMapMemory(int64 mem, size); //+flags bmUnmapMemory(void* addr); //flush commands


misc

clear colour/depth/stencil functions viewport functions //+indexed versions scissor functions

provoking vertex

flip page function

alpha-to-coverage functions


point-sprites?

sync

gpu wait command cpu wait command vsync wait flush

vertex/texture cache invalidation

timers

multisampling

transform feedback

tessalation

queries

conditional rendering




texture parameters

format = TEXTURE_R8G8B8A8 layout = linear | tiled remap/component swizzle mipmap levels dimensions/cubemap/type = 1D, 2D, 3D, CUBEMAP, RECTANGLE width/height/depth = setting depth on a 2d texture, makes it a 2d array pitch = step from begining of one row to the next address

compressed parameter or part of format?


texture address parameters

x/y/z wrap modes depth compare mode


texture filter parameters

min filter max filter anisotropy


surface parameters

type = linear/tiled

colourFormat colourAddress colourPitch

depthFormat depthAddress depthPitch

x/y/width/height

antialias