[D3D12] DXBC texture bindings (but no samplers and fetch)
This commit is contained in:
@@ -27,18 +27,20 @@ D3D12Shader::~D3D12Shader() {
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void D3D12Shader::SetTexturesAndSamplers(
|
||||
const HlslShaderTranslator::TextureSRV* texture_srvs,
|
||||
const DxbcShaderTranslator::TextureSRV* texture_srvs,
|
||||
uint32_t texture_srv_count, const uint32_t* sampler_fetch_constants,
|
||||
uint32_t sampler_count) {
|
||||
used_texture_mask_ = 0;
|
||||
for (uint32_t i = 0; i < texture_srv_count; ++i) {
|
||||
TextureSRV& srv = texture_srvs_[i];
|
||||
const HlslShaderTranslator::TextureSRV& translator_srv = texture_srvs[i];
|
||||
const DxbcShaderTranslator::TextureSRV& translator_srv = texture_srvs[i];
|
||||
srv.fetch_constant = translator_srv.fetch_constant;
|
||||
srv.dimension = translator_srv.dimension;
|
||||
used_texture_mask_ |= 1u << translator_srv.fetch_constant;
|
||||
}
|
||||
texture_srv_count_ = texture_srv_count;
|
||||
#if 0
|
||||
// If there's a texture, there's a sampler for it.
|
||||
used_texture_mask_ = 0;
|
||||
for (uint32_t i = 0; i < sampler_count; ++i) {
|
||||
@@ -47,8 +49,8 @@ void D3D12Shader::SetTexturesAndSamplers(
|
||||
used_texture_mask_ |= 1u << sampler_fetch_constant;
|
||||
}
|
||||
sampler_count_ = sampler_count;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool D3D12Shader::DisassembleDXBC() {
|
||||
if (!host_disassembly_.empty()) {
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#ifndef XENIA_GPU_D3D12_D3D12_SHADER_H_
|
||||
#define XENIA_GPU_D3D12_D3D12_SHADER_H_
|
||||
|
||||
// TODO(Triang3l): Remove hlsl_shader_translator.
|
||||
#include "xenia/gpu/hlsl_shader_translator.h"
|
||||
#include "xenia/gpu/dxbc_shader_translator.h"
|
||||
#include "xenia/gpu/shader.h"
|
||||
#include "xenia/ui/d3d12/d3d12_api.h"
|
||||
|
||||
@@ -25,12 +24,10 @@ class D3D12Shader : public Shader {
|
||||
const uint32_t* dword_ptr, uint32_t dword_count);
|
||||
~D3D12Shader() override;
|
||||
|
||||
#if 0
|
||||
void SetTexturesAndSamplers(
|
||||
const HlslShaderTranslator::TextureSRV* texture_srvs,
|
||||
const DxbcShaderTranslator::TextureSRV* texture_srvs,
|
||||
uint32_t texture_srv_count, const uint32_t* sampler_fetch_constants,
|
||||
uint32_t sampler_count);
|
||||
#endif
|
||||
|
||||
bool DisassembleDXBC();
|
||||
|
||||
|
||||
@@ -198,15 +198,15 @@ bool PipelineCache::TranslateShader(D3D12Shader* shader,
|
||||
|
||||
// TODO(Triang3l): Re-enable this when the DXBC shader translators supports
|
||||
// textures.
|
||||
#if 0
|
||||
uint32_t texture_srv_count, sampler_count;
|
||||
const HlslShaderTranslator::TextureSRV* texture_srvs =
|
||||
uint32_t texture_srv_count;
|
||||
const DxbcShaderTranslator::TextureSRV* texture_srvs =
|
||||
shader_translator_->GetTextureSRVs(texture_srv_count);
|
||||
#if 0
|
||||
uint32_t sampler_count;
|
||||
const uint32_t* sampler_fetch_constants =
|
||||
shader_translator_->GetSamplerFetchConstants(sampler_count);
|
||||
shader->SetTexturesAndSamplers(texture_srvs, texture_srv_count,
|
||||
sampler_fetch_constants, sampler_count);
|
||||
#endif
|
||||
shader->SetTexturesAndSamplers(texture_srvs, texture_srv_count, nullptr, 0);
|
||||
|
||||
if (shader->is_valid()) {
|
||||
XELOGGPU("Generated %s shader (%db) - hash %.16" PRIX64 ":\n%s\n",
|
||||
|
||||
Reference in New Issue
Block a user