mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
demos: Get rid of handwritten GLSL shaders.
This commit is contained in:
@@ -340,31 +340,3 @@ static inline HRESULT demo_create_root_signature(ID3D12Device *device,
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static inline bool demo_load_shader(struct demo *demo, const wchar_t *hlsl_name, const char *entry_point,
|
||||
const char *profile, const char *spv_name, D3D12_SHADER_BYTECODE *shader)
|
||||
{
|
||||
ID3D10Blob *blob, *errors;
|
||||
HRESULT hr;
|
||||
|
||||
hr = demo->compile_from_file(hlsl_name, NULL, NULL, entry_point, profile, 0, 0, &blob, &errors);
|
||||
if (errors)
|
||||
{
|
||||
fprintf(stderr, "%.*s\n", (int)ID3D10Blob_GetBufferSize(errors), (char *)ID3D10Blob_GetBufferPointer(errors));
|
||||
ID3D10Blob_Release(errors);
|
||||
}
|
||||
if (FAILED(hr))
|
||||
return false;
|
||||
|
||||
shader->BytecodeLength = ID3D10Blob_GetBufferSize(blob);
|
||||
if (!(shader->pShaderBytecode = malloc(shader->BytecodeLength)))
|
||||
{
|
||||
ID3D10Blob_Release(blob);
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy((void *)shader->pShaderBytecode, ID3D10Blob_GetBufferPointer(blob), shader->BytecodeLength);
|
||||
|
||||
ID3D10Blob_Release(blob);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user