mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
VideoBackends / VideoCommon: add new uniform buffer object for custom shader materials (slot 3, geometry shader buffer moves to slot 4 if available)
This commit is contained in:
@ -93,7 +93,7 @@ ShaderCode GenerateGeometryShaderCode(APIType api_type, const ShaderHostConfig&
|
||||
|
||||
// uniforms
|
||||
if (api_type == APIType::OpenGL || api_type == APIType::Vulkan)
|
||||
out.Write("UBO_BINDING(std140, 3) uniform GSBlock {{\n");
|
||||
out.Write("UBO_BINDING(std140, 4) uniform GSBlock {{\n");
|
||||
else
|
||||
out.Write("cbuffer GSBlock {{\n");
|
||||
|
||||
|
@ -52,7 +52,7 @@ ShaderCode GenVertexShader(APIType api_type, const ShaderHostConfig& host_config
|
||||
|
||||
if (vertex_loader)
|
||||
{
|
||||
out.Write("UBO_BINDING(std140, 3) uniform GSBlock {{\n");
|
||||
out.Write("UBO_BINDING(std140, 4) uniform GSBlock {{\n");
|
||||
out.Write("{}", s_geometry_shader_uniforms);
|
||||
out.Write("}};\n");
|
||||
}
|
||||
@ -84,7 +84,7 @@ SSBO_BINDING(1) readonly restrict buffer Vertices {{
|
||||
// D3D12 uses a root constant for this uniform, since it changes with every draw.
|
||||
// D3D11 doesn't currently support dynamic vertex loader, and we'll have to figure something
|
||||
// out for it if we want to support it in the future.
|
||||
out.Write("UBO_BINDING(std140, 4) uniform DX_Constants {{\n"
|
||||
out.Write("UBO_BINDING(std140, 5) uniform DX_Constants {{\n"
|
||||
" uint base_vertex;\n"
|
||||
"}};\n\n"
|
||||
"uint GetVertexBaseOffset(uint vertex_id) {{\n"
|
||||
|
@ -96,14 +96,14 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const ShaderHostConfig& ho
|
||||
|
||||
if (uid_data->vs_expand != VSExpand::None)
|
||||
{
|
||||
out.Write("UBO_BINDING(std140, 3) uniform GSBlock {{\n");
|
||||
out.Write("UBO_BINDING(std140, 4) uniform GSBlock {{\n");
|
||||
out.Write("{}", s_geometry_shader_uniforms);
|
||||
out.Write("}};\n");
|
||||
|
||||
if (api_type == APIType::D3D)
|
||||
{
|
||||
// D3D doesn't include the base vertex in SV_VertexID
|
||||
out.Write("UBO_BINDING(std140, 4) uniform DX_Constants {{\n"
|
||||
out.Write("UBO_BINDING(std140, 5) uniform DX_Constants {{\n"
|
||||
" uint base_vertex;\n"
|
||||
"}};\n\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user