71 static const GX_FLAG RENDER_ATTRIBUTE_FLAG_LIST[8];
86 void cleanup(
void)
override;
92 virtual b32 initialize3D(
const GxSize& resolution, u32 depth, u32 mipLevel,
RENDER_FORMAT format, u32 attribute);
97#if GX_USE_DX11 || GX_USE_DX12
99 virtual b32 initializeRenderTarget(GxNativeTexture pD3DTexture2D, u32 attribute);
101#if defined(_PS4) || defined(_PS5)
111 virtual b32 initializeInner(
void);
128 GX_FORCE_INLINE
GxString getRenderNotifierName(
void)
const override {
GxString string;
return string.
format(
"ClassName:%s Name:%s", getRtti().getClassName(), getName()); }
132 void save(GX_CSTR path);
138 void onLostDevice(
void)
override;
141 b32 onResetDevice(
void)
override;
148 virtual b32 map(u32 arrayIndex, u32 mipLevel, u32 mappingType, GxMappingInformation* pMappingInformation);
150 virtual void unmap(u32 arrayIndex, u32 mipLevel);
154 void copyRenderTargetToTexture(
void);
159 void getThumbnail(
void* pBuffer,
const GxSize& size,
b32 isConstAspectRatio =
false);
162#if GX_USE_DX11 || GX_USE_DX12
164 virtual b32 freeze(
void);
169 u32 getMipSize(u32 mipLevel, u32 originalPitch);
171 u32 getMipPitch(u32 mipLevel, u32 originalPitch);
175#if GX_USE_DX11 || GX_USE_DX12
177 void* getMipData(u32 arrayIndex, u32 mipLevel);
209 void setName(GX_CSTR name);
211 constexpr GX_CSTR
getName(
void)
const {
return _name.getString(); }
220 GX_FORCE_INLINE GxNativeTexture* getTexture(
void) {
return &_texture; }
222 GX_FORCE_INLINE GxNativeTexture* getTexture(
void)
const {
return _pTexture; }
224 GX_FORCE_INLINE GxNativeTexture
getTexture(
void)
const {
return _pTexture; }
227#if GX_USE_DX11 || GX_USE_DX12
229 static RENDER_FORMAT getFormat(GxNativeRenderFormat nativeFormat);
232 static GxNativeRenderFormat getNativeFormat(RENDER_FORMAT format, u32 attribute);
234#if GX_USE_DX11 || GX_USE_DX12
243 GxNativeRenderTarget getRenderTarget(
void)
const {
return _pRenderTarget; }
245 GxNativeDepthStencil getDepthStencil(
void)
const {
return _pDepthStencil; }
248 ID3D11ShaderResourceView* getD3D11ShaderResourceView(
void)
const {
return _pD3D11ShaderResourceView; }
250 ID3D11UnorderedAccessView* getD3D11UnorderedAccessView(
void)
const {
return _pD3D11UnorderedAccessView; }
252 GxNativeDepthStencil getD3D11ReadOnlyDepthStencilView(
void)
const {
return _pReadOnlyDepthStencilView; }
255 GX_FORCE_INLINE D3D12_CPU_DESCRIPTOR_HANDLE getD3D12RenderTargetDescriptorHandle(
void)
const {
return _pD3D12DescriptorHeapRtv->GetCPUDescriptorHandleForHeapStart(); }
257 GX_FORCE_INLINE D3D12_CPU_DESCRIPTOR_HANDLE getD3D12DepthStencilDescriptorHandle(
void)
const {
return _pD3D12DescriptorHeapDsv->GetCPUDescriptorHandleForHeapStart(); }
259 constexpr u32 getDescriptorHeapIndexSrv(
void)
const {
return _descriptorHeapIndexSrv; }
261 constexpr u32 getDescriptorHeapIndexUav(
void)
const {
return _descriptorHeapIndexUav; }
263 GX_FORCE_INLINE
b32 isD3DResourceStates(D3D12_RESOURCE_STATES states)
const {
return _d3dResourceStates == states || (_d3dResourceStates & states) > 0; }
265 constexpr D3D12_RESOURCE_STATES getD3DResourceStates(
void)
const {
return _d3dResourceStates; }
267 constexpr void setD3DResourceStates(D3D12_RESOURCE_STATES states) { _d3dResourceStates = states; }
271 constexpr u32 getTextureID(
void)
const {
return _textureId; }
273 void setTexture(GxNativeTexture* pTexture,
const GxSize* pOverrideResolution =
nullptr);
277 static b32 getSwizzle(
RENDER_FORMAT format, GxNativeTextureSwizzle& red, GxNativeTextureSwizzle& green, GxNativeTextureSwizzle& blue, GxNativeTextureSwizzle& alpha);
287 const GxColorHDR getTexelTile( u32 width,
const u8* pImage, u32 positionX, u32 positionY )
const;
289 const GxColorHDR getTexelDXT1( u32 width,
const u8* pImage, u32 positionX, u32 positionY )
const;
291 const GxColorHDR getTexelDXT3( u32 width,
const u8* pImage, u32 positionX, u32 positionY )
const;
293 const GxColorHDR getTexelDXT5( u32 width,
const u8* pImage, u32 positionX, u32 positionY )
const;
295 const GxColor getDecompressColor(
const u16 color )
const;
310 u32 _depthOrArrayCount;
315 b32 _isTextureSurface;
319 GxNativeTexture _texture;
321 GxNativeTexture* _pTexture;
323 GxNativeTexture _pTexture;
325#if GX_USE_DX11 || GX_USE_DX12
326 GxNativeRenderTarget _pRenderTarget;
327 GxNativeDepthStencil _pDepthStencil;
329 GxNativeRenderTarget _renderTarget;
330 GxNativeDepthStencil _depthStencil;
332#if GX_USE_DX11 || GX_USE_DX12
333 GxNativeTexture _pTextureMap;
336 ID3D11ShaderResourceView* _pD3D11ShaderResourceView;
337 ID3D11UnorderedAccessView* _pD3D11UnorderedAccessView;
338 GxNativeDepthStencil _pReadOnlyDepthStencilView;
340 ComPtr<ID3D12DescriptorHeap> _pD3D12DescriptorHeapRtv;
341 ComPtr<ID3D12DescriptorHeap> _pD3D12DescriptorHeapDsv;
342 u32 _descriptorHeapIndexSrv;
343 u32 _descriptorHeapIndexUav;
344 u32 _rtvDescriptorSize;
345 D3D12_RESOURCE_STATES _d3dResourceStates;
349 GxSize _mipSizes[GX_MIPMAP_COUNT_MAX];
350 u32 _mipOffsets[GX_MIPMAP_COUNT_MAX];
353 void* _pMappedRawData;
357 u32 _vramAllocateSize;
テクスチャクラス
Definition GxRenderTexture.h:19
constexpr RENDER_TEXTURE_TYPE getType(void) const
テクスチャタイプを取得
Definition GxRenderTexture.h:190
constexpr GX_CSTR getName(void) const
名前の取得
Definition GxRenderTexture.h:211
constexpr u32 getDepth(void) const
3D深度を取得
Definition GxRenderTexture.h:198
GX_FORCE_INLINE GxNativeTexture getTexture(void) const
テクスチャを取得
Definition GxRenderTexture.h:224
constexpr u32 getAttribute(void) const
属性を取得
Definition GxRenderTexture.h:204
void onRender(void) override
描画通知
Definition GxRenderTexture.h:144
constexpr RENDER_FORMAT getFormat(void) const
フォーマットを取得
Definition GxRenderTexture.h:192
constexpr u32 getMipLevel(void) const
ミップレベル
Definition GxRenderTexture.h:202
constexpr RENDER_ANTI_ALIASING getAntiAliasing(void) const
アンチエイリアシングを取得
Definition GxRenderTexture.h:194
constexpr GX_HANDLE getHandle(void) const
テクスチャハンドルを取得
Definition GxRenderTexture.h:206
GX_FORCE_INLINE const GxSize & getResolution(void) const
解像度を取得
Definition GxRenderTexture.h:196
constexpr u32 getArrayCount(void) const
配列数を取得
Definition GxRenderTexture.h:200