User:ElFarto/OpenGLBM: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
ElFarto (talk | contribs)
Created page with "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_TEXTU..."
 
ElFarto (talk | contribs)
No edit summary
Line 31: Line 31:




vertex arrays
=vertex arrays=
=============
bmVertexAttrib(index, components, stride, type, normalise, divisor);
bmVertexAttrib(index, components, stride, type, normalise, divisor);
bmVertexAttribI(index, components, stride, type, divisor);
bmVertexAttribI(index, components, stride, type, divisor);
Line 40: Line 39:




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


shaders
=shaders=
=======
BMShader sh = glCompileShader(shaderType, sourceType, size, *string);
BMShader sh = glCompileShader(shaderType, sourceType, size, *string);
glGetShaderUCode(sh, &size, &ucodePtr);
glGetShaderUCode(sh, &size, &ucodePtr);
Line 54: Line 51:
//functions for shader subroutines
//functions for shader subroutines


memory
=memory=
======
bmCopyToGPU(void *src, size, int64 dst); //+async version
bmCopyToGPU(void *src, size, int64 dst); //+async version
bmCopyFromGPU(int64 src, size, void *dst); //+async version
bmCopyFromGPU(int64 src, size, void *dst); //+async version
Line 63: Line 59:




misc
=misc=
====
clear colour/depth/stencil functions
clear colour/depth/stencil functions
viewport functions //+indexed versions
viewport functions //+indexed versions
Line 78: Line 73:
point-sprites?
point-sprites?


sync
=sync=
====
gpu wait command
gpu wait command
cpu wait command
cpu wait command
Line 87: Line 81:
vertex/texture cache invalidation
vertex/texture cache invalidation


timers
=timers=
======




multisampling
=multisampling=
=============




transform feedback
=transform feedback=
==================


tessalation
=tessalation=
===========


queries
=queries=
=======
conditional rendering
conditional rendering


Line 111: Line 100:




texture parameters
=texture parameters=
==================
format = TEXTURE_R8G8B8A8
format = TEXTURE_R8G8B8A8
layout = linear | tiled
layout = linear | tiled
Line 125: Line 113:




texture address parameters
=texture address parameters=
==========================
x/y/z wrap modes
x/y/z wrap modes
depth compare mode
depth compare mode




texture filter parameters
=texture filter parameters=
=========================
min filter
min filter
max filter
max filter
Line 138: Line 124:




surface parameters
=surface parameters=
==================
type = linear/tiled
type = linear/tiled



Revision as of 14:26, 27 September 2011

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