Reintroducing type parameters for vertex data
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import Common;
|
||||
import MaterialParameter;
|
||||
import Scene;
|
||||
import LightEnv;
|
||||
|
||||
//interface IMaterial
|
||||
//{
|
||||
// associatedtype BRDF: IBRDF;
|
||||
// static BRDF prepare(MaterialParameter input);
|
||||
//};
|
||||
interface IMaterial
|
||||
{
|
||||
associatedtype BRDF: IBRDF;
|
||||
BRDF prepare(MaterialParameter input);
|
||||
};
|
||||
struct MaterialResources
|
||||
{
|
||||
Texture2D textureArray[512];
|
||||
|
||||
@@ -2,7 +2,7 @@ import Common;
|
||||
import VertexData;
|
||||
import MaterialParameter;
|
||||
|
||||
struct StaticMeshVertexData
|
||||
struct StaticMeshVertexData : IVertexData
|
||||
{
|
||||
float uint16ToFloat(uint16_t value)
|
||||
{
|
||||
@@ -34,5 +34,3 @@ struct StaticMeshVertexData
|
||||
StructuredBuffer<uint16_t> color;
|
||||
StructuredBuffer<uint16_t> texCoords[MAX_TEXCOORDS];
|
||||
};
|
||||
layout(set=1)
|
||||
ParameterBlock<StaticMeshVertexData> pVertexData;
|
||||
|
||||
@@ -6,7 +6,9 @@ struct VertexInput
|
||||
uint instanceId: SV_InstanceID;
|
||||
}
|
||||
|
||||
//interface IVertexData
|
||||
//{
|
||||
// VertexAttributes getAttributes(uint index);
|
||||
//};
|
||||
interface IVertexData
|
||||
{
|
||||
VertexAttributes getAttributes(uint index);
|
||||
};
|
||||
layout(set = 1)
|
||||
ParameterBlock<IVertexData> pVertexData;
|
||||
@@ -3,7 +3,7 @@ import MaterialParameter;
|
||||
import LightEnv;
|
||||
import Scene;
|
||||
import RayTracingData;
|
||||
import StaticMeshVertexData;
|
||||
import VertexData;
|
||||
import Material;
|
||||
import MATERIAL_FILE_NAME;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user