Skip to content

Commit c00d4f5

Browse files
committed
- rhi: refactor defs, remove pipeline constants
1 parent 30900e6 commit c00d4f5

File tree

5 files changed

+78
-146
lines changed

5 files changed

+78
-146
lines changed

core/materialsystem1/Renderers/WGPU/WGPURenderAPI.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -832,16 +832,6 @@ IGPURenderPipelinePtr CWGPURenderAPI::CreateRenderPipeline(const RenderPipelineD
832832
// - primitiveTopology
833833
//
834834

835-
// pipeline-overridable constants
836-
Array<WGPUConstantEntry> rhiVertexPipelineConstants(PP_SL);
837-
Array<WGPUConstantEntry> rhiFragmentPipelineConstants(PP_SL);
838-
839-
for (const PipelineConst& constant : pipelineDesc.vertex.constants)
840-
rhiVertexPipelineConstants.append({ nullptr, _WSTR(constant.name), constant.value});
841-
842-
for (const PipelineConst& constant : pipelineDesc.fragment.constants)
843-
rhiFragmentPipelineConstants.append({ nullptr, _WSTR(constant.name), constant.value });
844-
845835
WGPURenderPipelineDescriptor rhiRenderPipelineDesc = {};
846836
if (pipelineLayout)
847837
{
@@ -929,8 +919,6 @@ IGPURenderPipelinePtr CWGPURenderAPI::CreateRenderPipeline(const RenderPipelineD
929919
rhiVertexState.entryPoint = _WSTR(pipelineDesc.vertex.shaderEntryPoint);
930920
rhiVertexState.bufferCount = rhiVertexBufferLayoutList.numElem();
931921
rhiVertexState.buffers = rhiVertexBufferLayoutList.ptr();
932-
rhiVertexState.constants = rhiVertexPipelineConstants.ptr();
933-
rhiVertexState.constantCount = rhiVertexPipelineConstants.numElem();
934922

935923
if (!rhiVertexState.module)
936924
{
@@ -1020,8 +1008,6 @@ IGPURenderPipelinePtr CWGPURenderAPI::CreateRenderPipeline(const RenderPipelineD
10201008
rhiFragmentState.entryPoint = _WSTR(pipelineDesc.fragment.shaderEntryPoint);
10211009
rhiFragmentState.targetCount = rhiColorTargets.numElem();
10221010
rhiFragmentState.targets = rhiColorTargets.ptr();
1023-
rhiFragmentState.constants = rhiFragmentPipelineConstants.ptr();
1024-
rhiFragmentState.constantCount = rhiFragmentPipelineConstants.numElem();
10251011

10261012
if(!rhiFragmentState.module)
10271013
{
@@ -1260,14 +1246,7 @@ IGPUComputePipelinePtr CWGPURenderAPI::CreateComputePipeline(const ComputePipeli
12601246
}
12611247
}
12621248

1263-
Array<WGPUConstantEntry> rhiComputePipelineConstants(PP_SL);
1264-
1265-
for (const PipelineConst& constant : pipelineDesc.constants)
1266-
rhiComputePipelineConstants.append({ nullptr, _WSTR(constant.name), constant.value});
1267-
12681249
WGPUComputePipelineDescriptor rhiComputePipelineDesc = {};
1269-
rhiComputePipelineDesc.compute.constantCount = rhiComputePipelineConstants.numElem();
1270-
rhiComputePipelineDesc.compute.constants = rhiComputePipelineConstants.ptr();
12711250
rhiComputePipelineDesc.compute.entryPoint = _WSTR(pipelineDesc.shaderEntryPoint);
12721251
rhiComputePipelineDesc.compute.module = rhiComputeShaderModule;
12731252

public/materialsystem1/MeshBuilder.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,15 @@ inline void CMeshBuilder::TexturedQuad3(const Vector3D& v1, const Vector3D& v2,
694694
}
695695
}
696696

697+
// EVertAttribFormat
698+
static const int s_attributeSize[] =
699+
{
700+
0,
701+
sizeof(ubyte),
702+
sizeof(half),
703+
sizeof(float)
704+
};
705+
697706
inline void CMeshBuilder::CopyVertData(VertData& vert, bool isNormal)
698707
{
699708
if(!vert.count)

public/materialsystem1/RenderDefs.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,6 @@ struct RenderDrawCmd
246246
return *this;
247247
}
248248

249-
RenderDrawCmd& SetInstanceFormat(const MeshInstanceFormat& meshInst)
250-
{
251-
instanceInfo.instFormat.name = meshInst.name;
252-
instanceInfo.instFormat.formatId = meshInst.nameHash;
253-
instanceInfo.instFormat.layout = meshInst.layout;
254-
return *this;
255-
}
256-
257249
// DEPRECATED
258250
RenderDrawCmd& SetInstanceFormat(const IVertexFormat* vertFormat)
259251
{

public/materialsystem1/renderers/ShaderAPICaps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "imaging/textureformats.h"
1010

1111
static constexpr const int MAX_BINDGROUPS = 4;
12+
static constexpr const int MAX_BINDGROUP_BINDINGS = 64; // be in this limit or use bindless
1213
static constexpr const int MAX_RENDERTARGETS = 8;
1314
static constexpr const int MAX_VERTEXSTREAM = 8;
1415
static constexpr const int MAX_TEXTUREUNIT = 16;

0 commit comments

Comments
 (0)