gpu icon indicating copy to clipboard operation
gpu copied to clipboard

Design

Open recp opened this issue 2 years ago • 0 comments

Currently APIs are individual call

Maybe we can also provide structs to reduce func calls

for instance

GPUSetFrontFace(rce, GPUWindingCounterClockwise);
GPUSetCullMode(rce, GPUCullModeBack);
GPUSetRenderState(rce, renderState);
GPUSetDepthStencil(rce, depthStencilState);

GPUSetVertexBuffer(rce, dynamicUniformBuffer, uniformBufferOffset, BufferIndexUniforms);
GPUSetFragmentBuffer(rce, dynamicUniformBuffer, uniformBufferOffset, BufferIndexUniforms);
GPUSetFragmentTexture(rce, _colorMap, TextureIndexColor);

like

GPUNewRenderCommandEncoder(cmdb, pass, (Type){
      .frontFace    = GPUWindingCounterClockwise,
      .cullMode     = GPUCullModeBack,
      .renderState  = renderState,
      .depthStencil = depthStencilState,
      .vertexBuffer = {
        .buf = dynamicUniformBuffer,
        .off = uniformBufferOffset, 
        .idx = BufferIndexUniforms,
      },
      .fragmentBuffer = {
        .buf = dynamicUniformBuffer,
        .off = uniformBufferOffset,
        .idx = BufferIndexUniforms,
      }
    });

or with small structs...

GPUNewRenderCommandEncoder(cmdb, pass, (Type){
      .frontFace    = GPUWindingCounterClockwise,
      .cullMode     = GPUCullModeBack,
      .renderState  = renderState,
      .depthStencil = depthStencilState,
    });

both can co-exist, this is just an example

recp avatar Sep 14 '23 20:09 recp