text
stringlengths
1
24.5M
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3d11_1.h> #include <d3dcompiler.h> #include "xenonGpuAbstractLayer.h" #include "xenonGPUConstants.h" #include "dx11Utils.h" class CDX11RenderingWindow; class CDX11SurfaceManager; class CDX11GeometryDrawer; class CDX11TextureManager; class CDX11StateCach...
#include "build.h" #include "xenonGPUUtils.h" #include "dx11FetchLayout.h" #include "dx11MicrocodeShader.h" //#pragma optimize("",off) CDX11FetchLayout::CDX11FetchLayout() : m_numStreams(0) { } CDX11FetchLayout::~CDX11FetchLayout() { } CDX11FetchLayout* CDX11FetchLayout::ExtractFromMicrocode(CDX11MicrocodeShader* ...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> #include "dx11MicrocodeShader.h" /// Layout of data for input assembly /// Extracted from microcode fetch instructions /// NOTE: due to arbitrary vfetches this DOES NOT MAP to normal IA pipeline in DX11 /// (cont) therefore all vertex dat...
#include "build.h" #include "xenonGPUUtils.h" #include "dx11GeometryBuffer.h" #include "dx11Utils.h" //#pragma optimize( "",off ) CDX11GeometryBuffer::CDX11GeometryBuffer( ID3D11Device* dev, ID3D11DeviceContext* context ) : m_device( dev ) , m_mainContext( context ) , m_geometryDataGeneration( 1 ) , m_geometryDat...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> #include "xenonGPUConstants.h" /// Buffer management for the drawable geometry (vertex & index buffers) class CDX11GeometryBuffer { public: CDX11GeometryBuffer( ID3D11Device* dev, ID3D11DeviceContext* context ); ~CDX11GeometryBuffer(); ...
#include "build.h" #include "xenonGPURegisters.h" #include "xenonGPUUtils.h" #include "dx11GeometryDrawer.h" #include "dx11GeometryBuffer.h" #include "dx11MicrocodeShader.h" #include "dx11MicrocodeCache.h" #include "dx11FetchLayout.h" #include "dx11ShaderCache.h" #include "dx11SamplerCache.h" #include "dx11Utils.h" #in...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> #include "xenonGpuAbstractLayer.h" #include "xenonGPUConstants.h" #include "xenonGPUState.h" #include "dx11Utils.h" class CDX11BufferRing; class CDX11MicrocodeCache; class CDX11MicrocodeShader; class CDX11ShaderCache; class CDX11GeometryBu...
#include "build.h" #include "dx11MicrocodeNodes.h" #include "dx11MicrocodeBlocks.h" #include "dx11MicrocodeBlocksTranslator.h" #include "dx11MicrocodeHLSLWriter.h" #include <algorithm> //#pragma optimize( "", off ) using namespace DX11Microcode; //---------------------------------------------------------------------...
#pragma once //---------------------------------------------------------------------------- namespace DX11Microcode { class ExprNode; class Statement; /// Generalized block in the shader class Block { public: enum class EBlockType : uint8 { EXEC, JUMP, CALL, END, // shader end RET, // functi...
#include "build.h" #include "dx11MicrocodeNodes.h" #include "dx11MicrocodeBlocks.h" #include "dx11MicrocodeBlocksTranslator.h" //#pragma optimize( "", off ) using namespace DX11Microcode; BlockTranslator::BlockTranslator() { m_numParamExports = 0; m_numMemoryExports = 0; m_positionExported = 0; } CodeExpr BlockT...
#pragma once #include "xenonGPUMicrocodeConstants.h" #include "xenonGPUMicrocodeTransformer.h" //---------------------------------------------------------------------------- namespace DX11Microcode { class BlockTranslator : public CXenonGPUMicrocodeTransformer::ICodeWriter { public: BlockTranslator(); // blo...
#include "build.h" #include "xenonGPUUtils.h" #include "dx11MicrocodeShader.h" #include "dx11MicrocodeDecompiler.h" #include "dx11MicrocodeCache.h" CDX11MicrocodeCache::CDX11MicrocodeCache() { } CDX11MicrocodeCache::~CDX11MicrocodeCache() { for ( auto it : m_cachedVertexShaders ) delete it.second; for ( auto it ...
#pragma once //---------------------------------------------------------------------------- /// Cache for decompiled microcode class CDX11MicrocodeCache { public: CDX11MicrocodeCache(); ~CDX11MicrocodeCache(); /// Set shader dump path void SetDumpPath( const std::wstring& absPath ); /// Decompile pixel shader ...
#pragma once namespace ucode { #pragma pack( push, 1 ) // Closest AMD doc: // http://developer.amd.com/wordpress/media/2012/10/R600_Instruction_Set_Architecture.pdf // Microcode format differs, but most fields/enums are the same. // This code comes from the freedreno project: // https://github.com/freedreno/f...
#include "build.h" #include "dx11MicrocodeDecompiler.h" #include "dx11MicrocodeConstants.h" //#pragma optimize ("",off) using namespace ucode; // BASED ON THE FOLLOWING: /* * Copyright (c) 2012 Rob Clark <robdclark@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of ...
#pragma once #include "xenonGPUConstants.h" namespace ucode { union instr_fetch_t; union instr_cf_t; } /// Debug (print only) decompiler for Xbox360 shaders class CDX11MicrocodeDecompiler { public: CDX11MicrocodeDecompiler( XenonShaderType shaderType ); ~CDX11MicrocodeDecompiler(); class ICodeWriter { public...
#pragma once //---------------------------------------------------------------------------- namespace DX11Microcode { class IHLSLWriter { public: virtual ~IHLSLWriter() {}; virtual CodeChunk GetExportDest( const ExprWriteExportReg::EExportReg reg ) = 0; virtual CodeChunk GetReg( uint32 regIndex ) = 0; vir...
#include "build.h" #include "dx11MicrocodeNodes.h" #include "dx11MicrocodeHLSLWriter.h" //#pragma optimize( "", off ) using namespace DX11Microcode; //----------------------------------------------------------------------------- static std::string PrintF( const char* txt, ... ) { char buf[ 8192 ]; va_list args; ...
#pragma once #include <atomic> #include "xenonGPUConstants.h" #include "xenonGPUMicrocodeTransformer.h" //---------------------------------------------------------------------------- namespace DX11Microcode { class IHLSLWriter; //---------------------------------------------------------------------------- // ...
#include "build.h" #include "xenonGPUConstants.h" #include "dx11MicrocodeNodes.h" #include "dx11MicrocodeBlocks.h" #include "dx11MicrocodeShader.h" #include <algorithm> CDX11MicrocodeShader::CDX11MicrocodeShader() : m_decompiledShader(nullptr) , m_bIsPixelShader(false) , m_microcodeHash(0) { } CDX11MicrocodeShader...
#pragma once namespace DX11Microcode { class Block; class Shader; class IHLSLWriter; }; /// DX11 shader made out disassembled microcode class CDX11MicrocodeShader { public: CDX11MicrocodeShader(); ~CDX11MicrocodeShader(); /// Get shader hash inline const uint64 GetHash() const { return m_microcodeHash; } //...
#include "build.h" #include "dx11RenderingWindow.h" //#pragma optimize("",off) CDX11RenderingWindow::CDX11RenderingWindow() : m_hThread( NULL ) , m_hWnd( NULL ) , m_isOpened( false ) { // register window class static BOOL sRegisterWindowClass = true; if ( sRegisterWindowClass ) { sRegisterWindowClass = false...
#pragma once #include <Windows.h> /// Rendering window for DX11 based GPU emulation /// NOTE: window runs on yet another thread class CDX11RenderingWindow { public: CDX11RenderingWindow(); ~CDX11RenderingWindow(); // get window handle inline HWND GetWindowHandle() const { return m_hWnd; } // is window opened (...
#include "build.h" #include "xenonGPUUtils.h" #include "xenonGPUTextures.h" #include "dx11SamplerCache.h" //---------------- CDX11SamplerCache::CDX11SamplerCache(ID3D11Device* device) : m_device(device) { } CDX11SamplerCache::~CDX11SamplerCache() { Clear(); } void CDX11SamplerCache::Clear() { for (const auto& it...
#pragma once #include <Windows.h> #include <d3d11.h> #include "xenonGPUConstants.h" class XenonSamplerInfo; //--------------------------------------------------------------------------- /// Cache for sampler objects class CDX11SamplerCache { public: CDX11SamplerCache(ID3D11Device* device); ~CDX11SamplerCache(); ...
#include "build.h" #include "xenonGPUUtils.h" #include "dx11Shader.h" #include "dx11MicrocodeShader.h" #include "dx11ShaderBuilder.h" #include "dx11FetchLayout.h" //--------------------------------------------------------------------------- CDX11VertexShader::CDX11VertexShader() : m_source( nullptr ) , m_vertexShad...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> class CDX11FetchLayout; class CDX11MicrocodeShader; /// Rendering vertex shader (includes the vertex format information) class CDX11VertexShader { public: CDX11VertexShader(); ~CDX11VertexShader(); // drawing context (may affect outcom...
#include "build.h" #include "xenonGPUUtils.h" #include "dx11ShaderBuilder.h" #include "dx11MicrocodeShader.h" #include "dx11MicrocodeNodes.h" #include "dx11MicrocodeHLSLWriter.h" #include "dx11ShaderHLSLWriter.h" #include "shaders/psCommon.fx.h" #include "shaders/vsCommon.fx.h" #include "shaders/instrCommon.fx.h" //#...
#pragma once /// Generate HLSL code for shader class CDX11ShaderHLSLGenerator { public: CDX11ShaderHLSLGenerator(); /// General generation context struct Context { uint32 m_numIncomingInputs; Context() : m_numIncomingInputs( 0 ) {}; }; /// Generate shader code bool GenerateHLSL( const class CDX11Mi...
#include "build.h" #include "xenonGPUUtils.h" #include "dx11MicrocodeShader.h" #include "dx11ShaderCache.h" CDX11ShaderCache::CDX11ShaderCache( ID3D11Device* dev ) : m_device( dev ) { } void CDX11ShaderCache::SetDumpPath( const std::wstring& absPath ) { m_dumpPath = absPath; } CDX11ShaderCache::~CDX11ShaderCache()...
#pragma once #include "dx11Shader.h" /// Cache for shaders class CDX11ShaderCache { public: CDX11ShaderCache( ID3D11Device* dev ); ~CDX11ShaderCache(); /// Set shader dump path void SetDumpPath( const std::wstring& absPath ); /// Get renderable vertex shader for given microcode and drawing context (can return...
#include "build.h" #include "dx11ShaderHLSLWriter.h" CDX11ShaderHLSLWriter::CDX11ShaderHLSLWriter() : m_codeWritePtr( 0 ) , m_indent( 0 ) { m_code[ m_codeWritePtr ] = 0; } CDX11ShaderHLSLWriter::~CDX11ShaderHLSLWriter() { } void CDX11ShaderHLSLWriter::Clear() { m_codeWritePtr = 0; m_code[ m_codeWritePtr ] = 0; ...
#pragma once /// Code writer for HLSL shader class CDX11ShaderHLSLWriter { public: CDX11ShaderHLSLWriter(); ~CDX11ShaderHLSLWriter(); void Clear(); void Indent( const int delta ); void Append( const char* txt ); void Appendf( const char* txt, ... ); const char* c_str() const; private: static const uint32 ...
#include "build.h" #include "dx11Staging.h" //--------------------------------------------------------------------------- CDX11StagingTexture::CDX11StagingTexture() : m_texture( nullptr ) , m_width( 0 ) , m_height( 0 ) , m_dims( 0 ) , m_depth( 0 ) , m_format( DXGI_FORMAT_UNKNOWN ) , m_locked( false ) , m_devi...
#pragma once #include <Windows.h> #include <d3d11.h> //--------------------------------------------------------------------------- /// Staging texture class CDX11StagingTexture { public: ~CDX11StagingTexture(); // get format info inline const DXGI_FORMAT GetFormat() const { return m_format; } inline const uint3...
#include "build.h" #include "dx11StateCache.h" //#pragma optimize( "",off) CDX11StateCache::CDX11StateCache( ID3D11Device* dev, ID3D11DeviceContext* context ) : m_device( dev ) , m_mainContext( context ) { } CDX11StateCache::~CDX11StateCache() { PurgeCache(); } void CDX11StateCache::PurgeCache() { m_dsStates.Cl...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> #include <map> #include "xenonGPUUtils.h" /// State cache template< typename T > class TDX11StateMap { public: typedef uint32 THash; TDX11StateMap() { } ~TDX11StateMap() { Clear(); } inline void Clear() { for ( auto it : m...
#include "build.h" #include "dx11AbstractLayer.h" #include "dx11SurfaceCache.h" //#pragma optimize("",off) //----------------------------------------------------------------------------- CDX11AbstractRenderTarget::CDX11AbstractRenderTarget() : m_texture(nullptr) , m_srv(nullptr) , m_rtv(nullptr) , m_edramPlace...
#pragma once #include <Windows.h> #include <d3d11.h> #include "xenonGPUConstants.h" #include "xenonGPUAbstractLayer.h" /// NOTE: All render targets are in "EDRAM" /// DX11 render target class CDX11AbstractRenderTarget : public IXenonGPUAbstractRenderTarget { public: virtual ~CDX11AbstractRenderTarget(); /// IXen...
#include "build.h" #include "dx11Utils.h" #include "dx11SurfaceManager.h" #include "dx11SurfaceCache.h" #include "dx11SurfaceMemory.h" #include "dx11TextureManager.h" #include "xenonGPUUtils.h" //------------------------------------------------------- bool CDX11SurfaceManager::EDRAMRenderTarget::IsMatching( CDX11Abst...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> #include "xenonGPUConstants.h" #include "xenonGPUUtils.h" #include "dx11Utils.h" class CDX11SurfaceCache; class CDX11SurfaceMemory; class CDX11AbstractTexture; class CDX11AbstractRenderTarget; class CDX11AbstractDepthStencil; /// Manager...
#include "build.h" #include "dx11SurfaceMemory.h" #include "dx11SurfaceCache.h" #include "xenonGPUUtils.h" #include "dx11TextureManager.h" //#pragma optimize("",off) //----------------------------------- CDX11SurfaceMemory::CDX11SurfaceMemory(ID3D11Device* dev, ID3D11DeviceContext* mainContext) : m_device(dev) , m...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> #include "xenonGPUConstants.h" #include "dx11Utils.h" /// EDRAM emulator (10MB or 2048 of 80x16x4 (5120 bytes) tiles) /// The EDRAM operation is simulated by making possible to copy surface into/from EDRAM memory /// thus simulating alias...
#include "build.h" #include "xenonGPUUtils.h" #include "xenonGPUTextures.h" #include "dx11TextureManager.h" #include "dx11Staging.h" #include <xutility> #undef min //#pragma optimize( "", off ) //--------------------------------------------------------------------------- CDX11AbstractSurface::CDX11AbstractSurface() ...
#pragma once #include <Windows.h> #include <d3d11.h> #include "xenonGPUConstants.h" #include "xenonGPUAbstractLayer.h" #include "xenonGPUTextures.h" //--------------------------------------------------------------------------- class CDX11StagingTexture; class CDX11StagingTextureCache; //---------------------------...
#include "build.h" #include "dx11Utils.h" //#pragma optimize( "", off ) //----------------- CDX11ComputeShader::CDX11ComputeShader( const char* name ) : m_shader( nullptr ) , m_name( name ) { } CDX11ComputeShader::~CDX11ComputeShader() { // release shader resource if ( m_shader ) { m_shader->Release(); m_s...
#pragma once #include <Windows.h> #include <d3d11.h> #include <d3dcompiler.h> //----------------- // helper class for compute shaders class CDX11ComputeShader { public: CDX11ComputeShader( const char* name ); ~CDX11ComputeShader(); // get shader object inline ID3D11ComputeShader* GetShader() const { return m_sh...
#include "build.h" #include "xenonAudio.h" namespace xenon { Audio::Audio(runtime::Symbols& symbols, const launcher::Commandline& commandline) { // register memory locations for memory mapped access symbols.RegisterMemoryIO(0x7FEA1804, (runtime::TGlobalMemReadFunc)&ReadAudioWord, (runtime::TGlobalMemWriteFunc)&...
#pragma once #include "../host_core/blockAllocator.h" #include "../host_core/bitset.h" namespace xenon { // emulated Audio device class Audio { public: Audio(runtime::Symbols& symbols, const launcher::Commandline& commandline); ~Audio(); private: // IO to/from the audio device static void WriteAudioWor...
#include "build.h" #include "xenonLib.h" #include "xenonBindings.h" namespace xenon { namespace lib { namespace binding { //--------------------------------------------------------------------------- IFunctionCallLogger* FunctionInterface::st_Logger = nullptr; FunctionInterface::FunctionInterface(con...
#pragma once #include "xenonLib.h" #include "../host_core/runtimeSymbols.h" namespace xenon { namespace lib { namespace binding { //---- enum class FunctionArgumentType { Generic, FPU, }; template<typename T> struct FunctionArgumentTypeSelector {}; // type selector for differ...
#include "build.h" #include "xenonCPU.h" #include "xenonCPUDevice.h" namespace cpu { CpuRegs::CpuRegs() : RegisterBank( &xenon::CPU_RegisterBankInfo::GetInstance() ) , RES( nullptr ) , INT(nullptr) { const auto size = (ptrdiff_t)((char*)&RES - (char*)&LR); memset(&LR, 0, size); } uint64 CpuRegs::ReturnF...
#pragma once #include <math.h> #include <stdint.h> #include <intsafe.h> #include <limits> #include "../host_core/runtimeRegisterBank.h" #include "../host_core/runtimeImageInfo.h" #include "../host_core/runtimeExceptions.h" #undef min #undef max namespace cpu { // use the processor intrinsics if possible #define U...
#include "build.h" #include "xenonCPUDevice.h" #define ADD_REG( name, bitSize, regType ) AddRootRegister( regType, #name, bitSize, (uint32)&regs->##name ) #define ADD_CHILD_REG( parent, name, bitSize, bitOffset, regType ) AddChildRegister( regType, #parent, #name, bitSize, bitOffset ) namespace xenon { //---- CPU...
#pragma once #include "../host_core/runtimeCPU.h" namespace xenon { /// cpu bank info class CPU_RegisterBankInfo : public runtime::RegisterBankInfo { public: static CPU_RegisterBankInfo& GetInstance(); private: CPU_RegisterBankInfo(); }; /// cpu description, never freed class CPU_PowerPC : public runtime...
#include "build.h" #include "xenonLibNatives.h" #include "xenonFileSystem.h" #include "xenonFileSystemDevices.h" #include "../host_core/launcherUtils.h" #include "../host_core/launcherCommandline.h" namespace xenon { //---- FileSystemEntry::FileSystemEntry(Kernel* kernel, const char* virtualPath, const wchar_t* ph...
#pragma once #include "xenonKernel.h" namespace native { class IFileSystem; } namespace xenon { class FileSystemEntry; class IFileSystemDevice; /// file system mode enum EFileMode { FileMode_ReadOnly = 1, FileMode_ReadWrite = 2, FileMode_Append = 4, }; //----- /// file interface class IFile : p...
#include "build.h" #include "xenonLibNatives.h" #include "xenonFileSystem.h" #include "xenonFileSystemDevices.h" #include "xenonFileSystemFiles.h" #include "../host_core/launcherUtils.h" #include "../host_core/nativeFileSystem.h" namespace xenon { //----------- FileSystemDevice_PathRedirection::FileSystemDevice_Pa...
#pragma once #include "xenonKernel.h" #include "xenonFileSystem.h" namespace native { class IFileSystem; } namespace xenon { //---------- class FileSystemDevice_PathRedirection : public IFileSystemDevice { public: FileSystemDevice_PathRedirection( Kernel* kernel, native::IFileSystem* nativeFileSystem, const...
#include "build.h" #include "xenonLibNatives.h" #include "xenonFileSystem.h" #include "xenonFileSystemFiles.h" #include "../host_core/nativeFileSystem.h" namespace xenon { //----- FileNative::FileNative(Kernel* kernel, const class FileSystemEntry* entry, class IFileSystemDevice* device, native::IFile* nativeFile)...
#pragma once #include "xenonKernel.h" #include "xenonFileSystem.h" namespace native { class IFile; } namespace xenon { //---------- class FileNative : public IFile { public: FileNative(Kernel* kernel, const class FileSystemEntry* entry, class IFileSystemDevice* device, native::IFile* nativeFile); virtual ...
#include "build.h" #include "xenonGPU.h" #include "xenonGPUThread.h" #include "xenonGPUExecutor.h" #include "dx11AbstractLayer.h" CXenonGPU::CXenonGPU(const launcher::Commandline& cmdLine) : m_abstractLayer( nullptr ) , m_executor( nullptr) , m_thread(nullptr) { // create rendering abstraction layer m_abstractLa...
#pragma once class IXenonGPUAbstractLayer; class CXenonGPUThread; class CXenonGPUExecutor; #include "xenonGPUCommandBuffer.h" namespace launcher { class Commandline; } /// GPU emulation class CXenonGPU { public: CXenonGPU(const launcher::Commandline& cmdLine); /// Request a trace dump of next frame void Reques...
#pragma once #include "xenonGPUConstants.h" #include "xenonGPUState.h" /// Helper objects class IXenonGPUAbstractRenderTarget; class IXenonGPUAbstractDepthStencil; class IXenonGPUDumpWriter; struct XenonTextureInfo; class XenonSamplerInfo; /// Helper layer to translate native GPU command into more abstract stuff tha...
#include "build.h" #include "xenonLibNatives.h" #include "xenonGPUCommandBuffer.h" #include "xenonCPU.h" #include "xenonMemory.h" //------------------------------------- //#define DUMP_COMMAND_BUFFER //------------------------------------- CXenonGPUCommandBufferReader::CXenonGPUCommandBufferReader() : m_bufferBase...
#pragma once #include <atomic> /// Reader helper for command buffer class CXenonGPUCommandBufferReader { public: CXenonGPUCommandBufferReader(); CXenonGPUCommandBufferReader(const uint32* bufferBase, const uint32 bufferSize, const uint32 readStartIndex, const uint32 readEndIndex); /// Get we read data ? inline c...
#pragma once enum class XenonGPUEndianFormat : uint32 { FormatUnspecified = 0, Format8in16 = 1, Format8in32 = 2, Format16in32 = 3, }; enum class XenonGPUEndianFormat128 : uint32 { FormatUnspecified = 0, Format8in16 = 1, Format8in32 = 2, Format16in32 = 3, Format8in64 = 4, Format8in128 = 5, }; enum class Xen...
#include "build.h" #include "xenonGPUDumpFormat.h" const uint32 CXenonGPUDumpFormat::FILE_MAGIC = 'GPUD'; const uint32 CXenonGPUDumpFormat::FILE_VERSION = 1; CXenonGPUDumpFormat::CXenonGPUDumpFormat() { } bool CXenonGPUDumpFormat::Load( const std::wstring& path, uint64& memoryDumpOffset ) { // open file FILE* f = ...
#pragma once /// Format of GPU dump file class CXenonGPUDumpFormat { public: #pragma pack( push, 4 ) struct Block { char m_tag[16]; // block tag (primary, indirect, etc) uint32 m_firstSubBlock; // first sub block uint32 m_numSubBlocks; // number of sub blocks uint32 m_firstPacket; // first pack...
#pragma once /// Dump writer for xenon GPU trace class IXenonGPUDumpWriter { public: /// Create a dump file, automatic file naming static IXenonGPUDumpWriter* Create(); // Close the file and finish the dump virtual void Close() = 0; /// Block (recursive, info only) virtual void BeginBlock( const char* tag, uin...
#include "build.h" #include "xenonGPUDumpFormat.h" #include "xenonGPUDumpWriter.h" #include "xenonGPUDumpWriterImpl.h" //#pragma optimize ("" , off) IXenonGPUDumpWriter* IXenonGPUDumpWriter::Create() { // get date time tm now; time_t timev = time(0); localtime_s( &now, &timev ); // format trace file name wchar...
#pragma once #include "xenonGPUDumpFormat.h" class CXenonGPUDumpWriterImpl : public IXenonGPUDumpWriter { public: // Close the file and finish the dump virtual void Close() override; /// Block (recursive) virtual void BeginBlock( const char* tag, uint32& outBlockID ) override; virtual void EndBlock( uint32 bloc...
/* Copyright (c) 2002,2007-2009, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list o...
#pragma once #include "xenonGPURegisters.h" #include "xenonGPUState.h" class CXenonGPUCommandBufferReader; class IXenonGPUDumpWriter; class CXenonGPUTraceWriter; /// GPU command executor, translates GPU commands from ring/command buffer (& registers) into state changes in the abstract layer class CXenonGPUExecutor {...
#pragma once namespace ucode { #pragma pack( push, 1 ) // Closest AMD doc: // http://developer.amd.com/wordpress/media/2012/10/R600_Instruction_Set_Architecture.pdf // Microcode format differs, but most fields/enums are the same. // This code comes from the freedreno project: // https://github.com/freedreno/f...
#include "build.h" #include "xenonGPUMicrocodeTransformer.h" #include "xenonGPUMicrocodeConstants.h" //#pragma optimize ("",off) using namespace ucode; // BASED ON THE FOLLOWING: /* * Copyright (c) 2012 Rob Clark <robdclark@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a *...
#pragma once #include "xenonGPUConstants.h" #include "xenonGPUUtils.h" namespace ucode { union instr_fetch_t; union instr_cf_t; struct instr_alu_t; struct instr_cf_exec_t; struct instr_fetch_tex_t; struct instr_fetch_vtx_t; } /// Shader transformer for Xbox360 shaders class CXenonGPUMicrocodeTransformer { publ...
#pragma once // Opcodes (IT_OPCODE) for Type-3 commands in the ringbuffer. Bluntly copied from: // https://github.com/freedreno/amd-gpu/blob/master/include/api/gsl_pm4types. // Also good reference found at: enum EXenonGPUType3Opcodes { PM4_ME_INIT = 0x48, // initialize CP's micro-engine PM4_NOP ...
// Direct copy paste from: // https://github.com/freedreno/amd-gpu/blob/master/include/reg/yamato/22/yamato_offset.h DECLARE_XENON_GPU_REGISTER(0x01DD, eType_Dword, SCRATCH_ADDR) DECLARE_XENON_GPU_REGISTER(0x01DC, eType_Dword, SCRATCH_UMSK) DECLARE_XENON_GPU_REGISTER(0x0578, eType_Dword, SCRATCH_REG0) // interrupt s...
#include "build.h" #include "xenonGPURegisters.h" //----------- CXenonGPUDirtyRegisterTracker::CXenonGPUDirtyRegisterTracker() { ClearAll(); } CXenonGPUDirtyRegisterTracker::~CXenonGPUDirtyRegisterTracker() { } void CXenonGPUDirtyRegisterTracker::ClearAll() { memset( m_mask, 0, sizeof(m_mask) ); } void CXenonGPU...
#pragma once /// based on AMD Driver implementation // https://github.com/freedreno/amd-gpu/blob/master/ /// Known registers enum class XenonGPURegister : uint32 { #define DECLARE_XENON_GPU_REGISTER(index, type, name) REG_##name = index, #include "xenonGPURegisterMap.h" #undef DECLARE_XENON_GPU_REGISTER }; /// GPU ...
#include "build.h" #include "xenonLibNatives.h" #include "xenonGPUUtils.h" #include "xenonGPUState.h" #include "xenonGPUAbstractLayer.h" #include "xenonGPURegisters.h" #include <xutility> #include "xenonGPUTextures.h" #include "xenonGPUDumpWriter.h" #pragma optimize("",off) namespace Helper { static inline bool Upda...
#pragma once /// based on AMD Driver implementation // https://github.com/freedreno/amd-gpu/blob/master/ #include "xenonGPUConstants.h" #include "xenonGPUUtils.h" class IXenonGPUAbstractLayer; class IXenonGPUDumpWriter; class CXenonGPURegisters; class CXenonGPUDirtyRegisterTracker; /// State holder for render targe...
#include "build.h" #include "xenonGPUTextures.h" #include "xenonGPUUtils.h" //#pragma optimize("",off) //------------------------------------ const uint32 XenonTextureFormatInfo::GetBlockSizeInBytes() const { return (m_blockHeight * m_blockWidth * m_bitsPerBlock) / 8; } const XenonTextureFormatInfo* XenonTextureFo...
#pragma once #include "xenonGPUConstants.h" #pragma pack(push, 4) union XenonGPUTextureFetch { struct { uint32 type : 2; // dword_0 uint32 sign_x : 2; uint32 sign_y : 2; uint32 sign_z : 2; uint32 sign_w : 2; uint32 clamp_x : 3; ...
#include "build.h" #include "xenonLibNatives.h" #include "xenonGPUThread.h" #include "xenonGPUAbstractLayer.h" #include "xenonGPUExecutor.h" #include "xenonGPUCommandBuffer.h" #include "xenonPlatform.h" #include "../host_core/runtimeTraceFile.h" CXenonGPUThread::CXenonGPUThread( CXenonGPUCommandBuffer& cmdBuffer, CXen...
#pragma once class CXenonGPUExecutor; class CXenonGPUCommandBuffer; class IXenonGPUAbstractLayer; /// GPU execution thread /// Normally, this is the GPU itself /// The GPU is sucking stuff through the command buffer and communicating though interrupts class CXenonGPUThread { public: CXenonGPUThread( CXenonGPUCommand...
#include "build.h" #include "xenonGPUTraceWriter.h" CXenonGPUTraceWriter::CXenonGPUTraceWriter( FILE* f ) : m_file( f ) , m_indent( 0 ) { } CXenonGPUTraceWriter::~CXenonGPUTraceWriter() { if ( m_file ) { fclose( m_file ); m_file = nullptr; } } CXenonGPUTraceWriter* CXenonGPUTraceWriter::Create(const std::ws...
#pragma once /// Simple trace writer for GPU class CXenonGPUTraceWriter { public: ~CXenonGPUTraceWriter(); /// Indentation void Indent( int delta ); /// Write void Write( const char* txt ); void Writef( const char* txt, ... ); // create writer static CXenonGPUTraceWriter* Create(const std::wstring& path); ...
#include "build.h" #include "xenonGPU.h" #include "xenonGPUUtils.h" //#pragma optimize( "", off ) #define __LITTLE_ENDIAN 1234 #define __BIG_ENDIAN 4321 #define __BYTE_ORDER __LITTLE_ENDIAN #include <xmmintrin.h> #define PREFETCH(location) _mm_prefetch(location, _MM_HINT_T0) namespace crc32 { // ///////////...
#pragma once #include "xenonGPUConstants.h" #include "xenonPlatform.h" #include "xenonMemory.h" #define XENON_GPU_MAKE_SWIZZLE(x, y, z, w) \ (((eXenonGPUSwizzle_##x) << 0) | ((eXenonGPUSwizzle_##y) << 3) | \ ((eXenonGPUSwizzle_##z) << 6) | ((eXenonGPUSwizzle_##w) << 9)) // swizzle combinations used on GPU e...
#include "build.h" #include "xenonPlatform.h" #include "xenonGraphics.h" #include "xenonGPU.h" namespace xenon { namespace lib { extern void RtlInitializeCriticalSection(lib::XCRITICAL_SECTION* rtlCS); } //---- Graphics::Graphics(runtime::Symbols& symbols, const launcher::Commandline& commandline) : m_gpuI...
#pragma once #include "xenonGPU.h" #include "../host_core/launcherCommandline.h" namespace xenon { /// Graphics system wrapper (CPU side of rendering) class Graphics { public: Graphics(runtime::Symbols& symbols, const launcher::Commandline& commandline); ~Graphics(); // setup the ring buffer, this initial...
#include "build.h" #include "xenonInplaceExecution.h" #include "../host_core/runtimeCodeExecutor.h" #include "../host_core/runtimeTraceWriter.h" #include "../host_core/runtimeTraceFile.h" namespace xenon { extern cpu::Reservation GReservation; InplaceExecution::InplaceExecution(Kernel* kernel, const InplaceExecuti...
#pragma once #include "xenonKernel.h" #include "../host_core/runtimeCodeExecutor.h" namespace xenon { /// Inplace (without a thread) code execution params class InplaceExecutionParams { public: uint32 m_stackSize; // thread stack size uint32 m_threadId; // thead id of the parent thread uint32 m_cp...
#include "build.h" #include "xenonKernel.h" #include "xenonInput.h" #include <Xinput.h> #pragma comment (lib, "xinput.lib") namespace xenon { #pragma warning (disable : 4995) //--- class XInputHandler : public IInputDeviceHandler { public: XInputHandler() {} virtual bool Initialize() override final { ...
#pragma once #include "xenonKernel.h" #include "xenonLibNatives.h" namespace xenon { ///---- /// internal device handler class IInputDeviceHandler { public: virtual ~IInputDeviceHandler() {}; virtual bool Initialize() = 0; virtual lib::XResult GetCapabilities(const uint32 user, const uint32 flags, lib::...
#include "build.h" #include "xenonLibNatives.h" #include "xenonThread.h" #include "xenonKernel.h" #include "xenonCPU.h" #include "xenonCPUDevice.h" #include "xenonInplaceExecution.h" #include "xenonMemory.h" #include "../host_core/nativeMemory.h" #include "../host_core/nativeKernel.h" #include "../host_core/native.h" ...
#pragma once #include "xenonLibNatives.h" #include "xenonCPU.h" #include "../host_core/nativeKernel.h" #include "../host_core/nativeMemory.h" namespace native { struct Systems; } namespace runtime { class CodeExecutor; class CodeTable; class IDeviceCPU; class TraceWriter; } namespace launcher { class Command...
#include "build.h" #include "xenonLib.h" namespace xenon { }