in PCDX11Material allow streamdecl overrides from MeshTab0Ext128Sub10

This commit is contained in:
Adam Jensen 2022-06-06 10:02:12 +01:00
parent 443064d8fa
commit 25709de13a
4 changed files with 28 additions and 9 deletions

View File

@ -0,0 +1,9 @@
#pragma once
namespace cdc {
class CommonStreamDecl {
// TODO
};
}

View File

@ -2,6 +2,7 @@
#include "PCDX11Material.h"
#include "PCDX11RenderDevice.h"
#include "PCDX11StateManager.h"
#include "PCDX11StreamDecl.h" // for CommonStreamDecl to PCDX11StreamDecl cast
#include "RenderMesh.h"
#include "surfaces/PCDX11Texture.h"
#include "buffers/PCDX11UberConstantBuffer.h"
@ -316,13 +317,17 @@ PCDX11StreamDecl *PCDX11Material::buildStreamDecl015(
auto vertexShader = (*vertexTable)[vertexIndex];
stateManager->setVertexShader(vertexShader);
VertexAttributeLayoutB *layoutB = nullptr; // TODO
PCDX11StreamDecl *streamDecl = renderDevice->streamDeclCache.buildStreamDecl(
layoutA,
layoutB,
(flags >> 3) & 1,
&vertexShader->m_sub);
auto *streamDecl = static_cast<PCDX11StreamDecl*>(ext128sub10->streamDecls24[subMaterialIndex]);
if (!streamDecl) {
VertexAttributeLayoutB *layoutB = nullptr; // TODO
streamDecl = renderDevice->streamDeclCache.buildStreamDecl(
layoutA,
layoutB,
(flags >> 3) & 1,
&vertexShader->m_sub);
}
// TODO
if (true)

View File

@ -119,6 +119,11 @@ void PCDX11RenderModel::resConstruct() {
tab0Ext128Byte = new MeshTab0Ext128[count0];
for (uint32_t i=0; i<count0; i++) {
// TODO
// HACK
tab0Ext128Byte[i].material = nullptr;
for (uint32_t j=0; j<16; j++)
tab0Ext128Byte[i].sub10.streamDecls24[j] = nullptr;
}
tab0Ext16Byte = new MeshTab0Ext16[count0];
for (uint32_t i=0; i<count0; i++) {

View File

@ -2,7 +2,7 @@
#include <cstdint>
#include <d3d11.h>
#include "PCDX11InternalResource.h"
// #include "CommonStreamDecl.h"
#include "CommonStreamDecl.h"
#include "shaders/PCDX11Shader.h"
class D3D11_INPUT_ELEMENT_DESC;
@ -14,8 +14,8 @@ class PCDX11RenderDevice;
class PCDX11VertexBuffer;
class PCDX11StreamDecl :
public PCDX11InternalResource
// public CommonStreamDecl
public PCDX11InternalResource,
public CommonStreamDecl
{
public:
PCDX11StreamDecl(