User:ElFarto/OpenGLBM: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
ElFarto (talk | contribs)
No edit summary
ElFarto (talk | contribs)
No edit summary
Line 1: Line 1:
This is my idea for an new OpenGL API. It's not real, nor is it ever likely to be.
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);
  int64 memorySize = bmGetInteger64(BM_MEMORY_SIZE);
int maxTextureUnits = bmGetInteger(BM_TEXTURE_UNITS);
  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?


//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);
  anti-aliasing levels (0 = 1 sample, 1 = 2 samples, 2 = 4 samples, 3 = 32x CSAA, etc...)
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=
=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);
bmVertexAttribAddress(index, offset);
  bmVertexAttribAddress(index, offset);
bmElementArray(type, offset);
  bmElementArray(type, offset);
bmEnableAttribs(bitmap); //0b101 enables attribute 0 and 2 only
  bmEnableAttribs(bitmap); //0b101 enables attribute 0 and 2 only




=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);
glSetShader(type, offset);
  glSetShader(type, offset);
//functions for getting and setting uniforms
  //functions for getting and setting uniforms
//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
void* bmMapMemory(int64 mem, size); //+flags
  void* bmMapMemory(int64 mem, size); //+flags
bmUnmapMemory(void* addr);
  bmUnmapMemory(void* addr);
//flush commands
  //flush commands




=misc=
=misc=
clear colour/depth/stencil functions
  clear colour/depth/stencil functions
viewport functions //+indexed versions
  viewport functions //+indexed versions
scissor functions
  scissor functions
 
 
provoking vertex
  provoking vertex
 
 
flip page function
  flip page function
 
alpha-to-coverage functions
 


point-sprites?
  alpha-to-coverage functions
 
  point-sprites?


=sync=
=sync=
gpu wait command
  gpu wait command
cpu wait command
  cpu wait command
vsync wait
  vsync wait
flush
  flush
 
 
vertex/texture cache invalidation
  vertex/texture cache invalidation


=timers=
=timers=
Line 92: Line 91:


=queries=
=queries=
conditional rendering
  conditional rendering




Line 101: Line 100:


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




=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
anisotropy
  anisotropy




=surface parameters=
=surface parameters=
type = linear/tiled
  type = linear/tiled
 
 
colourFormat
  colourFormat
colourAddress
  colourAddress
colourPitch
  colourPitch
 
 
depthFormat
  depthFormat
depthAddress
  depthAddress
depthPitch
  depthPitch
 
 
x/y/width/height
  x/y/width/height
 
 
antialias
  antialias

Revision as of 14:40, 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