mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 00:42:48 +00:00
remove some stuff
This commit is contained in:
parent
2d15c78ce7
commit
772acf3175
@ -1,7 +1,5 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include "shader_recompiler/runtime_info.h"
|
||||
#pragma clang optimize off
|
||||
#include <span>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
@ -14,6 +12,7 @@
|
||||
#include "shader_recompiler/frontend/translate/translate.h"
|
||||
#include "shader_recompiler/ir/basic_block.h"
|
||||
#include "shader_recompiler/ir/program.h"
|
||||
#include "shader_recompiler/runtime_info.h"
|
||||
#include "video_core/amdgpu/types.h"
|
||||
|
||||
namespace Shader::Backend::SPIRV {
|
||||
|
@ -2,12 +2,11 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "shader_recompiler/ir/attribute.h"
|
||||
#include "shader_recompiler/runtime_info.h"
|
||||
#pragma clang optimize off
|
||||
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
|
||||
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
|
||||
#include "shader_recompiler/ir/attribute.h"
|
||||
#include "shader_recompiler/ir/patch.h"
|
||||
#include "shader_recompiler/runtime_info.h"
|
||||
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
|
||||
@ -230,14 +229,6 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index) {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
if (IR::IsTessCoord(attr)) {
|
||||
const u32 component = attr == IR::Attribute::TessellationEvaluationPointU ? 0 : 1;
|
||||
const auto component_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[1]);
|
||||
const auto pointer{
|
||||
ctx.OpAccessChain(component_ptr, ctx.tess_coord, ctx.ConstU32(component))};
|
||||
return ctx.OpLoad(ctx.F32[1], pointer);
|
||||
}
|
||||
|
||||
if (IR::IsParam(attr)) {
|
||||
const u32 index{u32(attr) - u32(IR::Attribute::Param0)};
|
||||
const auto& param{ctx.input_params.at(index)};
|
||||
@ -312,9 +303,6 @@ Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, u32 comp) {
|
||||
ctx.u32_zero_value);
|
||||
case IR::Attribute::PrimitiveId:
|
||||
case IR::Attribute::TessPatchIdInVgt: // TODO see why this isnt DCEd
|
||||
ASSERT(ctx.info.l_stage == LogicalStage::Geometry ||
|
||||
ctx.info.l_stage == LogicalStage::TessellationControl ||
|
||||
ctx.info.l_stage == LogicalStage::TessellationEval);
|
||||
return ctx.OpLoad(ctx.U32[1], ctx.primitive_id);
|
||||
case IR::Attribute::InvocationId:
|
||||
ASSERT(ctx.info.l_stage == LogicalStage::Geometry ||
|
||||
|
@ -394,20 +394,6 @@ void EmitContext::DefineInputs() {
|
||||
DefineVariable(U32[1], spv::BuiltIn::PatchVertices, spv::StorageClass::Input);
|
||||
primitive_id = DefineVariable(U32[1], spv::BuiltIn::PrimitiveId, spv::StorageClass::Input);
|
||||
|
||||
#if 0
|
||||
for (u32 i = 0; i < IR::NumParams; i++) {
|
||||
const IR::Attribute param{IR::Attribute::Param0 + i};
|
||||
if (!info.loads.GetAny(param)) {
|
||||
continue;
|
||||
}
|
||||
const u32 num_components = info.loads.NumComponents(param);
|
||||
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
||||
const Id type{TypeArray(F32[4], ConstU32(32u))};
|
||||
const Id id{DefineInput(type, i)};
|
||||
Name(id, fmt::format("in_attr{}", i));
|
||||
input_params[i] = {id, input_f32, F32[1], 4};
|
||||
}
|
||||
#else
|
||||
const u32 num_attrs = runtime_info.hs_info.ls_stride >> 4;
|
||||
if (num_attrs > 0) {
|
||||
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||
@ -416,27 +402,12 @@ void EmitContext::DefineInputs() {
|
||||
input_attr_array = DefineInput(patch_array_type, 0);
|
||||
Name(input_attr_array, "in_attrs");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case LogicalStage::TessellationEval: {
|
||||
tess_coord = DefineInput(F32[3], std::nullopt, spv::BuiltIn::TessCoord);
|
||||
primitive_id = DefineVariable(U32[1], spv::BuiltIn::PrimitiveId, spv::StorageClass::Input);
|
||||
|
||||
#if 0
|
||||
for (u32 i = 0; i < IR::NumParams; i++) {
|
||||
const IR::Attribute param{IR::Attribute::Param0 + i};
|
||||
if (!info.loads.GetAny(param)) {
|
||||
continue;
|
||||
}
|
||||
const u32 num_components = info.loads.NumComponents(param);
|
||||
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
||||
const Id type{TypeArray(F32[4], ConstU32(32u))};
|
||||
const Id id{DefineInput(type, i)};
|
||||
Name(id, fmt::format("in_attr{}", i));
|
||||
input_params[i] = {id, input_f32, F32[1], 4};
|
||||
}
|
||||
#else
|
||||
const u32 num_attrs = runtime_info.vs_info.hs_output_cp_stride >> 4;
|
||||
if (num_attrs > 0) {
|
||||
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||
@ -445,7 +416,6 @@ void EmitContext::DefineInputs() {
|
||||
input_attr_array = DefineInput(patch_array_type, 0);
|
||||
Name(input_attr_array, "in_attrs");
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 patch_base_location = runtime_info.vs_info.hs_output_cp_stride >> 4;
|
||||
for (size_t index = 0; index < 30; ++index) {
|
||||
@ -517,20 +487,6 @@ void EmitContext::DefineOutputs() {
|
||||
Decorate(output_tess_level_inner, spv::Decoration::Patch);
|
||||
}
|
||||
|
||||
#if 0
|
||||
for (u32 i = 0; i < IR::NumParams; i++) {
|
||||
const IR::Attribute param{IR::Attribute::Param0 + i};
|
||||
if (!info.stores.GetAny(param)) {
|
||||
continue;
|
||||
}
|
||||
const u32 num_components = info.stores.NumComponents(param);
|
||||
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
||||
const Id type{TypeArray(F32[4], ConstU32(runtime_info.hs_info.output_control_points))};
|
||||
const Id id{DefineOutput(type, i)};
|
||||
Name(id, fmt::format("out_attr{}", i));
|
||||
output_params[i] = {id, output_f32, F32[1], 4};
|
||||
}
|
||||
#else
|
||||
const u32 num_attrs = runtime_info.hs_info.hs_output_cp_stride >> 4;
|
||||
if (num_attrs > 0) {
|
||||
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||
@ -540,7 +496,6 @@ void EmitContext::DefineOutputs() {
|
||||
output_attr_array = DefineOutput(patch_array_type, 0);
|
||||
Name(output_attr_array, "out_attrs");
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 patch_base_location = runtime_info.hs_info.hs_output_cp_stride >> 4;
|
||||
for (size_t index = 0; index < 30; ++index) {
|
||||
|
@ -1,9 +1,8 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include "shader_recompiler/runtime_info.h"
|
||||
#pragma clang optimize off
|
||||
#include "shader_recompiler/frontend/translate/translate.h"
|
||||
#include "shader_recompiler/ir/reg.h"
|
||||
#include "shader_recompiler/runtime_info.h"
|
||||
|
||||
namespace Shader::Gcn {
|
||||
|
||||
|
@ -126,13 +126,7 @@ void Translator::EmitPrologue() {
|
||||
case LogicalStage::TessellationControl: {
|
||||
ir.SetVectorReg(IR::VectorReg::V1,
|
||||
ir.GetAttributeU32(IR::Attribute::PackedHullInvocationInfo));
|
||||
// Test
|
||||
// ir.SetPatch(IR::Patch::TessellationLodLeft, ir.Imm32(1.0f));
|
||||
// ir.SetPatch(IR::Patch::TessellationLodTop, ir.Imm32(1.0f));
|
||||
// ir.SetPatch(IR::Patch::TessellationLodRight, ir.Imm32(1.0f));
|
||||
// ir.SetPatch(IR::Patch::TessellationLodBottom, ir.Imm32(1.0f));
|
||||
// ir.SetPatch(IR::Patch::TessellationLodInteriorU, ir.Imm32(1.0f));
|
||||
// ir.SetPatch(IR::Patch::TessellationLodInteriorV, ir.Imm32(1.0f));
|
||||
// TODO need PrimitiveId also like TES?
|
||||
break;
|
||||
}
|
||||
case LogicalStage::TessellationEval:
|
||||
|
Loading…
Reference in New Issue
Block a user