|
|
@@ -1771,6 +1771,10 @@ namespace bgfx
|
|
|
--m_colorPaletteDirty;
|
|
|
bx::memCopy(m_submit->m_colorPalette, m_clearColor, sizeof(m_clearColor) );
|
|
|
}
|
|
|
+
|
|
|
+ freeAllHandles(m_submit);
|
|
|
+ m_submit->resetFreeHandles();
|
|
|
+
|
|
|
m_submit->finish();
|
|
|
|
|
|
bx::xchg(m_render, m_submit);
|
|
|
@@ -1787,9 +1791,7 @@ namespace bgfx
|
|
|
m_submit->start();
|
|
|
|
|
|
bx::memSet(m_seq, 0, sizeof(m_seq) );
|
|
|
- freeAllHandles(m_submit);
|
|
|
|
|
|
- m_submit->resetFreeHandles();
|
|
|
m_submit->m_textVideoMem->resize(m_render->m_textVideoMem->m_small
|
|
|
, m_resolution.m_width
|
|
|
, m_resolution.m_height
|
|
|
@@ -3143,10 +3145,9 @@ error:
|
|
|
BGFX_ENCODER(setBuffer(_stage, handle, _access) );
|
|
|
}
|
|
|
|
|
|
- void Encoder::setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
+ void Encoder::setImage(uint8_t _stage, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
{
|
|
|
BX_CHECK(_stage < BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, "Invalid stage %d (max %d).", _stage, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
|
|
|
- BGFX_CHECK_HANDLE("setImage/UniformHandle", s_ctx->m_uniformHandle, _sampler);
|
|
|
BGFX_CHECK_HANDLE_INVALID_OK("setImage/TextureHandle", s_ctx->m_textureHandle, _handle);
|
|
|
_format = TextureFormat::Count == _format
|
|
|
? TextureFormat::Enum(s_ctx->m_textureRef[_handle.idx].m_format)
|
|
|
@@ -3155,7 +3156,7 @@ error:
|
|
|
BX_CHECK(_format != TextureFormat::BGRA8
|
|
|
, "Can't use TextureFormat::BGRA8 with compute, use TextureFormat::RGBA8 instead."
|
|
|
);
|
|
|
- BGFX_ENCODER(setImage(_stage, _sampler, _handle, _mip, _access, _format) );
|
|
|
+ BGFX_ENCODER(setImage(_stage, _handle, _mip, _access, _format) );
|
|
|
}
|
|
|
|
|
|
void Encoder::dispatch(ViewId _id, ProgramHandle _program, uint32_t _numX, uint32_t _numY, uint32_t _numZ, uint8_t _flags)
|
|
|
@@ -4277,10 +4278,10 @@ error:
|
|
|
s_ctx->m_encoder0->setBuffer(_stage, _handle, _access);
|
|
|
}
|
|
|
|
|
|
- void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
+ void setImage(uint8_t _stage, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format)
|
|
|
{
|
|
|
BGFX_CHECK_API_THREAD();
|
|
|
- s_ctx->m_encoder0->setImage(_stage, _sampler, _handle, _mip, _access, _format);
|
|
|
+ s_ctx->m_encoder0->setImage(_stage, _handle, _mip, _access, _format);
|
|
|
}
|
|
|
|
|
|
void dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX, uint32_t _numY, uint32_t _numZ, uint8_t _flags)
|
|
|
@@ -5301,11 +5302,10 @@ BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _
|
|
|
bgfx::submit(_id, handle.cpp, indirectHandle.cpp, _start, _num, _depth, _preserveState);
|
|
|
}
|
|
|
|
|
|
-BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
|
|
|
+BGFX_C_API void bgfx_set_image(uint8_t _stage, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
|
|
|
{
|
|
|
- union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
|
|
|
union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
|
|
|
- bgfx::setImage(_stage, sampler.cpp, handle.cpp, _mip, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
|
|
|
+ bgfx::setImage(_stage, handle.cpp, _mip, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) );
|
|
|
}
|
|
|
|
|
|
BGFX_C_API void bgfx_set_compute_index_buffer(uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access)
|
|
|
@@ -5500,11 +5500,10 @@ BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder* _encoder, bgfx_view_i
|
|
|
BGFX_ENCODER(submit(_id, handle.cpp, indirectHandle.cpp, _start, _num, _depth, _preserveState) );
|
|
|
}
|
|
|
|
|
|
-BGFX_C_API void bgfx_encoder_set_image(bgfx_encoder* _encoder, uint8_t _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
|
|
|
+BGFX_C_API void bgfx_encoder_set_image(bgfx_encoder* _encoder, uint8_t _stage, bgfx_texture_handle_t _handle, uint8_t _mip, bgfx_access_t _access, bgfx_texture_format_t _format)
|
|
|
{
|
|
|
- union { bgfx_uniform_handle_t c; bgfx::UniformHandle cpp; } sampler = { _sampler };
|
|
|
union { bgfx_texture_handle_t c; bgfx::TextureHandle cpp; } handle = { _handle };
|
|
|
- BGFX_ENCODER(setImage(_stage, sampler.cpp, handle.cpp, _mip, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) ) );
|
|
|
+ BGFX_ENCODER(setImage(_stage, handle.cpp, _mip, bgfx::Access::Enum(_access), bgfx::TextureFormat::Enum(_format) ) );
|
|
|
}
|
|
|
|
|
|
BGFX_C_API void bgfx_encoder_set_compute_index_buffer(bgfx_encoder* _encoder, uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access)
|