This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "SRDescriptors.h" | |
#include "../GPU/DescriptorStorage.h" | |
#include "../Log/Log.h" | |
#include "../Math/Bit.h" | |
#include "../Parallel/Threading.h" | |
#include <algorithm> | |
#include <cstdint> | |
#include <cstring> | |
namespace SecretGame::GFX::SRDescriptors { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DirectXMath.h> | |
inline DirectX::XMVECTOR Vector4TransformRM(DirectX::XMVECTOR v, const DirectX::XMMATRIX &m) { | |
// XMVector4Transform doesn't work since the matrix is row-major (dot) and DirectXMath expects column-major (mul, mad). | |
#if defined(_XM_SSE_INTRINSICS_) | |
// XMVector4Transform uses 11 instructions, and XMMatrixTranspose uses 8. This uses 15. | |
// r0x | r0y | r1z | r1w | |
DirectX::XMVECTOR x0y0z1w1 = _mm_shuffle_ps(m.r[0], m.r[1], _MM_SHUFFLE(3, 2, 1, 0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spv::Function* SpirvShaderTranslator::CreateCubeFunction() { | |
auto& b = *builder_; | |
spv::Block* function_block = nullptr; | |
auto function = b.makeFunctionEntry(spv::NoPrecision, vec4_float_type_, | |
"cube", {vec4_float_type_}, | |
{{spv::NoPrecision}}, &function_block); | |
auto src = function->getParamId(0); | |
// The source parameter is ordered as .yxzz. | |
const unsigned int src_i_x = 1, src_i_y = 0, src_i_z = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loc_823F5744: | |
lwz r10, 0(r22) | |
r10 = boxLeft | |
mr r5, r17 | |
r5 (memcpy size) = microWidth << log2bpp | |
lwz r11, 0(r21) | |
r11 = pointX | |
add r10, r10, r31 | |
r10 = srcX | |
add r11, r11, r31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reconstructed for Xenia by Triang3l. | |
DWORD D3D::AlignTextureDimensions(DWORD * pWidth, DWORD * pHeight, DWORD * pDepth, | |
DWORD BitsPerPixel, DWORD GpuFormat, DWORD GpuDimension, BOOL Tiled) { | |
DWORD widthAlignmentBlocks = 32; | |
DWORD heightAlignmentBlocks = (GpuDimension == GPU_DIMENSION_1D ? 1 : 32); | |
DWORD depthAlignment = (GpuDimension == GPU_DIMENSION_3D ? 4 : 1); | |
DWORD blockWidth, blockHeight; | |
D3D::BlockSizeOfGpuFormat(GpuFormat, &blockWidth, &blockHeight); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Decompiled for Xenia by Triang3l. | |
DWORD XGSurfaceSize(DWORD Width, DWORD Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSampleType) { | |
Format = (D3DFORMAT) ((DWORD) Format & 63); | |
if (MultiSampleType >= D3DMULTISAMPLE_2_SAMPLES /* 1 */) { | |
Height *= 2; | |
} | |
if (MultiSampleType == D3DMULTISAMPLE_4_SAMPLES /* 2 */) { | |
Width *= 2; | |
} | |
DWORD bytesPerPixel = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data:824AA378 .long aFmt_1_reverse # "FMT_1_REVERSE" | |
.data:824AA37C .long aFmt_1 # "FMT_1" | |
.data:824AA380 .long aFmt_8 # "FMT_8" | |
.data:824AA384 .long aFmt_1_5_5_5 # "FMT_1_5_5_5" | |
.data:824AA388 .long aFmt_5_6_5 # "FMT_5_6_5" | |
.data:824AA38C .long aFmt_6_5_5 # "FMT_6_5_5" | |
.data:824AA390 .long aFmt_8_8_8_8 # "FMT_8_8_8_8" | |
.data:824AA394 .long aFmt_2_10_10_10 # "FMT_2_10_10_10" | |
.data:824AA398 .long aFmt_8_a # "FMT_8_A" | |
.data:824AA39C .long aFmt_8_b # "FMT_8_B" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data:824AA378 .long aFmt_1_reverse # "FMT_1_REVERSE" | |
.rdata:82072C88 _g_FormatTable_D3D__3QBGB:.byte 0 | |
.rdata:82072C89 .byte 1 | |
.data:824AA37C .long aFmt_1 # "FMT_1" | |
.rdata:82072C8A .byte 0 | |
.rdata:82072C8B .byte 1 | |
.data:824AA380 .long aFmt_8 # "FMT_8" | |
.rdata:82072C8C .byte 0x20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps_3_0 | |
dcl_cube s0 | |
dcl_2d s1 | |
dcl_2d s2 | |
dcl_2d s3 | |
dcl_2d s4 | |
dcl_2d s5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DxbcShaderTranslator::CompletePixelShader_DepthTo24Bit() { | |
// Unpack the depth format. | |
shader_code_.push_back(ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_AND) | | |
ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(9)); | |
shader_code_.push_back( | |
EncodeVectorMaskedOperand(D3D10_SB_OPERAND_TYPE_TEMP, 0b0010, 1)); | |
shader_code_.push_back(system_temp_depth_); | |
system_constants_used_ |= 1ull << kSysConst_Flags_Index; | |
shader_code_.push_back(EncodeVectorSelectOperand( | |
D3D10_SB_OPERAND_TYPE_CONSTANT_BUFFER, kSysConst_Flags_Comp, 3)); |
OlderNewer