mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-30 20:52:11 +01:00
[dxbc] Fix incorrect pointer type when loading from baked ICBs
This commit is contained in:
parent
2166769096
commit
f8392b4f83
@ -4309,21 +4309,19 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxbcRegisterPointer DxbcCompiler::emitGetImmConstBufPtr(
|
DxbcRegisterPointer DxbcCompiler::emitGetImmConstBufPtr(
|
||||||
const DxbcRegister& operand) {
|
const DxbcRegister& operand) {
|
||||||
DxbcRegisterInfo ptrInfo;
|
|
||||||
ptrInfo.type.ctype = DxbcScalarType::Float32;
|
|
||||||
ptrInfo.type.ccount = 4;
|
|
||||||
ptrInfo.type.alength = 0;
|
|
||||||
|
|
||||||
DxbcRegisterPointer result;
|
|
||||||
result.type.ctype = ptrInfo.type.ctype;
|
|
||||||
result.type.ccount = ptrInfo.type.ccount;
|
|
||||||
|
|
||||||
const DxbcRegisterValue constId
|
const DxbcRegisterValue constId
|
||||||
= emitIndexLoad(operand.idx[0]);
|
= emitIndexLoad(operand.idx[0]);
|
||||||
|
|
||||||
if (m_immConstBuf != 0) {
|
if (m_immConstBuf != 0) {
|
||||||
|
DxbcRegisterInfo ptrInfo;
|
||||||
|
ptrInfo.type.ctype = DxbcScalarType::Uint32;
|
||||||
|
ptrInfo.type.ccount = 4;
|
||||||
|
ptrInfo.type.alength = 0;
|
||||||
ptrInfo.sclass = spv::StorageClassPrivate;
|
ptrInfo.sclass = spv::StorageClassPrivate;
|
||||||
|
|
||||||
|
DxbcRegisterPointer result;
|
||||||
|
result.type.ctype = ptrInfo.type.ctype;
|
||||||
|
result.type.ccount = ptrInfo.type.ccount;
|
||||||
result.id = m_module.opAccessChain(
|
result.id = m_module.opAccessChain(
|
||||||
getPointerTypeId(ptrInfo),
|
getPointerTypeId(ptrInfo),
|
||||||
m_immConstBuf, 1, &constId.id);
|
m_immConstBuf, 1, &constId.id);
|
||||||
@ -4332,8 +4330,15 @@ namespace dxvk {
|
|||||||
const std::array<uint32_t, 2> indices =
|
const std::array<uint32_t, 2> indices =
|
||||||
{{ m_module.consti32(0), constId.id }};
|
{{ m_module.consti32(0), constId.id }};
|
||||||
|
|
||||||
|
DxbcRegisterInfo ptrInfo;
|
||||||
|
ptrInfo.type.ctype = DxbcScalarType::Float32;
|
||||||
|
ptrInfo.type.ccount = 4;
|
||||||
|
ptrInfo.type.alength = 0;
|
||||||
ptrInfo.sclass = spv::StorageClassUniform;
|
ptrInfo.sclass = spv::StorageClassUniform;
|
||||||
|
|
||||||
|
DxbcRegisterPointer result;
|
||||||
|
result.type.ctype = ptrInfo.type.ctype;
|
||||||
|
result.type.ccount = ptrInfo.type.ccount;
|
||||||
result.id = m_module.opAccessChain(
|
result.id = m_module.opAccessChain(
|
||||||
getPointerTypeId(ptrInfo),
|
getPointerTypeId(ptrInfo),
|
||||||
m_constantBuffers.at(Icb_BindingSlotId).varId,
|
m_constantBuffers.at(Icb_BindingSlotId).varId,
|
||||||
|
@ -31,11 +31,15 @@ const std::string g_vertexShaderCode =
|
|||||||
" float4 pos : SV_POSITION;\n"
|
" float4 pos : SV_POSITION;\n"
|
||||||
" float4 color : COLOR;\n"
|
" float4 color : COLOR;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
|
"static const float4 g_pos[] = {\n"
|
||||||
|
" float4(-0.25f, -0.15f, 0.0f, 1.0f),\n"
|
||||||
|
" float4(-0.50f, -0.65f, 0.0f, 1.0f),\n"
|
||||||
|
" float4(-0.75f, -0.15f, 0.0f, 1.0f) };\n"
|
||||||
"vs_out main(float4 vsIn : IN_POSITION,\n"
|
"vs_out main(float4 vsIn : IN_POSITION,\n"
|
||||||
" uint vid : SV_VERTEXID,\n"
|
" uint vid : SV_VERTEXID,\n"
|
||||||
" uint iid : SV_INSTANCEID) {\n"
|
" uint iid : SV_INSTANCEID) {\n"
|
||||||
" vs_out result;\n"
|
" vs_out result;\n"
|
||||||
" result.pos = vsIn;\n"
|
" result.pos = g_pos[vid];\n"
|
||||||
" result.color.x = buf[vid].x;\n"
|
" result.color.x = buf[vid].x;\n"
|
||||||
" result.color.y = buf[iid * 3].y;\n"
|
" result.color.y = buf[iid * 3].y;\n"
|
||||||
" result.color.z = buf[0].z;\n"
|
" result.color.z = buf[0].z;\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user