Normalize builtin forward shader bindings
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// XC_BUILTIN_FORWARD_LIT_OPENGL_PS
|
||||
#version 430
|
||||
layout(binding = 1) uniform sampler2D uBaseColorTexture;
|
||||
layout(binding = 2) uniform sampler2D uShadowMapTexture;
|
||||
layout(binding = 0) uniform sampler2D uBaseColorTexture;
|
||||
layout(binding = 1) uniform sampler2D uShadowMapTexture;
|
||||
|
||||
layout(std140, binding = 1) uniform PerObjectConstants {
|
||||
layout(std140, binding = 0) uniform PerObjectConstants {
|
||||
mat4 gProjectionMatrix;
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
@@ -12,11 +12,11 @@ layout(std140, binding = 1) uniform PerObjectConstants {
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(std140, binding = 2) uniform MaterialConstants {
|
||||
layout(std140, binding = 1) uniform MaterialConstants {
|
||||
vec4 gBaseColorFactor;
|
||||
};
|
||||
|
||||
layout(std140, binding = 3) uniform ShadowReceiverConstants {
|
||||
layout(std140, binding = 2) uniform ShadowReceiverConstants {
|
||||
mat4 gWorldToShadowMatrix;
|
||||
vec4 gShadowBiasAndTexelSize;
|
||||
vec4 gShadowOptions;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// XC_BUILTIN_FORWARD_LIT_VULKAN_PS
|
||||
#version 450
|
||||
layout(set = 3, binding = 0) uniform texture2D uBaseColorTexture;
|
||||
layout(set = 4, binding = 0) uniform sampler uLinearSampler;
|
||||
layout(set = 6, binding = 0) uniform texture2D uShadowMapTexture;
|
||||
layout(set = 7, binding = 0) uniform sampler uShadowMapSampler;
|
||||
layout(set = 2, binding = 0) uniform texture2D uBaseColorTexture;
|
||||
layout(set = 3, binding = 0) uniform sampler uLinearSampler;
|
||||
layout(set = 5, binding = 0) uniform texture2D uShadowMapTexture;
|
||||
layout(set = 6, binding = 0) uniform sampler uShadowMapSampler;
|
||||
|
||||
layout(set = 1, binding = 0, std140) uniform PerObjectConstants {
|
||||
layout(set = 0, binding = 0, std140) uniform PerObjectConstants {
|
||||
mat4 gProjectionMatrix;
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
@@ -14,11 +14,11 @@ layout(set = 1, binding = 0, std140) uniform PerObjectConstants {
|
||||
vec4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
layout(set = 2, binding = 0, std140) uniform MaterialConstants {
|
||||
layout(set = 1, binding = 0, std140) uniform MaterialConstants {
|
||||
vec4 gBaseColorFactor;
|
||||
};
|
||||
|
||||
layout(set = 5, binding = 0, std140) uniform ShadowReceiverConstants {
|
||||
layout(set = 4, binding = 0, std140) uniform ShadowReceiverConstants {
|
||||
mat4 gWorldToShadowMatrix;
|
||||
vec4 gShadowBiasAndTexelSize;
|
||||
vec4 gShadowOptions;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// XC_BUILTIN_FORWARD_LIT_D3D12_PS
|
||||
Texture2D gBaseColorTexture : register(t1);
|
||||
SamplerState gLinearSampler : register(s1);
|
||||
Texture2D gShadowMapTexture : register(t2);
|
||||
SamplerState gShadowMapSampler : register(s2);
|
||||
Texture2D gBaseColorTexture : register(t0);
|
||||
SamplerState gLinearSampler : register(s0);
|
||||
Texture2D gShadowMapTexture : register(t1);
|
||||
SamplerState gShadowMapSampler : register(s1);
|
||||
|
||||
cbuffer PerObjectConstants : register(b1) {
|
||||
cbuffer PerObjectConstants : register(b0) {
|
||||
float4x4 gProjectionMatrix;
|
||||
float4x4 gViewMatrix;
|
||||
float4x4 gModelMatrix;
|
||||
@@ -13,11 +13,11 @@ cbuffer PerObjectConstants : register(b1) {
|
||||
float4 gMainLightColorAndFlags;
|
||||
};
|
||||
|
||||
cbuffer MaterialConstants : register(b2) {
|
||||
cbuffer MaterialConstants : register(b1) {
|
||||
float4 gBaseColorFactor;
|
||||
};
|
||||
|
||||
cbuffer ShadowReceiverConstants : register(b3) {
|
||||
cbuffer ShadowReceiverConstants : register(b2) {
|
||||
float4x4 gWorldToShadowMatrix;
|
||||
float4 gShadowBiasAndTexelSize;
|
||||
float4 gShadowOptions;
|
||||
|
||||
@@ -13,13 +13,13 @@ Shader "Builtin Forward Lit"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Resources
|
||||
{
|
||||
PerObjectConstants (ConstantBuffer, 1, 0) [Semantic(PerObject)]
|
||||
MaterialConstants (ConstantBuffer, 2, 0) [Semantic(Material)]
|
||||
BaseColorTexture (Texture2D, 3, 0) [Semantic(BaseColorTexture)]
|
||||
LinearClampSampler (Sampler, 4, 0) [Semantic(LinearClampSampler)]
|
||||
ShadowReceiverConstants (ConstantBuffer, 5, 0) [Semantic(ShadowReceiver)]
|
||||
ShadowMapTexture (Texture2D, 6, 0) [Semantic(ShadowMapTexture)]
|
||||
ShadowMapSampler (Sampler, 7, 0) [Semantic(ShadowMapSampler)]
|
||||
PerObjectConstants (ConstantBuffer, 0, 0) [Semantic(PerObject)]
|
||||
MaterialConstants (ConstantBuffer, 1, 0) [Semantic(Material)]
|
||||
BaseColorTexture (Texture2D, 2, 0) [Semantic(BaseColorTexture)]
|
||||
LinearClampSampler (Sampler, 3, 0) [Semantic(LinearClampSampler)]
|
||||
ShadowReceiverConstants (ConstantBuffer, 4, 0) [Semantic(ShadowReceiver)]
|
||||
ShadowMapTexture (Texture2D, 5, 0) [Semantic(ShadowMapTexture)]
|
||||
ShadowMapSampler (Sampler, 6, 0) [Semantic(ShadowMapSampler)]
|
||||
}
|
||||
HLSLPROGRAM
|
||||
#pragma vertex MainVS
|
||||
|
||||
@@ -4,7 +4,7 @@ layout(location = 0) in vec3 aPosition;
|
||||
layout(location = 1) in vec3 aNormal;
|
||||
layout(location = 2) in vec2 aTexCoord;
|
||||
|
||||
layout(std140, binding = 1) uniform PerObjectConstants {
|
||||
layout(std140, binding = 0) uniform PerObjectConstants {
|
||||
mat4 gProjectionMatrix;
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
|
||||
@@ -4,7 +4,7 @@ layout(location = 0) in vec3 aPosition;
|
||||
layout(location = 1) in vec3 aNormal;
|
||||
layout(location = 2) in vec2 aTexCoord;
|
||||
|
||||
layout(set = 1, binding = 0, std140) uniform PerObjectConstants {
|
||||
layout(set = 0, binding = 0, std140) uniform PerObjectConstants {
|
||||
mat4 gProjectionMatrix;
|
||||
mat4 gViewMatrix;
|
||||
mat4 gModelMatrix;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// XC_BUILTIN_FORWARD_LIT_D3D12_VS
|
||||
cbuffer PerObjectConstants : register(b1) {
|
||||
cbuffer PerObjectConstants : register(b0) {
|
||||
float4x4 gProjectionMatrix;
|
||||
float4x4 gViewMatrix;
|
||||
float4x4 gModelMatrix;
|
||||
|
||||
Reference in New Issue
Block a user