[D3D12] SRV and sampler bindings
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#ifndef XENIA_GPU_D3D12_D3D12_SHADER_H_
|
||||
#define XENIA_GPU_D3D12_D3D12_SHADER_H_
|
||||
|
||||
#include "xenia/gpu/hlsl_shader_translator.h"
|
||||
#include "xenia/gpu/shader.h"
|
||||
#include "xenia/ui/d3d12/d3d12_api.h"
|
||||
|
||||
@@ -23,17 +24,39 @@ class D3D12Shader : public Shader {
|
||||
const uint32_t* dword_ptr, uint32_t dword_count);
|
||||
~D3D12Shader() override;
|
||||
|
||||
void SetTexturesAndSamplers(
|
||||
const HlslShaderTranslator::TextureSRV* texture_srvs,
|
||||
uint32_t texture_srv_count, const uint32_t* sampler_fetch_constants,
|
||||
uint32_t sampler_count);
|
||||
|
||||
bool Prepare();
|
||||
|
||||
const uint8_t* GetDXBC() const;
|
||||
size_t GetDXBCSize() const;
|
||||
|
||||
// TODO(Triang3l): Real texture counts.
|
||||
uint32_t GetTextureSRVCount() const { return 0; }
|
||||
uint32_t GetSamplerCount() const { return 0; }
|
||||
struct TextureSRV {
|
||||
uint32_t fetch_constant;
|
||||
TextureDimension dimension;
|
||||
};
|
||||
const TextureSRV* GetTextureSRVs(uint32_t& count_out) const {
|
||||
count_out = texture_srv_count_;
|
||||
return texture_srvs_;
|
||||
}
|
||||
const uint32_t* GetSamplerFetchConstants(uint32_t& count_out) const {
|
||||
count_out = sampler_count_;
|
||||
return sampler_fetch_constants_;
|
||||
}
|
||||
const uint32_t GetUsedTextureMask() const { return used_texture_mask_; }
|
||||
|
||||
private:
|
||||
ID3DBlob* blob_ = nullptr;
|
||||
|
||||
// Up to 32 2D array textures, 32 3D textures and 32 cube textures.
|
||||
TextureSRV texture_srvs_[96];
|
||||
uint32_t texture_srv_count_ = 0;
|
||||
uint32_t sampler_fetch_constants_[32];
|
||||
uint32_t sampler_count_ = 0;
|
||||
uint32_t used_texture_mask_ = 0;
|
||||
};
|
||||
|
||||
} // namespace d3d12
|
||||
|
||||
Reference in New Issue
Block a user